/* ═══ NAVBAR V3 — floating glass bar ═══════════════════════════════════
   Selectors are prefixed with "body" so they outrank the legacy stylesheet
   that protected_main.js / protected_home.js inject into <head> at runtime.
   Colours come from the aurora tokens in aura-bg.css (with fallbacks).
   Motion only animates transform/opacity.
   ═══════════════════════════════════════════════════════════════════════ */
:root {
    --nav-h: 64px;
    --nav-gap: 12px;
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}
@supports (transition-timing-function: linear(0, 1)) {
    :root {
        /* Under-damped spring (stiffness ~170, damping ~14) sampled into linear() */
        --ease-spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077,
            1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%,
            0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
    }
}

body .nav-container {
    position: fixed;
    top: var(--nav-gap);
    left: 16px; right: 16px;
    width: auto;
    max-width: 1200px;
    margin: 0 auto;
    height: var(--nav-h);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 10px 0 14px;
    background: rgba(12, 20, 19, 0.42);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 10px 30px -12px rgba(1, 5, 13, 0.75), 0 2px 6px rgba(1, 5, 13, 0.35);
    transform: translate3d(0, 0, 0);
    transition:
        transform .45s var(--ease-out),
        opacity .3s ease,
        background-color .3s ease,
        box-shadow .3s ease;
    will-change: transform;
    animation: navDrop .7s var(--ease-out) .05s backwards;
}
/* Teal hairline on the bottom edge */
body .nav-container::after {
    content: '';
    position: absolute; left: 18%; right: 18%; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--aura-teal-rgb), 0.6), transparent);
    opacity: .55;
    pointer-events: none;
}
body .nav-container.nav-scrolled {
    background: rgba(var(--aura-panel-rgb), 0.66);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px -16px rgba(1, 5, 13, 0.9), 0 2px 6px rgba(1, 5, 13, 0.4);
}
/* Smart hide: slides away while scrolling down, returns on scroll up */
body .nav-container.nav-hidden {
    transform: translate3d(0, calc(-100% - var(--nav-gap) - 48px), 0);
    opacity: 0;
    pointer-events: none;
}
@keyframes navDrop {
    from { transform: translate3d(0, -28px, 0); opacity: 0; }
    to   { transform: translate3d(0, 0, 0);     opacity: 1; }
}

/* Brand */
body .nav-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 0;
    text-decoration: none; flex-shrink: 0;
    border-radius: 12px;
    transition: transform .2s var(--ease-out);
}
body .nav-logo:active { transform: scale(.97); }
body .nav-logo-img {
    height: 36px; width: 36px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 14px -4px rgba(1,5,13,0.5);
}
body .nav-brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem; font-weight: 700; letter-spacing: -0.035em;
    color: var(--aura-ink, #effbf7); white-space: nowrap; line-height: 1;
}
body .nav-brand .accent {
    color: var(--aura-teal);
}

/* Links */
body .nav-links {
    position: relative;
    display: flex; align-items: center; gap: 2px;
    margin-left: auto;
    background: none; border-radius: 0; padding: 0;
}
body .nav-item {
    position: relative; z-index: 2;
    color: var(--aura-muted, #8fb5ac);
    font-size: 0.88rem; font-weight: 600;
    font-family: 'Onest', sans-serif;
    padding: 9px 13px;
    border-radius: 10px;
    transition: color .2s ease, transform .15s var(--ease-out);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}
body .nav-item:hover, body .nav-item.active { color: var(--aura-ink, #effbf7); }
body .nav-item:active { transform: scale(.97); }
body .nav-item::after {
    content: '';
    position: absolute; left: 13px; right: 13px; bottom: 3px;
    height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--aura-teal, #3fd3b4), var(--aura-cyan, #00e5ff));
    box-shadow: none;
    transform: scaleX(0);
    opacity: 0;
    transition: transform .35s var(--ease-out), opacity .25s ease;
}
body .nav-item.active::after { transform: scaleX(1); opacity: 1; }
body .nav-item:focus { outline: none; }
body .nav-item:focus-visible { outline: 2px solid rgba(var(--aura-teal-rgb), .6); outline-offset: 2px; }

/* Hover pill (positioned by home.js / product-detail.js) */
body #nav-backdrop {
    position: absolute;
    background: rgba(var(--aura-mint-rgb), 0.06);
    border: 0;
    box-shadow: none;
    border-radius: 10px;
    z-index: 1;
    transition: left .3s var(--ease-out), width .3s var(--ease-out), top .3s var(--ease-out), opacity .2s ease;
    opacity: 0;
    pointer-events: none;
}

/* Right side */
body .nav-right {
    display: flex; flex-direction: row; align-items: center;
    gap: 8px;
    margin-left: 10px;
}
body .nav-login {
    display: inline-flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: 12px;
    background: linear-gradient(135deg, #46dcbc 0%, #22b9c9 100%);
    color: #03120f; font-size: .85rem; font-weight: 800;
    text-decoration: none; white-space: nowrap;
    box-shadow: 0 8px 22px -10px rgba(1,5,13,0.75), inset 0 1px 0 rgba(255, 255, 255, .35);
    transition: transform .2s var(--ease-out), box-shadow .2s;
}
body .nav-login:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -10px rgba(1,5,13,0.9), inset 0 1px 0 rgba(255, 255, 255, .35); }
body .nav-login:active { transform: scale(.97); }

/* Hamburger → X morph */
body #mobile-menu-btn {
    position: relative;
    width: 40px; height: 40px; border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(var(--aura-mint-rgb), .05);
    color: var(--aura-ink, #effbf7);
    align-items: center; justify-content: center;
    transition: background .2s ease, transform .15s var(--ease-out);
}
body #mobile-menu-btn:hover { background: rgba(var(--aura-mint-rgb), .1); }
body #mobile-menu-btn:active { transform: scale(.94); }
body #mobile-menu-btn .hb { position: relative; width: 18px; height: 12px; display: block; }
body #mobile-menu-btn .hb span {
    position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px;
    background: currentColor;
    transition: transform .45s var(--ease-spring), opacity .2s ease;
}
body #mobile-menu-btn .hb span:nth-child(1) { top: 0; }
body #mobile-menu-btn .hb span:nth-child(2) { top: 5px; }
body #mobile-menu-btn .hb span:nth-child(3) { top: 10px; }
body #mobile-menu-btn.open .hb span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
body #mobile-menu-btn.open .hb span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
body #mobile-menu-btn.open .hb span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Links collapse into the menu button below 1024px */
@media (min-width: 1024px) {
    body #mobile-menu-btn, body #mobile-menu { display: none !important; }
}
@media (max-width: 1023px) {
    body .nav-links { display: none !important; }
    body .nav-right { margin-left: auto; }
    body #mobile-menu-btn { display: flex !important; }
}
@media (max-width: 767px) {
    :root { --nav-h: 58px; --nav-gap: 10px; }
    body .nav-container { left: 10px; right: 10px; gap: 10px; padding: 0 8px 0 10px; border-radius: 16px; }
    body .nav-right { gap: 6px; }
    body .nav-logo-img { height: 32px; width: 32px; }
    body .nav-brand { font-size: 1.05rem; }
    body .nav-login { height: 38px; padding: 0 12px; }
}
@media (max-width: 380px) {
    body .nav-brand { display: none; }
}

/* ── Mobile menu: spring panel with cascading items ── */
body #mobile-menu {
    position: fixed;
    left: 16px !important; right: 16px;
    width: auto !important; max-width: 520px !important;
    margin: 0 auto;
    z-index: 99;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px !important;
    background: rgba(var(--aura-panel-rgb), 0.86) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow: 0 30px 60px -20px rgba(1, 5, 13, .9), 0 2px 8px rgba(1, 5, 13, .4) !important;
    transform-origin: 50% 0;
    opacity: 0;
    transform: translate3d(0, -14px, 0) scale(.94);
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity .2s ease,
        transform .55s var(--ease-spring),
        visibility 0s linear .55s;
}
body #mobile-menu.open {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    visibility: visible;
    pointer-events: auto;
    transition:
        opacity .2s ease,
        transform .55s var(--ease-spring),
        visibility 0s linear 0s;
}
body #mobile-menu .mm-link {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px; border-radius: 13px;
    color: var(--aura-text, #c6e2db); font-weight: 600; font-size: .95rem;
    text-decoration: none;
    opacity: 0;
    transform: translate3d(0, -10px, 0);
    transition: opacity .25s ease, transform .5s var(--ease-spring), background-color .2s ease, color .2s ease;
}
body #mobile-menu .mm-link i { width: 18px; text-align: center; color: var(--aura-dim, #65867e); transition: color .2s ease; }
body #mobile-menu .mm-link:hover, body #mobile-menu .mm-link.active { background: rgba(var(--aura-teal-rgb), .1); color: var(--aura-ink, #effbf7); }
body #mobile-menu .mm-link:hover i, body #mobile-menu .mm-link.active i { color: var(--aura-teal, #3fd3b4); }
body #mobile-menu .mm-link:active { transform: scale(.97); }
body #mobile-menu.open .mm-link { opacity: 1; transform: translate3d(0, 0, 0); }
body #mobile-menu.open .mm-link:nth-child(1) { transition-delay: .04s, .04s, 0s, 0s; }
body #mobile-menu.open .mm-link:nth-child(2) { transition-delay: .08s, .08s, 0s, 0s; }
body #mobile-menu.open .mm-link:nth-child(3) { transition-delay: .12s, .12s, 0s, 0s; }
body #mobile-menu.open .mm-link:nth-child(4) { transition-delay: .16s, .16s, 0s, 0s; }
body #mobile-menu.open .mm-link:nth-child(5) { transition-delay: .20s, .20s, 0s, 0s; }
body #mobile-menu.open .mm-link:nth-child(6) { transition-delay: .24s, .24s, 0s, 0s; }
body #mobile-menu .mm-cta {
    margin-top: 6px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px; border-radius: 13px;
    background: linear-gradient(135deg, #46dcbc 0%, #22b9c9 100%);
    color: #03120f; font-weight: 800; font-size: .92rem; text-decoration: none;
    opacity: 0; transform: translate3d(0, -10px, 0);
    transition: opacity .25s ease .28s, transform .5s var(--ease-spring) .28s;
}
body #mobile-menu.open .mm-cta { opacity: 1; transform: translate3d(0, 0, 0); }

@media (prefers-reduced-motion: reduce) {
    body .nav-container { animation: none; transition: background-color .2s ease; }
    body #mobile-menu, body #mobile-menu .mm-link, body #mobile-menu .mm-cta { transition-duration: .01s !important; transition-delay: 0s !important; }
}

/* ═══ NAVBAR V4 — open bar, glass capsule for the links ═══════════════════
   The bar itself is transparent so the backdrop runs to the top edge; the
   only glass is the centred link capsule. Once the page scrolls the bar
   picks up a thin frosted strip so content never reads through the text.
   (Overrides V3 above; kept separate so the history is easy to diff.) */
body .nav-container {
    top: 0; left: 0; right: 0;
    max-width: none; margin: 0;
    height: 72px;
    padding: 0 max(20px, calc((100% - 1200px) / 2 + 20px));
    gap: 16px;
    background: transparent;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    box-shadow: none;
}
body .nav-container::after { display: none; }
body .nav-container.nav-scrolled {
    background: rgba(var(--aura-panel-rgb), 0.74);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-bottom-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 12px 30px -24px rgba(1, 5, 13, 0.9);
}

body .nav-logo-img { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }

/* The capsule */
body .nav-links {
    margin-left: auto; margin-right: auto;
    padding: 4px;
    gap: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* No backdrop blur of its own: it sits inside the bar, which already blurs what's behind it */
}

/* Phones: a blurred fixed bar is re-blurred on every scroll frame; a near-solid one looks the same at this size */
@media (max-width: 900px) {
    body .nav-container.nav-scrolled {
        background: rgba(var(--aura-panel-rgb), 0.95);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}
body .nav-item {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--aura-muted, #8fb5ac);
    transition: color .2s ease, background-color .2s ease;
}
body .nav-item::after { display: none; }
body .nav-item:hover { color: var(--aura-ink, #effbf7); }
body .nav-item.active {
    color: #08090b;
    background: var(--aura-snow);
}
body .nav-item:active { transform: scale(.97); }
body #nav-backdrop {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
}

body .nav-right { margin-left: 0; gap: 8px; }

/* Currency trigger */
body .nav-cur {
    display: inline-flex; align-items: center; gap: 5px;
    height: 40px; padding: 0 12px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: 'Outfit', sans-serif;
    cursor: pointer; white-space: nowrap;
    transition: border-color .2s ease, background-color .2s ease, transform .15s var(--ease-out);
}
body .nav-cur:hover { border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.04); }
body .nav-cur:active { transform: scale(.97); }

/* Primary action: snow-white, the one bright object in the bar */
body .nav-cta {
    display: inline-flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 18px;
    border-radius: 999px;
    background: var(--aura-snow);
    color: #08090b;
    font-size: .875rem; font-weight: 700; letter-spacing: -0.005em;
    text-decoration: none; white-space: nowrap;
    box-shadow: inset 0 -2px 0 rgba(6, 18, 15, 0.12), 0 8px 18px -10px rgba(1, 5, 13, 0.9);
    transition: background-color .2s ease, transform .15s var(--ease-out);
}
body .nav-cta i { font-size: .72rem; transition: transform .25s var(--ease-out); }
body .nav-cta:hover { background: #ffffff; }
body .nav-cta:hover i { transform: translateX(3px); }
body .nav-cta:active { transform: scale(.97); }

body #mobile-menu-btn { border-radius: 999px; border-color: rgba(255, 255, 255, .12); background: transparent; }

@media (max-width: 1023px) {
    body .nav-right { margin-left: auto; }
}
@media (max-width: 767px) {
    body .nav-container { height: 64px; padding: 0 14px; gap: 10px; }
    body .nav-cta { height: 38px; padding: 0 14px; }
    body .nav-cur { height: 38px; padding: 0 10px; }
}

/* Mobile menu: drop the glass slab look, match the capsule */
body #mobile-menu { border-radius: 22px !important; }
body #mobile-menu .mm-link.active { background: var(--aura-snow); color: #08090b; }
body #mobile-menu .mm-link.active i { color: #08090b; }
body #mobile-menu .mm-cta {
    background: var(--aura-snow); color: #08090b; border-radius: 14px;
    box-shadow: inset 0 -2px 0 rgba(6, 18, 15, 0.12);
}
