/* ============================================================
   NAVIGATION — Mobile Header · Desktop Nav · Tab Bar · Overlays
   ============================================================ */

/* ── LOGO MARK (shared) ──────────────────────────────────── */

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid var(--espresso);
  background: var(--tan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease);
}

.logo-mark span {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  color: var(--espresso);
  letter-spacing: -0.5px;
  line-height: 1;
  user-select: none;
}

.logo-wordmark {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--espresso);
  letter-spacing: -0.3px;
  line-height: 1;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.site-logo:hover .logo-mark { transform: scale(1.06); }

/* ── MOBILE HEADER ───────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(245, 240, 232, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--border-s);
  box-shadow: 0 1px 12px rgba(44,25,14,0.06);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--sp-5);
}

.site-header__right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Icon buttons in header */
.header-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

.header-btn:hover { background: var(--bg-raised); border-color: var(--border); }
.header-btn:active { transform: scale(0.95); }

.header-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; }

/* Cart badge */
.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--forest);
  color: #fff;
  font: 700 10px/18px var(--font-body);
  text-align: center;
  padding-inline: 4px;
  border: 2px solid var(--bg-base);
}

.cart-badge:empty, .cart-badge[data-count="0"] { display: none; }

/* More button */
.more-btn {
  background: none;
  border: none;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  padding: var(--sp-2);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast);
}
.more-btn:hover { color: var(--ink); }

/* Hide mobile header on desktop */
@media (min-width: 1024px) { .site-header { display: none; } }

/* ── DESKTOP NAVIGATION ──────────────────────────────────── */

.nav-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--desktop-nav-h);
    background: rgba(245, 240, 232, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur-base) var(--ease),
                box-shadow var(--dur-base) var(--ease);
  }

  .nav-desktop.is-scrolled {
    border-bottom-color: var(--border-s);
    box-shadow: 0 1px 20px rgba(44,25,14,0.07);
  }

  .nav-desktop .nav-desktop__inner {
    width: 100%;
    max-width: calc(var(--max-content) + 2 * var(--page-margin));
    margin-inline: auto;
    padding-inline: var(--page-margin);
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0;
  }

  /* Desktop logo — slightly larger mark */
  .nav-desktop .logo-mark {
    width: 36px;
    height: 36px;
  }
  .nav-desktop .logo-mark span { font-size: 13px; }
  .nav-desktop .logo-wordmark  { font-size: var(--text-base); }

  /* Center nav links */
  .nav-links {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--sp-10);
  }

  .nav-link {
    font: 500 var(--text-sm)/1 var(--font-body);
    color: var(--ink-2);
    text-decoration: none;
    position: relative;
    padding: 4px 0;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease);
  }

  /* Animated underline */
  .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--espresso);
    transition: width var(--dur-base) var(--ease),
                transform-origin var(--dur-base);
    transform-origin: left center;
  }

  .nav-link:hover { color: var(--espresso); }
  .nav-link:hover::after { width: 100%; }

  .nav-link.current-page-item,
  .nav-link[aria-current="page"] {
    color: var(--espresso);
    font-weight: 600;
  }
  .nav-link.current-page-item::after { width: 100%; }

  /* Right utility */
  .nav-right {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-shrink: 0;
  }

  /* Language button */
  .lang-btn {
    height: 32px;
    padding: 0 var(--sp-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    font: 500 var(--text-xs)/1 var(--font-body);
    color: var(--ink-3);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: background var(--dur-fast), border-color var(--dur-fast);
    position: relative;
  }

  .lang-btn:hover {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--ink-2);
  }

  .lang-btn svg { width: 12px; height: 12px; transition: transform var(--dur-fast); }
  .lang-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

  /* Language dropdown */
  .lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 150px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity var(--dur-fast) var(--ease),
                transform var(--dur-fast) var(--ease);
    z-index: 10;
  }

  .lang-dropdown.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .lang-option {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 10px var(--sp-4);
    font: 400 var(--text-sm)/1 var(--font-body);
    color: var(--ink);
    cursor: pointer;
    transition: background var(--dur-fast);
    text-decoration: none;
  }

  .lang-option:hover { background: var(--bg-raised); }
  .lang-option.current { font-weight: 600; color: var(--forest); }
  .lang-option span { font-size: 16px; line-height: 1; }

  /* Desktop cart button */
  .nav-cart-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--ink);
    transition: background var(--dur-fast), border-color var(--dur-fast);
  }

  .nav-cart-btn:hover { background: var(--bg-raised); }
  .nav-cart-btn svg { width: 18px; height: 18px; }

  /* Sticky buy bar — product pages */
  .sticky-buy-bar {
    position: fixed;
    top: var(--desktop-nav-h);
    right: 0;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 0 var(--radius-md);
    padding: var(--sp-3) var(--sp-5);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    box-shadow: var(--shadow-sm);
    transform: translateX(110%);
    transition: transform var(--dur-slow) var(--ease-spring);
    z-index: 99;
    max-width: 360px;
  }

  .sticky-buy-bar.is-visible { transform: translateX(0); }

  .sticky-buy-bar__title {
    font: 500 var(--text-sm)/1.3 var(--font-body);
    color: var(--ink);
  }

  .sticky-buy-bar__price {
    font: 600 var(--text-lg)/1 var(--font-display);
    color: var(--ink);
    white-space: nowrap;
  }
}

/* ── BOTTOM TAB BAR ─────────────────────────────────────── */

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: auto;
  padding-bottom: var(--tab-safe);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-s);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px var(--sp-2) 8px;
  gap: 3px;
  text-decoration: none;
  color: var(--ink-3);
  font: 500 9px/1 var(--font-body);
  position: relative;
  transition: color var(--dur-fast) var(--ease);
  min-height: var(--tab-h);
}

.tab-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  flex-shrink: 0;
}

.tab-item.is-active {
  color: var(--forest);
}

/* Active dot indicator */
.tab-item.is-active::before {
  content: '';
  position: absolute;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--forest);
}

/* Tap feedback */
.tab-item:active { opacity: 0.7; }

/* Hide tab bar on desktop */
@media (min-width: 1024px) { .tab-bar { display: none; } }

/* ── MORE BOTTOM SHEET ────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(44, 25, 14, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease);
}

.overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.more-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 201;
  background: var(--bg-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--sp-3) var(--sp-5);
  padding-bottom: calc(var(--tab-safe) + var(--sp-6));
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-out);
  max-height: 80vh;
  overflow-y: auto;
}

.more-sheet.is-open { transform: translateY(0); }

/* Drag handle */
.more-sheet::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto var(--sp-5);
}

.more-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.more-sheet__title {
  font: 600 var(--text-base)/1 var(--font-body);
  color: var(--ink);
}

.more-sheet__close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-raised);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
}

.more-sheet__close svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }

.more-sheet__links { display: flex; flex-direction: column; }

.more-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border-s);
  font: 500 var(--text-base)/1 var(--font-body);
  color: var(--ink);
  text-decoration: none;
}

.more-link:last-child { border-bottom: none; }
.more-link svg { width: 16px; height: 16px; stroke: var(--ink-3); fill: none; }

/* Language grid in more sheet */
.more-sheet__lang {
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-s);
  margin-top: var(--sp-2);
}

.more-sheet__lang-label {
  font: 500 var(--text-xs)/1 var(--font-mono);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-3);
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}

.lang-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font: 500 var(--text-sm)/1 var(--font-body);
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  text-decoration: none;
}

.lang-chip:hover { border-color: var(--espresso); color: var(--espresso); }
.lang-chip.current {
  border-color: var(--forest);
  color: var(--forest);
  background: var(--forest-tint);
}

.lang-chip span { font-size: 18px; line-height: 1; }

/* ── LANGUAGE SWITCHER (desktop dropdown) ─────────────────── */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
}
.lang-btn {
  height: 32px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  font: 500 var(--text-xs)/1 var(--font-body);
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.lang-btn:hover { background: var(--bg-surface); color: var(--ink-2); }
.lang-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; transition: transform var(--dur-fast); }
.lang-btn__flag svg { display: block; border-radius: 1px; }
.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
  z-index: 10;
}
.lang-switcher:hover .lang-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-4);
  font: 400 var(--text-sm)/1 var(--font-body);
  color: var(--ink);
  text-decoration: none;
  transition: background var(--dur-fast);
}
.lang-option:hover { background: var(--bg-raised); }
.lang-option.current { font-weight: 600; color: var(--forest); }
.lang-option__flag { display: flex; align-items: center; border-radius: 1px; overflow: hidden; }
.lang-option__flag svg { display: block; }
