/* ══════════════════════════════════════════════════════════════
   SITE-NAV.CSS — Shared warm-cream navigation for every page.
   Load this AFTER the page's own styles so it wins the cascade.
   Palette: bg #FAF1E3 · line #EAD9C8 · ink #1C1009
            brown #5C3520 · terracotta #B85C3A · gold #C9A84C
   ══════════════════════════════════════════════════════════════ */

/* ── Nav bar ──
   Positioning (fixed vs sticky) is left to each page; this file only
   unifies the look. #nav-sage-brand (separate brand) is excluded. */
body > nav:not(#nav-sage-brand):not(.mob-overlay-links):not(.mobile-nav-menu) {
  height: 64px;
  top: 0;                 /* fixed & sticky navs always pin to the very top */
  align-items: center;
  gap: 1rem;
  padding: 0 2rem;
  background: rgba(250, 241, 227, 0.97) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #EAD9C8 !important;
  z-index: 500;           /* unified — nothing on the page covers the nav/hamburger */
}

/* All navs are flex with vertically-centered items.
   (#nav-ga keeps its 3-column grid on desktop; it collapses to flex ≤1024px below.) */
body > nav:not(#nav-sage-brand):not(#nav-ga):not(.mob-overlay-links):not(.mobile-nav-menu) {
  display: flex;
  justify-content: space-between;
}

.nav-left { display: flex; align-items: center; gap: 1.4rem; flex: 1; min-width: 0; }
.nav-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

/* ── Logo (Sage brand nav keeps its own) ── */
nav:not(#nav-sage-brand) .nav-logo, nav:not(#nav-sage-brand) .nav-logo:visited {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 0.85rem !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase;
  font-weight: 500;
  color: #5C3520 !important;
  text-decoration: none;
  white-space: nowrap;
}
a.nav-logo:hover { color: #B85C3A !important; }

/* ── Links (Sage & Clovers brand nav excluded) ── */
.nav-link, nav:not(#nav-sage-brand) .nav-links li a, .nav-ext-link, .nav-auth-link {
  color: rgba(92, 53, 32, 0.78) !important;
  text-decoration: none;
  font-size: 0.72rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
  font-weight: 400;
  white-space: nowrap;
  transition: color 0.2s;
  background: none;
}
.nav-link:hover, nav:not(#nav-sage-brand) .nav-links li a:hover, .nav-ext-link:hover, .nav-auth-link:hover {
  color: #B85C3A !important;
}
.nav-link.active, nav:not(#nav-sage-brand) .nav-links li a.active {
  color: #5C3520 !important;
  font-weight: 600;
}
.nav-link.gold { color: #B85C3A !important; }

/* Back link on order/checkout pages */
.nav-back {
  color: #B85C3A !important;
  text-decoration: none;
  font-size: 0.72rem !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-back:hover { color: #5C3520 !important; }

/* Member badge */
#nav-member-badge {
  color: #B85C3A !important;
  border: 1px solid rgba(184, 92, 58, 0.35) !important;
  font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.28rem 0.6rem; border-radius: 2px;
}

/* User email chip */
.nav-user-email { color: rgba(92, 53, 32, 0.55) !important; font-size: 0.68rem; }

/* ── Buttons in the nav ── */
#lang-btn {
  background: none !important;
  border: 1px solid rgba(92, 53, 32, 0.35) !important;
  color: #5C3520 !important;
  font-family: inherit;
  font-size: 0.65rem !important;
  letter-spacing: 0.12em;
  padding: 0.32rem 0.6rem !important;
  cursor: pointer;
  text-transform: uppercase;
  transition: border-color 0.2s;
}
#lang-btn:hover { border-color: #C9A84C !important; }

.cart-btn {
  background: #C9A84C !important;
  color: #1C1009 !important;
  border: none;
  font-family: inherit;
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.45rem;
  transition: background 0.2s;
}
.cart-btn:hover { background: #b8933b !important; }
.cart-count {
  background: #1C1009 !important; color: #F5F0E8 !important;
  border-radius: 50%;
  min-width: 1.15rem; height: 1.15rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.62rem; padding: 0 0.2rem;
}

.nav-signout {
  background: none !important;
  border: 1px solid rgba(92, 53, 32, 0.35) !important;
  color: #5C3520 !important;
  font-family: inherit;
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.nav-signout:hover { color: #B85C3A !important; border-color: rgba(184, 92, 58, 0.5) !important; }

/* ── Hamburger (both class conventions) ── */
.hamburger-btn, .hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 0.4rem; flex-shrink: 0;
}
.hamburger-btn span, .hamburger span {
  display: block; width: 22px; height: 2px;
  background: #5C3520 !important;
  border-radius: 2px;
  flex-shrink: 0 !important; /* CRITICAL: in the column-flex .hamburger, shrink was crushing bars to 0px height */
  transition: transform 0.25s, opacity 0.25s;
}
.hamburger-btn span { margin: 4px 0; }  /* block-layout button (gallery etc.) — needs margins for spacing */
.hamburger span { margin: 0 !important; }  /* flex button (index/grove) — gap:5px handles spacing; margins overflowed the 40px box */
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Mobile dropdown overlay (both class conventions) ── */
.mob-overlay, .mobile-nav-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 1000;  /* always above nav (500) and page modals */
  background: #FAF1E3 !important;
  flex-direction: column; align-items: center;
  justify-content: flex-start;   /* menu starts from the top of the page, not the middle */
  padding-top: 4.5rem;           /* clears the × close button */
  overflow-y: auto;
}
.mob-overlay.open, .mobile-nav-overlay.open { display: flex; }

.mob-overlay-close, .mobile-nav-close {
  position: absolute; top: 1.1rem; right: 1.4rem;
  background: none; border: none;
  color: #5C3520 !important;
  font-size: 2.4rem; cursor: pointer; line-height: 1;
}
.mob-overlay-close:hover, .mobile-nav-close:hover { color: #B85C3A !important; }

.mob-overlay-links, .mobile-nav-menu {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 420px;
  /* Hard reset: page CSS styles bare `nav { … }`, which also matches this inner
     <nav> — leaking position:fixed/sticky, height:64px, padding and z-index onto
     the dropdown and squashing it into a nav-bar-sized strip. Undo all of it. */
  position: static !important;
  top: auto !important; left: auto !important; right: auto !important;
  height: auto !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  z-index: auto !important;
}
.mob-overlay-links a, .mobile-nav-menu a {
  display: block; width: 100%; text-align: center;
  padding: 1.15rem 2rem;
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-size: 1.35rem !important; font-weight: 400;
  letter-spacing: 0.08em;
  color: #5C3520 !important;
  background: transparent !important;
  text-decoration: none;
  border-bottom: 1px solid #EAD9C8 !important;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
}
.mob-overlay-links a:first-child, .mobile-nav-menu a:first-child { border-top: 1px solid #EAD9C8 !important; }
.mob-overlay-links a:hover, .mobile-nav-menu a:hover,
.mob-overlay-links a.active, .mobile-nav-menu a.active {
  color: #B85C3A !important;
  background: rgba(184, 92, 58, 0.06) !important;
}

/* ── Responsive collapse ── */
@media (max-width: 1024px) and (min-width: 769px) {
  .nav-logo { font-size: 0.72rem; letter-spacing: 0.12em; }
  .member-badge { display: none !important; }
  nav { padding: 0 1.2rem; }
}
@media (max-width: 1024px) {
  .hide-mobile, .hide-sm { display: none !important; }
  .hamburger-btn { display: block !important; }
  .hamburger { display: flex !important; }
  body > nav .nav-links { display: none; }
  /* #nav-ga uses a 3-column grid on desktop; that rule sits late in index.css/grove.css
     and was overriding the mobile flex revert — hamburger ended up mid-bar or hidden.
     Force flex here so the hamburger stays pinned to the right. */
  nav#nav-ga {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
  }
}
@media (max-width: 640px) {
  body > nav, nav#nav-ga { padding: 0 1rem; height: 58px; }
  .nav-logo { font-size: 0.7rem !important; letter-spacing: 0.12em !important; }
  .cart-btn { padding: 0.45rem 0.8rem; font-size: 0.66rem; }
}

/* Pages with a fixed nav need top padding on body content — each page
   already handles this; sticky→fixed change is compensated below */
body { scroll-padding-top: 64px; }
