/* ==========================================================================
   FLUX PRIME — header.css
   Fixed header that starts transparent over the hero and turns solid on scroll.
   Requires: base.css, js/header.js
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  color: var(--color-text);
  transition: background var(--dur-mid) var(--ease-out),
              backdrop-filter var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out);
  border-bottom: 1px solid transparent;
}

/* Transparent state gets a soft top scrim so white text stays legible
   over a bright hero frame. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.55), rgba(10, 10, 10, 0));
  opacity: 1;
  transition: opacity var(--dur-mid) var(--ease-out);
}

.site-header.is-scrolled {
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--color-border);
}
.site-header.is-scrolled::before { opacity: 0; }

/* --------------------------------------------------------------------------
   Announcement bar
   -------------------------------------------------------------------------- */
.announce {
  position: relative;
  height: var(--announce-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-head);
  font-size: 0.75rem;
  letter-spacing: 0.005em;
  color: var(--color-text-muted);
  transition: height var(--dur-mid) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out);
}
.announce__sep { color: var(--color-text-faint); }
.announce__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: pulse-dot 2.4s var(--ease-out) infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* Collapse the announcement once the user scrolls. */
.site-header.is-scrolled .announce {
  height: 0;
  opacity: 0;
  border-color: transparent;
}

/* --------------------------------------------------------------------------
   Main bar
   -------------------------------------------------------------------------- */
.header-inner {
  position: relative;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  transition: height var(--dur-mid) var(--ease-out);
}
.site-header.is-scrolled .header-inner { height: var(--header-h-scrolled); }

/* --- Logo --- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-head);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;   /* wordmark only */
  white-space: nowrap;
  flex-shrink: 0;
}
/* Logo lockup: the emblem from the brand logo plus a live wordmark, because
   the supplied artwork is a stacked lockup built for light backgrounds and
   its wordmark is unreadable at header size. */
.logo__mark-img {
  height: 34px;
  width: auto;
  flex-shrink: 0;
  transition: height var(--dur-mid) var(--ease-out);
}
.site-header.is-scrolled .logo__mark-img { height: 28px; }

.logo__word {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--color-text);
  white-space: nowrap;
}
.logo__word--alt { color: var(--color-brand); }

/* --- Primary nav --- */
.primary-nav { margin-inline: auto; }

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(var(--space-4), 2.4vw, var(--space-6));
}

.nav-item { position: relative; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: var(--space-2) 0;
  font-family: var(--font-head);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--color-text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-mid) var(--ease-out);
}
.nav-link:hover,
.nav-item:focus-within > .nav-link,
.nav-link[aria-current="page"] { color: var(--color-text); }
.nav-link:hover::after,
.nav-item:focus-within > .nav-link::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

.nav-link__chev {
  width: 0.9em; height: 0.9em;
  transition: transform var(--dur-fast) var(--ease-out);
}
.nav-item:hover .nav-link__chev,
.nav-item:focus-within .nav-link__chev { transform: rotate(180deg); }

/* --- Dropdown --- */
.dropdown {
  position: absolute;
  top: calc(100% + var(--space-3));
  left: 50%;
  translate: -50% 0;
  --cols: 2;
  min-width: 540px;
  padding: var(--space-3);
  background: rgba(16, 16, 18, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              visibility var(--dur-fast);
}
.nav-item:hover > .dropdown,
.nav-item:focus-within > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
/* Invisible bridge so the pointer can travel from link to panel. */
.nav-item:has(.dropdown)::after {
  content: "";
  position: absolute;
  inset: 100% 0 auto 0;
  height: var(--space-3);
}

/* One column per --cols; a long list splits, a short one stays single file. */
.dropdown--narrow { --cols: 1; min-width: 270px; }

/* Multi-column rather than grid, so the list reads top-to-bottom down the
   first column and then continues in the second — the order people expect
   from a menu, not left-to-right across rows. */
.dropdown__grid {
  column-count: var(--cols);
  column-gap: var(--space-2);
}
.dropdown__link {
  display: block;
  break-inside: avoid;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.dropdown__link:hover {
  background: var(--color-surface-3);
  color: var(--color-text);
}
.dropdown__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-2) var(--space-1);
  border-top: 1px solid var(--color-border);
}

/* --- Header actions --- */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { color: var(--color-text); background: rgba(255, 255, 255, 0.07); }
.icon-btn svg { width: 19px; height: 19px; }

.cart-count {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
.cart-count[data-count="0"] { display: none; }

/* --- Search panel --- */
.header-search {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-mid) var(--ease-out);
}
.header-search.is-open { grid-template-rows: 1fr; }
.header-search__inner {
  overflow: hidden;
  border-top: 1px solid transparent;
  transition: border-color var(--dur-mid) var(--ease-out);
}
.header-search.is-open .header-search__inner { border-top-color: var(--color-border); }
.header-search__form {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-4);
}
.header-search__form .input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  font-size: var(--text-lg);
  padding-inline: 0;
}
.header-search__form .input:focus { background: transparent; border-bottom-color: var(--color-accent); }

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
.menu-toggle { display: none; }

.menu-toggle__bars {
  position: relative;
  width: 18px;
  height: 10px;
}
.menu-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}
.menu-toggle__bars span:nth-child(1) { top: 0; }
.menu-toggle__bars span:nth-child(2) { bottom: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) {
  top: 4px; transform: rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) {
  bottom: 4.5px; transform: rotate(-45deg);
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  /* Sits UNDER the header so the close (X) button stays reachable. */
  z-index: calc(var(--z-header) - 1);
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  padding: var(--gutter);
  padding-top: calc(var(--header-h) + var(--announce-h) + var(--space-5));
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--dur-mid) var(--ease-out),
              transform var(--dur-mid) var(--ease-out),
              visibility var(--dur-mid);
  overflow-y: auto;
}
.mobile-drawer.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.mobile-nav { display: grid; gap: var(--space-1); }
.mobile-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-head);
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.mobile-nav a .eyebrow { font-size: 10px; }

/* Accordion groups — native <details>, no JavaScript needed. */
.mobile-nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-head);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::marker { content: ""; }

.mobile-chev {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-text-light);
  transition: transform var(--dur-fast) var(--ease-out);
}
.mobile-nav details[open] .mobile-chev { transform: rotate(180deg); }

.mobile-sub {
  display: grid;
  padding: var(--space-2) 0 var(--space-4);
}
.mobile-sub a {
  padding: var(--space-2) 0 var(--space-2) var(--space-4);
  border-bottom: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-muted);
}
.mobile-sub a:hover { color: var(--color-text); }

.mobile-drawer__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: auto;      /* pin to the bottom without stretching the buttons */
  padding-top: var(--space-6);
}
.mobile-drawer__foot .btn { flex: 1; min-width: 9rem; }

@media (max-width: 1080px) {
  .dropdown { min-width: 380px; }
}

@media (max-width: 900px) {
  .primary-nav { display: none; }
  .menu-toggle { display: inline-grid; }
  .header-inner { gap: var(--space-3); }
  .logo { margin-inline: 0 auto; }
  .logo__mark-img { height: 30px; }
  .announce__sep, .announce__extra { display: none; }
}
