/* SPBC unified site header — dark-forest glass sticky (v12)
 * cache-bust: 2026-08-03 unit-A active-nav contrast */
:root {
  --spbc-green: #16A34A;
  --spbc-green-deep: #006600;
  --spbc-gold: #EAB308;
  --spbc-header-pad-y: 0.85rem;
  --spbc-header-pad-x: 0.75rem;
  --spbc-header-bg: rgba(11, 18, 14, 0.72);
  --spbc-header-bg-scrolled: rgba(11, 18, 14, 0.88);
}

.site-header {
  --spbc-header-pad-y: 0.75rem;
  background: var(--spbc-header-bg);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  border-bottom: 1px solid rgba(38, 58, 44, 0.9);
  box-shadow: 0 1px 0 rgba(234, 179, 8, 0.12);
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: max(var(--spbc-header-pad-y), env(safe-area-inset-top));
  padding-bottom: var(--spbc-header-pad-y);
  transition:
    box-shadow 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    backdrop-filter 0.25s ease;
  isolation: isolate;
}

/* Gold accent rail */
.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(234, 179, 8, 0.15) 15%,
    var(--spbc-gold) 50%,
    rgba(234, 179, 8, 0.15) 85%,
    transparent 100%
  );
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
}

/* Soft vignette / depth */
.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 120% at 50% -20%, rgba(22, 163, 74, 0.14), transparent 55%),
    radial-gradient(ellipse 40% 80% at 100% 50%, rgba(0, 0, 0, 0.18), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Stronger blur + density on scroll (site-header.js toggles .is-scrolled) */
.site-header.is-scrolled {
  background: var(--spbc-header-bg-scrolled);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(234, 179, 8, 0.1);
  border-bottom-color: rgba(234, 179, 8, 0.35);
}

.site-header__inner {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--spbc-header-pad-x);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  /* Contain nav so page scrollWidth never exceeds viewport */
  overflow-x: clip;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .site-header__inner {
    flex-direction: row;
    padding: 0 1.5rem;
    gap: 1rem;
  }
}

.site-header__brand {
  text-decoration: none;
  display: inline-block;
  border-radius: 0.5rem;
  transition: transform 0.2s ease, filter 0.2s ease;
  touch-action: manipulation;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-header__brand:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.site-header__brand:active {
  transform: translateY(0) scale(0.98);
}

.site-header__brand:focus-visible {
  outline: 2px solid var(--spbc-gold);
  outline-offset: 3px;
}

.site-header__brand-text {
  font-size: 1.2rem;
  line-height: 1;
  letter-spacing: 0.01em;
  display: inline-block;
}

@media (min-width: 640px) {
  .site-header__brand-text { font-size: 1.45rem; }
}

@media (min-width: 768px) {
  .site-header__brand-text { font-size: 1.7rem; }
}

.site-header__brand-gold {
  color: var(--spbc-gold);
  text-shadow: 0 0 18px rgba(234, 179, 8, 0.28);
}

.site-header__brand-white {
  color: #F2F7F3;
  margin-left: 0.3rem;
}

/* Stack brand on very narrow phones for balance */
@media (max-width: 380px) {
  .site-header__brand-white {
    display: block;
    margin-left: 0;
    margin-top: 0.1rem;
  }
  .site-header__brand-text {
    text-align: center;
  }
}

.site-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
}

.site-header__cart {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  text-decoration: none;
  color: #0B120E;
  background: linear-gradient(180deg, #ffe44d, #FDD700 45%, #e6c200);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 0 0 auto;
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.28);
}
.site-header__cart[hidden] {
  display: none !important;
}
.site-header__cart-count {
  font-variant-numeric: tabular-nums;
}

.site-header__nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.15rem;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(38, 58, 44, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* Wrap on phones so Contact is reachable — no hamburger overlay */
  max-width: 100%;
  width: 100%;
  overflow: visible;
}

.nav-link {
  position: relative;
  z-index: 1;
  color: rgba(242, 247, 243, 0.82);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 0.55rem;
  border-radius: 999px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  transform: none !important;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
  touch-action: manipulation;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  flex: 1 1 auto;
}

@media (min-width: 375px) {
  .nav-link {
    font-size: 0.62rem;
    padding: 0.5rem 0.6rem;
    letter-spacing: 0.05em;
  }
  .site-header__nav { gap: 0.25rem; }
}

@media (min-width: 414px) {
  .nav-link {
    font-size: 0.65rem;
    padding: 0.5rem 0.7rem;
    letter-spacing: 0.06em;
  }
}

@media (min-width: 640px) {
  .site-header__top {
    width: auto;
    flex: 1 1 auto;
  }
  .site-header__nav {
    gap: 0.35rem;
    padding: 0.2rem;
    max-width: none;
    width: auto;
    overflow-x: visible;
    justify-content: center;
    flex-wrap: nowrap;
    border-radius: 999px;
  }
  .nav-link {
    font-size: 0.72rem;
    padding: 0.55rem 0.9rem;
    min-height: 44px;
    flex: 0 0 auto;
  }
}

/* Hover: gold border lights up (no extra keyframes — motion budget) */
.nav-link:hover:not(.active) {
  color: #fff;
  border-color: rgba(234, 179, 8, 0.75);
  background: rgba(234, 179, 8, 0.08);
  box-shadow:
    0 0 0 1px rgba(234, 179, 8, 0.22),
    0 0 14px rgba(234, 179, 8, 0.28);
}

.nav-link:focus-visible {
  outline: 2px solid var(--spbc-gold);
  outline-offset: 2px;
}

/* Active tab: gold fill on the link itself (no absolute pill — avoids scrollWidth growth).
   Qualify under .site-header so body/utility color rules cannot out-specify
   (same specificity pattern as body.atmosphere p.page-hero-eyebrow).
   Text #0B120E on #FDD700 ≈ 13.46:1 (WCAG AAA). */
.site-header .nav-link.active,
.site-header .nav-link[aria-current="page"] {
  color: #0B120E;
  background-color: var(--spbc-gold-legacy, #FDD700);
  background-image: linear-gradient(
    180deg,
    #ffe44d,
    var(--spbc-gold-legacy, #FDD700) 45%,
    #e6c200
  );
  border-color: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(234, 179, 8, 0.45),
    0 0 16px rgba(234, 179, 8, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header__brand,
  .site-header__brand-text,
  .nav-link {
    transition: none !important;
  }
  .site-header__brand:hover {
    transform: none;
  }
}
