/*!
 * MSIIA mobile header + navigation panel — v3 (2026-07-20)
 * =====================================================================
 * v3 changes vs v2:
 *   - Removed the standalone `.mobile-account-btn` circle entirely
 *     (previously injected into every page; produced an orphaned user
 *     icon between the brand and the hamburger).
 *   - The mobile header now renders four controls in this order:
 *
 *         BRAND · CART · ACCOUNT · MENU
 *
 *     Cart = `.header-cart-btn` (icon + count badge + optional caret).
 *     Account = `.account-nav-group > .nav-link.nav-dropdown-toggle`
 *     (icon-only trigger for the existing account dropdown).
 *   - Cart + account controls are shown INSIDE the closed row (no
 *     display:none hack); they are re-styled at ≤768px to a 40 px
 *     glass square that matches the mobile-toggle so all three read
 *     as one control family.
 *
 * Direction: institutional luxury / futuristic trading terminal.
 *   - premium glassmorphism panel with 22 px blur + saturation lift
 *   - fine gold laser line along the top border
 *   - soft radial fog near the panel bottom for atmospheric depth
 *   - travelling gloss sheen on the primary CTA
 *   - subtle inset highlights on every interactive glass surface
 *   - 40 px control height, 44 px minimum touch target, 60–68 px header
 *
 * All effects respect prefers-reduced-motion.
 */

:root {
  /* Layout tokens */
  --mnav-h:              64px;
  --mnav-h-min:          60px;
  --mnav-h-max:          68px;
  --mnav-pad-x:          clamp(10px, 3vw, 16px);
  --mnav-gap:            clamp(6px, 1.6vw, 10px);
  --mnav-ctrl-h:         40px;
  --mnav-ctrl-h-sm:      38px;
  --mnav-radius:         12px;
  --mnav-radius-sm:      10px;

  /* Elevation & motion tokens */
  --mnav-z-backdrop:     1049;
  --mnav-z-panel:        1050;
  --mnav-t-open:         280ms;
  --mnav-t-close:        220ms;
  --mnav-ease:           cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Breakpoints */
  --mnav-bp-mobile:      768px;
  --mnav-bp-small:       430px;
  --mnav-bp-xs:          380px;
  --mnav-bp-xxs:         340px;

  /* Palette (aligned with MSIIA gold-on-black identity) */
  --mnav-ink:            #F7F1E1;
  --mnav-ink-muted:      rgba(247, 241, 225, 0.65);
  --mnav-gold:           #C4A864;
  --mnav-gold-warm:      #d4b876;
  --mnav-gold-deep:      #a58748;
  --mnav-gold-soft:      rgba(196, 168, 100, 0.55);
  --mnav-gold-faint:     rgba(196, 168, 100, 0.20);
  --mnav-gold-mist:      rgba(196, 168, 100, 0.08);
  --mnav-surface:        #0a0906;
  --mnav-surface-lift:   #14110a;
  --mnav-glass:          rgba(10, 9, 6, 0.88);
  --mnav-glass-thin:     rgba(10, 9, 6, 0.72);
  --mnav-highlight:      rgba(255, 245, 220, 0.10);
  --mnav-highlight-lo:   rgba(255, 245, 220, 0.06);
  --mnav-danger:         #d97070;
}

/* =====================================================================
 * 1. CLOSED MOBILE HEADER  (≤ 768 px)
 *    Order: BRAND · CART · ACCOUNT · MENU
 * ===================================================================== */

@media (max-width: 768px) {

  /* Header shell — single row, safe-area aware, brand-forward */
  .site-header .header-shell {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: var(--mnav-gap);
    min-height: var(--mnav-h-min);
    height: var(--mnav-h);
    max-height: var(--mnav-h-max);
    padding-inline-start: max(var(--mnav-pad-x), env(safe-area-inset-left));
    padding-inline-end:   max(var(--mnav-pad-x), env(safe-area-inset-right));
    padding-block: 0;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
  }

  /* Brand — occupies the flexible middle; text stays readable */
  .site-header .brand {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    text-decoration: none;
    color: inherit;
  }
  .site-header .brand-logo {
    flex: 0 0 auto;
    height: 36px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(196, 168, 100, 0.16));
  }
  .site-header .brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.05;
    overflow: hidden;
  }
  .site-header .brand-mark {
    font-size: 15px;
    letter-spacing: 0.22em;
    color: var(--mnav-ink);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
  }
  .site-header .brand-sub {
    font-size: 9px;
    letter-spacing: 0.20em;
    color: rgba(196, 168, 100, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
    text-transform: uppercase;
    font-weight: 500;
  }

  /* Desktop nav — hidden on mobile */
  .site-header .main-nav { display: none !important; }

  /* Header actions cluster — 4 controls: Login/Cart · Account · Menu */
  .site-header .header-actions {
    display: flex;
    align-items: center;
    gap: var(--mnav-gap);
    flex: 0 0 auto;
    min-width: 0;
  }

  /* AGGRESSIVE hide — the two chrome controls that never belong on the
     closed mobile row. The basket, account, and (auth) login/register
     controls are all styled below. */
  .site-header #msiiaPrefsSelector,
  .site-header .header-prefs-selector,
  .site-header-shell #msiiaPrefsSelector,
  .site-header .msiia-prefs,
  .site-header-shell .msiia-prefs,
  .site-header [class*="prefs-selector"],
  .site-header [class*="lang-selector"],
  .site-header [class*="currency-selector"] {
    display: none !important;
  }
  /* Create Account is redundant on mobile — Login covers logged-out
     entry, and the hamburger surfaces both again inside the panel. */
  .site-header .header-auth-btn--register,
  .site-header a.header-auth-btn--register,
  .site-header-shell .header-auth-btn--register,
  .header-shell .header-auth-btn--register {
    display: none !important;
  }

  /* ── LOGIN (logged-out) — compact glass surface, gold-edged ─────── */
  .site-header .header-auth-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: var(--mnav-ctrl-h);
    min-height: var(--mnav-ctrl-h);
    padding: 0 14px;
    font-size: 11px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--mnav-ink);
    text-decoration: none;
    background: linear-gradient(180deg,
      rgba(196, 168, 100, 0.10) 0%,
      rgba(196, 168, 100, 0.02) 60%,
      rgba(0, 0, 0, 0.15) 100%);
    border: 1px solid rgba(196, 168, 100, 0.32);
    border-radius: var(--mnav-radius-sm);
    box-shadow:
      inset 0 1px 0 var(--mnav-highlight),
      0 2px 10px -4px rgba(196, 168, 100, 0.20),
      0 0 0 1px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    transition: border-color 200ms var(--mnav-ease),
                box-shadow 200ms var(--mnav-ease),
                transform 150ms var(--mnav-ease);
  }
  .site-header .header-auth-btn:hover {
    border-color: rgba(196, 168, 100, 0.55);
    box-shadow:
      inset 0 1px 0 rgba(255, 245, 220, 0.14),
      0 4px 14px -4px rgba(196, 168, 100, 0.35),
      0 0 0 1px rgba(0, 0, 0, 0.25);
  }
  .site-header .header-auth-btn:focus-visible {
    outline: none;
    border-color: var(--mnav-gold);
    box-shadow:
      inset 0 1px 0 rgba(255, 245, 220, 0.14),
      0 0 0 3px rgba(196, 168, 100, 0.20);
  }
  .site-header .header-auth-btn:active {
    transform: translateY(1px);
  }

  /* ── CART / BASKET (logged-in) — icon + inline badge + caret ───── */
  /* The desktop header-preferences.js injects a 48-px pill for this
     control; we override to the compact 40-px square that matches the
     other mobile controls (icon-forward, badge contained inside). */
  .site-header .header-actions .header-cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-sizing: border-box;
    height: var(--mnav-ctrl-h);
    min-height: var(--mnav-ctrl-h);
    min-width: var(--mnav-ctrl-h);
    padding: 0 8px;
    gap: 4px;
    background: linear-gradient(180deg,
      rgba(20, 17, 10, 0.90),
      rgba(10, 9, 6, 0.90));
    border: 1px solid rgba(196, 168, 100, 0.30);
    border-radius: var(--mnav-radius-sm);
    color: var(--mnav-ink);
    text-decoration: none;
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
            backdrop-filter: blur(10px) saturate(1.1);
    box-shadow:
      inset 0 1px 0 var(--mnav-highlight),
      0 4px 12px -4px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(0, 0, 0, 0.35);
    transition: border-color 200ms var(--mnav-ease),
                color 180ms var(--mnav-ease),
                transform 150ms var(--mnav-ease);
  }
  .site-header .header-actions .header-cart-btn .hi-icon,
  .site-header .header-actions .header-cart-btn .header-basket-icon {
    inline-size: 18px;
    block-size: 18px;
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.7;
    fill: none;
    display: block;
    opacity: 0.92;
  }
  /* Hide the sr-only "Basket" text label on mobile — desktop already
     visually hides it too; we keep the DOM node so screen readers hear
     an accessible name via aria-label + the hidden span. */
  .site-header .header-actions .header-cart-btn > span:not(.cart-count):not(.cart-caret) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  /* Count badge — contained inside the button, sits beside the icon */
  .site-header .header-actions .header-cart-btn .cart-count {
    position: static;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #050506;
    background: linear-gradient(180deg, #e2c072, #c8a25a);
    border: 1px solid rgba(5, 7, 11, 0.75);
    border-radius: 10px;
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.55),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
    pointer-events: none;
  }
  /* Hide the badge on mobile when empty so the trigger stays icon-only */
  .site-header .header-actions .header-cart-btn .cart-count:not(.has-items),
  .site-header .header-actions .header-cart-btn .cart-count[hidden] {
    display: none;
  }
  /* Caret — hidden on mobile unless the basket has items */
  .site-header .header-actions .header-cart-btn .cart-caret {
    display: none;
  }
  .site-header .header-actions .header-cart-btn.has-items .cart-caret {
    display: inline-block;
    width: 10px;
    height: 10px;
    opacity: 0.75;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
  }
  .site-header .header-actions .header-cart-btn:hover,
  .site-header .header-actions .header-cart-btn:focus-visible {
    border-color: rgba(196, 168, 100, 0.55);
    color: var(--mnav-gold);
    outline: none;
  }
  .site-header .header-actions .header-cart-btn:focus-visible {
    box-shadow:
      inset 0 1px 0 var(--mnav-highlight),
      0 0 0 3px rgba(196, 168, 100, 0.20);
  }
  .site-header .header-actions .header-cart-btn:active {
    transform: scale(0.96);
  }
  .site-header .header-actions .header-cart-btn[aria-expanded="true"] {
    border-color: rgba(196, 168, 100, 0.70);
    color: var(--mnav-gold-warm);
    background: linear-gradient(180deg,
      rgba(30, 25, 15, 0.92),
      rgba(15, 13, 9, 0.96));
  }

  /* ── ACCOUNT (logged-in) — icon-only trigger for the dropdown ──── */
  /* We keep the existing `.account-nav-group` DOM so the dropdown
     content (Workspace + Compliance links, Logout) stays reachable via
     the same trigger.  On mobile the button becomes a compact square
     matching the cart + menu controls. */
  .site-header .header-actions .account-nav-group {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
  }
  .site-header .header-actions .account-nav-group > .nav-link.nav-dropdown-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-sizing: border-box;
    height: var(--mnav-ctrl-h);
    min-height: var(--mnav-ctrl-h);
    min-width: var(--mnav-ctrl-h);
    padding: 0 8px;
    background: linear-gradient(180deg,
      rgba(20, 17, 10, 0.90),
      rgba(10, 9, 6, 0.90));
    border: 1px solid rgba(196, 168, 100, 0.30);
    border-radius: var(--mnav-radius-sm);
    color: var(--mnav-ink);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
            backdrop-filter: blur(10px) saturate(1.1);
    box-shadow:
      inset 0 1px 0 var(--mnav-highlight),
      0 4px 12px -4px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(0, 0, 0, 0.35);
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 0;                        /* hide the "Account" text glyph */
    letter-spacing: 0;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 200ms var(--mnav-ease),
                color 180ms var(--mnav-ease),
                transform 150ms var(--mnav-ease);
  }
  /* Style the injected `.header-account-icon` svg (from
     header-preferences.js `transformAccountTrigger`) for the mobile
     touch target.  v5 also added a masked ::before pseudo-icon here,
     which stacked a SECOND person glyph on top of the injected svg —
     removed on 2026-07-20 v6 so only the shared authoritative icon
     renders (spec §4: keep one profile icon). */
  .site-header .header-actions .account-nav-group > .nav-link.nav-dropdown-toggle .header-account-icon {
    inline-size: 18px !important;
    block-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 auto;
    opacity: 0.92;
    display: block;
  }
  .site-header .header-actions .account-nav-group > .nav-link.nav-dropdown-toggle .nav-chevron {
    display: none;                       /* icon-only trigger on mobile */
  }
  .site-header .header-actions .account-nav-group > .nav-link.nav-dropdown-toggle:hover,
  .site-header .header-actions .account-nav-group > .nav-link.nav-dropdown-toggle:focus-visible {
    border-color: rgba(196, 168, 100, 0.55);
    color: var(--mnav-gold);
    outline: none;
  }
  .site-header .header-actions .account-nav-group > .nav-link.nav-dropdown-toggle:focus-visible {
    box-shadow:
      inset 0 1px 0 var(--mnav-highlight),
      0 0 0 3px rgba(196, 168, 100, 0.20);
  }
  .site-header .header-actions .account-nav-group > .nav-link.nav-dropdown-toggle:active {
    transform: scale(0.96);
  }
  .site-header .header-actions .account-nav-group > .nav-link.nav-dropdown-toggle[aria-expanded="true"] {
    border-color: rgba(196, 168, 100, 0.70);
    color: var(--mnav-gold-warm);
    background: linear-gradient(180deg,
      rgba(30, 25, 15, 0.92),
      rgba(15, 13, 9, 0.96));
  }
  /* Account dropdown panel — align the desktop portal to the viewport
     right edge on mobile so it does not overflow. */
  .site-header .header-actions .account-nav-group .nav-dropdown,
  .site-header .header-actions .account-nav-group .nav-dropdown-wide {
    right: max(8px, env(safe-area-inset-right));
    left: auto;
    min-width: min(280px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }

  /* ── Menu toggle — glass panel, gold edge, subtle inner glow ─── */
  .site-header .mobile-toggle {
    position: relative;
    flex: 0 0 auto;
    width: var(--mnav-ctrl-h);
    height: var(--mnav-ctrl-h);
    min-width: var(--mnav-ctrl-h);
    min-height: var(--mnav-ctrl-h);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: linear-gradient(180deg,
      rgba(20, 17, 10, 0.90),
      rgba(10, 9, 6, 0.90));
    border: 1px solid rgba(196, 168, 100, 0.30);
    border-radius: var(--mnav-radius-sm);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
            backdrop-filter: blur(10px) saturate(1.1);
    box-shadow:
      inset 0 1px 0 var(--mnav-highlight),
      0 4px 12px -4px rgba(0, 0, 0, 0.55),
      0 0 0 1px rgba(0, 0, 0, 0.35);
    transition: border-color 200ms var(--mnav-ease),
                transform 150ms var(--mnav-ease);
    isolation: isolate;
  }
  .site-header .mobile-toggle::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 9px;
    background: radial-gradient(circle at 50% 30%,
      rgba(196, 168, 100, 0.10) 0%,
      transparent 65%);
    pointer-events: none;
    z-index: -1;
  }
  .site-header .mobile-toggle:hover,
  .site-header .mobile-toggle:focus-visible {
    border-color: rgba(196, 168, 100, 0.55);
    outline: none;
  }
  .site-header .mobile-toggle:focus-visible {
    box-shadow:
      inset 0 1px 0 var(--mnav-highlight),
      0 0 0 3px rgba(196, 168, 100, 0.20);
  }
  .site-header .mobile-toggle:active { transform: scale(0.96); }

  /* Hamburger bars */
  .site-header .mobile-toggle span {
    display: block;
    width: 18px;
    height: 1.5px;
    margin: 2px auto;
    background: var(--mnav-ink);
    border-radius: 2px;
    box-shadow: 0 0 4px rgba(196, 168, 100, 0.35);
    transition: transform 220ms var(--mnav-ease), opacity 160ms var(--mnav-ease);
  }
  .site-header .mobile-toggle.is-open span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
  }
  .site-header .mobile-toggle.is-open span:nth-child(2) { opacity: 0; }
  .site-header .mobile-toggle.is-open span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
  }

  /* The basket-preview dropdown positioned by header-preferences.js —
     clamp to the mobile viewport so it never spills off-screen. */
  .msiia-basket-preview {
    right: max(8px, env(safe-area-inset-right)) !important;
    left: auto !important;
    max-width: calc(100vw - 24px) !important;
    min-width: min(320px, calc(100vw - 24px)) !important;
  }

  /* Account dropdown, once teleported into #nav-dropdown-portal by
     site.js `openDropdown`, escapes the `.account-nav-group` scope.
     Clamp it to the viewport and remove the desktop translateX(-50%)
     centring so it aligns to the safe right edge on mobile. */
  #nav-dropdown-portal .nav-dropdown.is-portal-open,
  .nav-dropdown-portal .nav-dropdown.is-portal-open {
    left: auto !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    transform: none !important;
    min-width: min(300px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: min(70dvh, calc(100vh - 120px)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
  /* Logout row inside the ported dropdown — restore an accessible tap
     target on narrow viewports and reserve space for the inline
     "Logging out…" state. */
  #nav-dropdown-portal .nav-dropdown-danger[data-logout],
  .nav-dropdown-portal .nav-dropdown-danger[data-logout] {
    min-height: 44px;
    display: flex !important;
    align-items: center;
  }
  #nav-dropdown-portal .nav-dropdown-danger[data-logout][aria-busy="true"],
  .nav-dropdown-portal .nav-dropdown-danger[data-logout][aria-busy="true"] {
    opacity: 0.7;
    cursor: progress;
    pointer-events: none;
  }
}

/* Logout busy state (universal — desktop + mobile). Restrained: gold
   text dims, small pulse to signal the request is in flight. */
[data-logout][aria-busy="true"],
[data-logout].is-loading {
  opacity: 0.75;
  cursor: progress;
  pointer-events: none;
  animation: msiiaLogoutPulse 1.2s ease-in-out infinite;
}
@keyframes msiiaLogoutPulse {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  [data-logout][aria-busy="true"],
  [data-logout].is-loading { animation: none !important; }
}

/* Very-narrow screens: preserve readability, shrink chrome */
@media (max-width: 430px) {
  :root {
    --mnav-gap:            8px;
    --mnav-ctrl-h:         38px;
  }
  .site-header .brand-mark { font-size: 14px; letter-spacing: 0.20em; }
  .site-header .brand-sub  { font-size: 8.5px; }
  .site-header .brand-logo { height: 34px; }
  .site-header .header-auth-btn { padding: 0 12px; font-size: 10.5px; }
}
@media (max-width: 380px) {
  :root {
    --mnav-gap:            6px;
    --mnav-ctrl-h:         36px;
  }
  .site-header .brand-sub { display: none; }
  .site-header .brand-logo { height: 32px; }
  .site-header .header-actions .header-cart-btn,
  .site-header .header-actions .account-nav-group > .nav-link.nav-dropdown-toggle {
    padding: 0 6px;
  }
}
@media (max-width: 340px) {
  .site-header .brand-mark { font-size: 13px; letter-spacing: 0.18em; }
  .site-header .brand-logo { height: 30px; }
}


/* =====================================================================
 * 2. BACKDROP + PANEL SHELL
 * ===================================================================== */

.mnav-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--mnav-z-backdrop);
  background: radial-gradient(ellipse at 50% 0%,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.82) 60%);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--mnav-t-open) var(--mnav-ease);
}
.mnav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mnav-panel {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--global-header-height, var(--mnav-h));
  z-index: var(--mnav-z-panel);
  display: flex;
  flex-direction: column;

  background: linear-gradient(180deg,
    rgba(10, 9, 6, 0.90) 0%,
    rgba(10, 9, 6, 0.88) 40%,
    rgba(10, 9, 6, 0.92) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(1.30);
          backdrop-filter: blur(22px) saturate(1.30);
  border-top: 1px solid rgba(196, 168, 100, 0.32);
  box-shadow:
    0 26px 60px -20px rgba(0, 0, 0, 0.70),
    inset 0 1px 0 rgba(196, 168, 100, 0.18),
    0 0 44px -8px rgba(196, 168, 100, 0.12);

  max-height: calc(100dvh - var(--global-header-height, var(--mnav-h)));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;

  transform: translateY(-8px) scale(0.995);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform  var(--mnav-t-open) var(--mnav-ease),
    opacity    var(--mnav-t-open) var(--mnav-ease),
    visibility 0s linear var(--mnav-t-open);

  /* Contain effects so they don't paint outside the panel */
  isolation: isolate;
}
.mnav-panel.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    transform  var(--mnav-t-open) var(--mnav-ease),
    opacity    var(--mnav-t-open) var(--mnav-ease),
    visibility 0s linear 0s;
}

/* Laser accent — thin animated gold light along the top border */
.mnav-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(196, 168, 100, 0.35) 20%,
    rgba(255, 245, 220, 0.70) 50%,
    rgba(196, 168, 100, 0.35) 80%,
    transparent 100%);
  background-size: 200% 100%;
  animation: mnav-laser-sweep 8s linear infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes mnav-laser-sweep {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Fog / atmospheric depth — soft radial haze near the bottom */
.mnav-panel::after {
  content: "";
  position: absolute;
  bottom: -35%;
  left: -25%;
  right: -25%;
  height: 70%;
  background:
    radial-gradient(ellipse at 40% 100%,
      rgba(196, 168, 100, 0.07) 0%,
      transparent 55%),
    radial-gradient(ellipse at 70% 90%,
      rgba(196, 168, 100, 0.04) 0%,
      transparent 60%);
  pointer-events: none;
  z-index: 1;
}

.mnav-panel-inner {
  position: relative;
  z-index: 3;
  padding: 24px max(var(--mnav-pad-x), env(safe-area-inset-left))
           max(28px, env(safe-area-inset-bottom))
           max(var(--mnav-pad-x), env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 26px;
}


/* =====================================================================
 * 3. PRIMARY CTA  (Create Account / My Account)
 *    Full-width polished gold surface with travelling gloss sheen.
 * ===================================================================== */

.mnav-primary-action {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 16px 24px;
  border-radius: var(--mnav-radius);
  background: linear-gradient(180deg,
    var(--mnav-gold-warm) 0%,
    var(--mnav-gold) 45%,
    var(--mnav-gold-deep) 100%);
  color: #14110a;
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid rgba(255, 245, 220, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 220, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 10px 26px -10px rgba(196, 168, 100, 0.55),
    0 3px 10px -4px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  isolation: isolate;
  transition: transform 180ms var(--mnav-ease),
              box-shadow 240ms var(--mnav-ease);
}
/* Travelling gloss sheen */
.mnav-primary-action::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
    transparent 30%,
    rgba(255, 245, 220, 0.28) 50%,
    transparent 70%);
  transform: translateX(-120%);
  transition: transform 900ms var(--mnav-ease);
  pointer-events: none;
  z-index: 0;
}
.mnav-primary-action:hover,
.mnav-primary-action:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 220, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 14px 32px -10px rgba(196, 168, 100, 0.70),
    0 5px 14px -4px rgba(0, 0, 0, 0.45);
  outline: none;
}
.mnav-primary-action:hover::before,
.mnav-primary-action:focus-visible::before {
  transform: translateX(120%);
}
.mnav-primary-action:focus-visible {
  outline: 2px solid rgba(255, 245, 220, 0.6);
  outline-offset: 3px;
}
.mnav-primary-action:active {
  transform: translateY(0);
}

/* Secondary text link (Login inside menu, subtle) */
.mnav-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--mnav-ctrl-h);
  color: var(--mnav-ink-muted);
  font-size: 11.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 0;
  transition: color 180ms var(--mnav-ease);
}
.mnav-secondary-link:hover,
.mnav-secondary-link:focus-visible {
  color: var(--mnav-gold);
  outline: none;
}


/* =====================================================================
 * 4. SECTIONS + NAV ITEMS
 * ===================================================================== */

.mnav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mnav-section-heading {
  font-size: 10px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: rgba(196, 168, 100, 0.85);
  margin: 6px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(196, 168, 100, 0.12);
  position: relative;
  font-weight: 500;
}
/* Section heading accent — short gold underline that fades */
.mnav-section-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg,
    var(--mnav-gold) 0%,
    rgba(196, 168, 100, 0.6) 40%,
    transparent 100%);
}

/* Nav item row */
.mnav-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--mnav-ctrl-h);
  padding: 13px 6px;
  color: var(--mnav-ink);
  text-decoration: none;
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-weight: 500;
  font-size: 17px;
  border-bottom: 1px solid rgba(196, 168, 100, 0.08);
  transition: color 180ms var(--mnav-ease),
              background-color 220ms var(--mnav-ease),
              padding-left 220ms var(--mnav-ease);
  overflow: hidden;
}
/* Vertical accent bar — grows on hover / active */
.mnav-link::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: linear-gradient(180deg,
    var(--mnav-gold-warm),
    var(--mnav-gold),
    var(--mnav-gold-deep));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(196, 168, 100, 0.55);
  transition: height 220ms var(--mnav-ease);
}
.mnav-link:hover,
.mnav-link:focus-visible {
  color: var(--mnav-gold);
  outline: none;
  background: linear-gradient(90deg,
    rgba(196, 168, 100, 0.05) 0%,
    transparent 85%);
  padding-left: 16px;
}
.mnav-link:hover::before,
.mnav-link:focus-visible::before {
  height: 24px;
}
.mnav-link:focus-visible {
  outline: 1px solid rgba(196, 168, 100, 0.55);
  outline-offset: -2px;
}
/* Active page marker */
.mnav-link[aria-current="page"] {
  color: var(--mnav-gold);
  padding-left: 16px;
}
.mnav-link[aria-current="page"]::before {
  height: 22px;
}
/* Danger variant (Logout) */
.mnav-link.is-danger { color: rgba(217, 112, 112, 0.90); }
.mnav-link.is-danger:hover,
.mnav-link.is-danger:focus-visible { color: var(--mnav-danger); }


/* =====================================================================
 * 5. SETTINGS (Language + Currency)
 * ===================================================================== */

.mnav-settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.mnav-select-field label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(196, 168, 100, 0.75);
  margin-bottom: 8px;
  font-weight: 500;
}
.mnav-select-field select {
  width: 100%;
  min-height: 46px;
  padding: 12px 42px 12px 16px;
  background: linear-gradient(180deg,
    rgba(20, 17, 10, 0.85),
    rgba(10, 9, 6, 0.85));
  border: 1px solid rgba(196, 168, 100, 0.28);
  border-radius: var(--mnav-radius);
  color: var(--mnav-ink);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.06em;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%23C4A864' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 6 8 11 13 6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 var(--mnav-highlight-lo),
    0 4px 12px -6px rgba(0, 0, 0, 0.55);
  transition: border-color 200ms var(--mnav-ease),
              box-shadow 200ms var(--mnav-ease);
}
.mnav-select-field select:focus-visible {
  outline: none;
  border-color: rgba(196, 168, 100, 0.55);
  box-shadow:
    inset 0 1px 0 var(--mnav-highlight),
    0 4px 12px -6px rgba(0, 0, 0, 0.55),
    0 0 0 3px rgba(196, 168, 100, 0.18);
}


/* =====================================================================
 * 6. LEGACY MENU HIDE + BODY SCROLL LOCK
 * ===================================================================== */

/* Hide the OLD .mobile-menu that the pre-v1 site.js still wires */
.js-mnav-active .site-header .mobile-menu {
  display: none !important;
}

/* Body scroll lock — mobile-nav.js sets top:-Npx so we can restore */
body.mnav-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}


/* =====================================================================
 * 7. TICKER — subtle premium touches, safe containment
 * ===================================================================== */

.site-header-shell .ticker-bar {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  border-top: 1px solid rgba(196, 168, 100, 0.15);
  border-bottom: 1px solid rgba(196, 168, 100, 0.10);
}
/* Fine gold light line along the very top edge */
.site-header-shell .ticker-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(196, 168, 100, 0.35) 30%,
    rgba(255, 245, 220, 0.55) 50%,
    rgba(196, 168, 100, 0.35) 70%,
    transparent 100%);
  pointer-events: none;
  opacity: 0.9;
}
.site-header-shell .ticker-viewport {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  box-sizing: border-box;
}
.site-header-shell .ticker-track {
  min-width: 0;
  will-change: transform;
}


/* =====================================================================
 * 8. REDUCED MOTION
 * ===================================================================== */

@media (prefers-reduced-motion: reduce) {
  .mnav-backdrop,
  .mnav-panel,
  .mnav-link,
  .mnav-primary-action,
  .mnav-primary-action::before,
  .site-header .mobile-toggle,
  .site-header .mobile-toggle span,
  .site-header .header-actions .header-cart-btn,
  .site-header .header-actions .account-nav-group > .nav-link.nav-dropdown-toggle {
    transition-duration: 0ms !important;
    animation: none !important;
  }
  .mnav-panel { transform: none; }
  .mnav-panel::before { animation: none; }
}


/* =====================================================================
 * 9. DESKTOP RESET  (≥ 769 px) — leave the desktop header alone.
 *    v3: removed the desktop `.mobile-account-btn` override — the
 *    element no longer exists in the DOM.
 * ===================================================================== */

@media (min-width: 769px) {
  .mnav-backdrop,
  .mnav-panel {
    display: none !important;
  }
  body.mnav-open {
    overflow: auto;
    position: static;
    width: auto;
  }
}
