/* ============================================================
   Aush — site-header.css
   Everything for the shared site header/navigation, in one place:
   fixed top bar (logo, desktop nav, search, icon actions, quote CTA),
   hamburger toggle, and the mobile drawer overlay it opens.
   Behaviour lives in assets/js/site-header.js. Design tokens (colors,
   spacing, radii, easing) are defined in base.css.
   ============================================================ */

/* ── Site Header ───────────────────────────────────────────────
   Theme-reactive glass bar: light-glass in light mode, dark-glass in
   dark mode (var(--header-bg-glass)/--header-border, both defined
   with dark-theme overrides in base.css). Blur + high opacity keep it
   legible over whatever photo happens to sit behind it in either
   theme. Only size/shadow respond to .scrolled — color doesn't change
   on scroll, only on theme. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--header-bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--header-border);
  transition: background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.site-header.scrolled,
body.header-solid .site-header {
  background: var(--header-bg-solid);
  box-shadow: var(--shadow-md);
}

/* Row 1: hamburger (mobile) · logo · search · location/more/login/cart. */
/* Brand-group | Search (centered) | Actions — the search form has its
   own max-width + margin-inline:auto (see .header-search-form below),
   so it sits centered in the page rather than pinned to the left edge
   of its track whenever this middle column is wider than that max. */
.site-header__top {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 1.5rem;
  padding: 0.85rem 3.5rem;
  transition: padding 0.3s var(--ease-out);
}

.site-header__brand {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.site-header.scrolled .site-header__top,
body.header-solid .site-header .site-header__top {
  padding: 0.5rem 3.5rem;
}

/* Row 2: category tabs — desktop only, see the 1023.98px breakpoint
   below (mobile keeps its existing hamburger + drawer instead).
   Centered to match the search bar above it. */
.site-header__tabs {
  border-top: 1px solid var(--header-border);
}

/* ── Logo ──────────────────────────────────────────────────────
   The colour wordmark gets a soft halo (dark in light mode, light in
   dark mode — var(--header-logo-halo)) so it reads over the glass bar
   at any scroll depth, in either theme. */
.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  z-index: 41;
  flex-shrink: 0;
  margin-left: 10%;
}

.site-logo__img {
  display: block;
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 8px var(--header-logo-halo));
  transition: transform 0.25s ease, filter 0.3s ease;
}

.site-logo:hover .site-logo__img {
  transform: scale(1.04);
}

/* ── Desktop Navigation ────────────────────────────────────────
   Centred in the header's flexible middle grid column regardless of
   how wide the logo/actions zones are either side. */
.desktop-nav {
  display: flex;
  justify-content: center;
}

.desktop-nav__list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.desktop-nav__item {
  position: relative;
}

.desktop-nav__link {
  /* Matches the AUSH logo mark (assets/images/logo.png) — a bold
     geometric sans, not the editorial serif italic this used to
     share with the old hero title. Outfit is already loaded here
     (see includes/header.php's Google Fonts link), no new request. */
  font-family: 'Outfit', sans-serif;
  font-style: normal;
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--color-text-dark);
  text-decoration: none;
  padding: 0.5rem 0.1rem;
  transition: color 0.2s ease;
}

.desktop-nav__link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.desktop-nav__icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 0.4rem;
  vertical-align: -3px;
  color: var(--color-accent-light);
  transition: transform 0.25s ease, color 0.25s ease;
}

.desktop-nav__link:hover .desktop-nav__icon {
  transform: translateY(-1px);
}

.desktop-nav__label {
  position: relative;
}

.desktop-nav__indicator {
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}

.desktop-nav__link:hover,
.desktop-nav__link.is-active {
  color: var(--color-accent-light) !important;
}

.desktop-nav__link:hover .desktop-nav__indicator,
.desktop-nav__link.is-active .desktop-nav__indicator {
  transform: scaleX(1);
}

/* ── Hamburger Toggle ──────────────────────────────────────────── */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 8px;
  cursor: pointer;
  z-index: 42;
  background: transparent;
  border: 1px solid var(--header-control-border);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.menu-toggle:hover {
  background: var(--header-control-bg-hover);
  border-color: var(--color-accent);
}

.menu-toggle__line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-dark);
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, background-color 0.25s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: var(--color-accent);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: var(--color-accent);
}

/* ── Header Actions (search, icon buttons, quote CTA) ─────────── */
.header-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Taken out of grid flow and centered on the header bar itself (not just
   within the leftover space between brand/actions), so it stays truly
   centered even when those two zones are different widths. */
.header-search-form {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: 640px;
}

.header-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.header-search-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--color-text-light);
  pointer-events: none;
  width: 15px !important;
  height: 15px !important;
  transition: color 0.2s ease;
}

.header-search-input {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  width: 100%;
  height: 40px;
  padding: 0.4rem 0.9rem 0.4rem 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-dark);
  background: var(--header-control-bg);
  border: 1px solid var(--header-control-border);
  border-radius: 100px;
  outline: none;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.header-search-input::placeholder {
  color: var(--color-text-muted);
}

.header-search-input:focus {
  background: var(--color-bg-white);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 163, 255, 0.25);
}

.header-search-input:focus + .header-search-icon,
.header-search-wrap:focus-within .header-search-icon {
  color: var(--color-accent);
}

/* Icon Buttons (Cart, Wishlist, Account) */
.header-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--header-control-border);
  background: var(--header-control-bg);
  color: var(--color-text-dark);
  text-decoration: none;
  transition: all 0.2s ease;
}

.header-icon-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--header-control-bg-hover);
  transform: translateY(-1px);
}

.header-icon-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9999px;
  background: var(--color-accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 163, 255, 0.4);
}

/* This badge now always renders (see includes/header.php) so JS can
   show/hide it live via the hidden attribute as the cart count
   changes, instead of relying on PHP's initial page-load count —
   but display:flex above has equal specificity to the browser's
   default [hidden]{display:none} and, being an author rule, beats it
   outright, so hidden alone did nothing without this. */
.header-icon-btn__badge[hidden] {
  display: none;
}

/* Text Action Button (Login/Account) */
.header-action-btn {
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--header-control-border);
  background: var(--header-control-bg);
  color: var(--color-text-dark);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.header-action-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--header-control-bg-hover);
  transform: translateY(-1px);
}

.header-action-btn {
  cursor: pointer;
}

.header-action-btn__chevron {
  flex-shrink: 0;
  opacity: 0.6;
}

/* ── Category tabs (row 2) ────────────────────────────────────── */
.header-tab-list {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0 3.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-tab-list::-webkit-scrollbar {
  display: none;
}

.header-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  padding: 0.6rem 0.9rem 0.5rem;
  border-bottom: 2.5px solid transparent;
  color: var(--color-text-light);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.header-tab:hover {
  color: var(--color-text-dark);
}

.header-tab.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.header-tab__icon {
  width: 20px;
  height: 20px;
}

.header-tab__label {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

/* Primary Quote CTA — stays brand blue regardless of header state; the one
   element that should never blend in. */
.header-quote-cta {
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.3rem;
  background: var(--color-accent);
  color: #ffffff !important;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 163, 255, 0.35);
  transition: all 0.25s ease;
}

.header-quote-cta:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 163, 255, 0.45);
}

.header-quote-cta svg {
  transition: transform 0.25s ease;
}

.header-quote-cta:hover svg {
  transform: translateX(3px);
}

/* ── Responsive Header Breakpoints ─────────────────────────────── */
@media (max-width: 1100px) {
  .site-header__top {
    padding: 0.85rem 2rem;
    column-gap: 1rem;
  }
  .header-tab-list {
    padding: 0 2rem;
  }
}

@media (max-width: 1023.98px) {
  .site-header__top {
    grid-template-columns: auto auto 1fr auto;
    padding: 0.75rem 1.25rem;
    column-gap: 0.75rem;
  }
  /* Unwraps .site-header__brand back into two separate grid items
     (hamburger, logo) at this breakpoint — same 4-column mobile
     layout as before the search bar got its own centered grid
     column between them. */
  .site-header__brand {
    display: contents;
  }
  /* Desktop centers the search bar by taking it out of grid flow
     (see .header-search-form above) — at this breakpoint it goes back
     to being a normal grid item between logo and actions instead. */
  .header-search-form {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
  }
  .site-logo {
    justify-self: center;
  }
  .site-logo__img {
    height: 30px;
  }
  /* Category tabs row: mobile keeps its existing hamburger + drawer
     (nav.php) instead — same breakpoint the old .desktop-nav used. */
  .site-header__tabs {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .header-actions {
    justify-self: end;
    gap: 0.4rem;
  }
  .header-search-input {
    height: 34px;
    padding-left: 2.2rem;
    font-size: 0.75rem;
  }
  .header-action-btn span {
    display: none;
  }
  .header-action-btn {
    padding: 0.45rem;
  }
  .header-quote-cta span {
    display: none;
  }
  .header-quote-cta {
    padding: 0.45rem 0.7rem;
  }
}

/* Narrowest phones (≤399.98px, e.g. 360×640 / 390×844): the actions
   cluster (search + cart + account + quote) no longer fits its 575.98px
   sizing inside the available header width — total content overflowed
   the fixed header and got clipped, hiding the Cart/Account/Quote
   buttons off the right edge. Trim padding, gaps, and control sizes
   further so everything stays on-screen and tappable. */
@media (max-width: 399.98px) {
  .site-header__top {
    padding-inline: 0.75rem;
    column-gap: 0.5rem;
  }
  .site-logo__img {
    height: 26px;
  }
  .menu-toggle {
    width: 36px;
    height: 36px;
  }
  .header-actions {
    gap: 0.3rem;
  }
  .header-search-input {
    padding-left: 1.8rem;
  }
  .header-icon-btn {
    width: 34px;
    height: 34px;
  }
  .header-action-btn {
    padding: 0.4rem;
  }
  .header-quote-cta {
    padding: 0.4rem 0.55rem;
  }
}

/* ════════════════════════════════════════════════════════════
   Mobile Navigation Drawer (opened by .menu-toggle, markup in
   includes/nav.php)
   ════════════════════════════════════════════════════════════ */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  visibility: hidden;
}

.nav-overlay.is-open {
  pointer-events: all;
  visibility: visible;
}

.nav-overlay svg {
  max-width: 24px;
  max-height: 24px;
  flex-shrink: 0;
}

.nav-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-overlay.is-open .nav-overlay__backdrop {
  opacity: 1;
}

.nav-overlay__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  background: var(--color-bg-white);
  color: var(--color-text-dark);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  will-change: transform;
}

.nav-overlay.is-open .nav-overlay__panel {
  transform: translateX(0);
}

.nav-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  background: var(--color-bg-white);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.nav-overlay__title {
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-dark);
}

.nav-overlay__close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-light);
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-overlay__close-btn:hover,
.nav-overlay__close-btn:focus-visible {
  border-color: var(--color-accent);
  background: rgba(0, 163, 255, 0.08);
  color: var(--color-accent);
}

.nav-overlay__content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.nav-overlay__section-title {
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.85rem;
}

.nav-overlay__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-overlay__item {
  position: relative;
}

.nav-overlay__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-overlay__link--cat {
  /* Matches the desktop nav (.desktop-nav__link above) and the AUSH
     logo mark's geometric sans. */
  font-family: 'Outfit', sans-serif;
  font-style: normal;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: 1;
  padding: 0.8rem 0;
  color: var(--color-text-dark);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-overlay__link--cat:hover,
.nav-overlay__link--cat.is-active {
  color: var(--color-accent);
}

.nav-overlay__icon {
  width: 22px !important;
  height: 22px !important;
  color: var(--color-accent);
  flex-shrink: 0;
}

.nav-overlay__divider {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: 1.25rem 0;
}

/* Section 2: Company & Support — plain text links, one level down in
   visual weight from the category links above. */
.nav-overlay__list--sec {
  gap: 0.1rem;
}

.nav-overlay__sec-link {
  display: block;
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  padding: 0.55rem 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-light);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-overlay__sec-link:hover {
  color: var(--color-accent);
  transform: translateX(4px);
}

.nav-overlay__sec-link.is-active {
  color: var(--color-accent);
  font-weight: 700;
}

/* Section 3: Cart/Account quick links + quote CTA, pinned to the
   bottom of the scrollable content area. */
.nav-overlay__footer-actions {
  margin-top: auto;
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-overlay__quick-links {
  display: flex;
  gap: 0.75rem;
}

.nav-overlay__quick-btn {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg-light);
  color: var(--color-text-dark);
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.nav-overlay__quick-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(0, 163, 255, 0.06);
}

.nav-overlay__quick-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-overlay__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9999px;
  background: var(--color-accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nav-overlay__quote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.25rem;
  background: var(--color-accent);
  color: #ffffff !important;
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-overlay__quote-btn:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
}

.nav-overlay__quote-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.nav-overlay__quote-btn:hover svg {
  transform: translateX(3px);
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .nav-overlay__backdrop,
  .nav-overlay__panel,
  .menu-toggle__line,
  .site-header {
    transition: none !important;
  }
}
