/* =====================================================
   Little Fjord — 공통 네비게이션 & 푸터 스타일
   nav.css  |  모든 페이지에서 <link rel="stylesheet" href="nav.css"> 로 불러오세요
   ===================================================== */

/* ── 공통 변수 (각 페이지 :root 와 충돌하지 않도록 선언만 해둡니다) ── */
:root {
  --bg:         #fcf9f5;
  --text:       #2c3e36;
  --muted:      #7a867f;
  --line:       rgba(44, 62, 54, 0.1);
  --green:      #4a665a;
  --green-dark: #3a5248;
  --shadow:     0 15px 35px rgba(44, 62, 54, 0.06);
}

/* ── 헤더 ── */
header {
  background: rgba(252, 249, 245, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--line);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

/* ── 브랜드 ── */
.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
}
.brand:hover { text-decoration: none; }
.brand-name {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--green);
  font-style: italic;
  text-decoration: none !important;
}

/* ── 데스크톱 메뉴 ── */
.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav-links a {
  position: relative;
  margin: 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--green);
  font-weight: 700;
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--green);
  transform: translateX(-50%);
}

/* ── 오른쪽 유틸 링크 ── */
.nav-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  position: relative;
  z-index: 2;
}
.util-links {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.util-links a,
.util-links a:visited,
.util-links a:active { text-decoration: none; color: inherit; }
.util-links a:hover  { color: var(--green); }
.util-links .separator { opacity: 0.6; }
.util-links .user-name { color: var(--text); font-weight: 500; }
.separator { opacity: 0.4; }

/* ── 카트 아이콘 ── */
.cart-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  transition: background .2s ease;
}
.cart-wrapper:hover { background: rgba(44, 62, 54, 0.05); }
.cart-icon  { font-size: 21px; line-height: 1; color: var(--text); }
.cart-count {
  position: absolute;
  top: -2px; right: -3px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 10px; font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg);
}

/* ── 드롭다운 (Product) ── */
.dropdown {
  position: relative;
  display: flex;
  align-items: center;
}
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0; margin: 0;
  font: inherit;
  color: var(--muted);
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.dropdown-toggle:hover,
.dropdown.open .dropdown-toggle { color: var(--green); font-weight: 700; }
.dropdown-arrow { font-size: 12px; line-height: 1; transition: transform 0.25s ease; }
.dropdown.open .dropdown-arrow { transform: rotate(180deg); }

.dropdown-horizontal {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  display: flex;
  align-items: center;
  gap: 32px;
  background: rgba(252, 249, 245, 0.98);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  white-space: nowrap;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}
.dropdown.open .dropdown-horizontal {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dropdown-horizontal a {
  margin: 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px; font-weight: 500;
  transition: color 0.2s ease;
}
.dropdown-horizontal a:hover { color: var(--green); }

/* ── 햄버거 버튼 ── */
.menu-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 0; background: transparent; padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--green);
  border-radius: 999px;
  transition: 0.25s ease;
}
.mobile-drawer,
.mobile-drawer-backdrop { display: none; }

/* ── 푸터 ── */
.site-footer {
  background: #f9f7f4;
  padding: 40px 20px;
  text-align: center;
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}
.footer-inner    { max-width: 1000px; margin: 0 auto; }
.footer-brand    { font-weight: 500; margin-bottom: 10px; color: #333; }
.footer-business p { margin: 3px 0; }
.footer-links    { margin-top: 15px; }
.footer-links a  { color: #444; text-decoration: none; margin: 0 5px; }
.footer-links a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════
   모바일 (768px 이하)
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav { height: 68px; }
  .brand-name { font-size: 22px; line-height: 1.1; }

  .nav-links,
  .desktop-nav-actions { display: none; }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  /* 백드롭 */
  .mobile-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(44, 62, 54, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1200;
  }

  /* 사이드 드로어 */
  .mobile-drawer {
    display: block;
    position: fixed;
    top: 0; right: 0;
    width: min(86vw, 360px);
    height: 100vh;
    background: #fcf9f5;
    border-left: 1px solid var(--line);
    box-shadow: -10px 0 30px rgba(0,0,0,0.10);
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 1300;
    padding: 20px 22px 28px;
    overflow-y: auto;
  }

  body.drawer-open .mobile-drawer           { transform: translateX(0); }
  body.drawer-open .mobile-drawer-backdrop  { opacity: 1; visibility: visible; pointer-events: auto; }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
  }
  .mobile-drawer-title { font-size: 18px; color: var(--green); font-weight: 700; }
  .mobile-drawer-close {
    border: 0; background: transparent;
    font-size: 28px; line-height: 1;
    color: var(--text); cursor: pointer; padding: 0;
  }

  .mobile-user-links {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }
  .mobile-user-links .util-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    white-space: normal;
    font-size: 12px;
  }
  .mobile-user-links .util-links a,
  .mobile-user-links .util-links span,
  .mobile-user-links .user-name { font-size: 12px; line-height: 1.4; }

  /* 모바일 메뉴 항목 */
  .mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .mobile-menu > a,
  .mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 0;
    border: 0; background: transparent;
    text-decoration: none;
    color: var(--text);
    font-size: 16px; font-weight: 500;
    text-align: left;
    border-bottom: 1px solid rgba(44, 62, 54, 0.08);
    cursor: pointer;
  }
  .mobile-menu > a.active { color: var(--green); font-weight: 700; }

  .mobile-dropdown-arrow { font-size: 12px; transition: transform 0.25s ease; }
  .mobile-dropdown.open .mobile-dropdown-arrow { transform: rotate(180deg); }

  .mobile-submenu {
    display: none;
    padding: 6px 0 10px 14px;
    border-bottom: 1px solid rgba(44, 62, 54, 0.08);
  }
  .mobile-dropdown.open .mobile-submenu {
    display: flex;
    flex-direction: column;
  }
  .mobile-submenu a {
    text-decoration: none;
    color: var(--muted);
    font-size: 14px;
    padding: 9px 0;
  }
}
