/**
 * =====================================================================================
 * HELLA 3D MANAGEMENT SUITE: MASTER NAVIGATION STYLESHEET
 * =====================================================================================
 * @file        public_navbar.css
 * @description Master stylesheet governing global UI parameters, navigation architecture,
 * and high-performance glassmorphism rendering.
 * @version     1.0.3 (iOS Dynamic Island & Top-Edge Fade Mask Patch)
 * @cleared     Aug 5, 2026
 * * ARCHITECTURE OVERVIEW:
 * 1. Liquid Glassmorphism: Utilizes high-saturation backdrop-filters (--glass-blur)
 * to average intersecting background colors into unified panes of glass.
 * 2. Absolute Takeover: The desktop search bar uses CSS `calc()` to physically 
 * expand leftward without Javascript width calculations, avoiding layout thrashing.
 * 3. Drill-Down DOM: Mobile accordions have been replaced with iOS-style Drill-Downs
 * (transform: translateX) to avoid height-calculation DOM repaints.
 * 4. CSS Guillotine Masking: Dropdowns use complex -webkit-mask-image layers to 
 * seamlessly wrap around injected Javascript fillet elements.
 * 5. Hover Query Isolation: Utilizes @media (hover: hover) to prevent WebKit 
 * sticky-hover bugs on touch-screen devices.
 * 6. Viewport Safe Areas: Integrates Apple env() variables to prevent Dynamic Island clipping.
 * =====================================================================================
 */

/* ============================================================
   1. MASTER VARIABLES & GLOBAL RESET
   ============================================================ */
:root {
    --glass-bg: rgba(16, 16, 16, 0.35);
    /* High Light Transmission */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(32px) saturate(220%);
    /* Aggressive blending */

    /* Negative spread (-15px) physically prevents shadow from bleeding upwards */
    --glass-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.65);

    /* Microscopic SVG noise grain for premium physical texture */
    --glass-noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.025'/%3E%3C/svg%3E");
}

/* Debouncer Class: Ruthlessly disables transitions during window resize */
.resize-animation-stopper * {
    animation: none !important;
    transition: none !important;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* iOS 100vh Hardware Recalculation */
html {
    height: -webkit-fill-available;
}

body {
    font-family: Arial, sans-serif;
    color: #ffffff;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    position: relative;
    background-color: #050505;
}

/* ============================================================
   2. BACKGROUND ENGINE (Simulated Liquid Test)
   ============================================================ */
.h3d-liquid-bg {
    position: fixed;
    /* Massive 15vh physical bleed off-screen to cover iOS rubber-band overscroll */
    top: -15vh;
    bottom: -15vh;
    left: 0;
    right: 0;
    z-index: -10;
    overflow: hidden;
    background-color: #080808;
    
    /* Top-Edge Fade Mask: 
       0 to 15vh (off-screen rubber-band zone) is completely transparent.
       15vh to 25vh (top edge of actual screen) smoothly fades into full opacity. */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 15vh, black 25vh, black 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, transparent 15vh, black 25vh, black 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform;
    animation: floatBlob 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-red {
    width: 55vw;
    height: 55vw;
    background: rgba(217, 0, 0, 0.35);
    top: -10%;
    left: -10%;
    animation-duration: 25s;
}

.blob-dark {
    width: 50vw;
    height: 50vw;
    background: rgba(30, 30, 30, 0.8);
    bottom: -20%;
    right: -10%;
    animation-duration: 22s;
    animation-direction: alternate-reverse;
}

.blob-accent {
    width: 40vw;
    height: 40vw;
    background: rgba(150, 0, 0, 0.20);
    top: 35%;
    left: 45%;
    animation-duration: 28s;
}

@keyframes floatBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(5%, 8%) scale(1.05);
    }

    66% {
        transform: translate(-5%, 4%) scale(0.95);
    }

    100% {
        transform: translate(8%, -5%) scale(1.02);
    }
}

.glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 12, 12, 0.4);
    backdrop-filter: blur(50px) saturate(150%);
    -webkit-backdrop-filter: blur(50px) saturate(150%);
    background-image: var(--glass-noise);
    
    /* PERFORMANCE OPTIMIZATIONS */
    background-blend-mode: overlay;
    transform: translateZ(0);
    will-change: transform, backdrop-filter;
}

/* ============================================================
   3. PAGE DIMMER (Focus Overlay)
   ============================================================ */
.page-dimmer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    /* PERFORMANCE OPTIMIZATIONS */
    transform: translateZ(0);
    will-change: transform, backdrop-filter, opacity;
    
    z-index: 990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
}

.page-dimmer.active {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================
   4. ANNOUNCEMENT BAR
   ============================================================ */
.announcement-bar {
    background-color: var(--glass-bg);
    background-image: var(--glass-noise);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    
    /* PERFORMANCE OPTIMIZATIONS */
    background-blend-mode: overlay;
    transform: translateZ(0);
    will-change: transform, backdrop-filter;
    
    color: #ffffff;
    text-align: center;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 35px 10px 20px;
    font-size: 0.85rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    border-bottom: 1px solid var(--glass-border);
}

.announcement-bar p {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: calc(50% + (env(safe-area-inset-top, 0px) / 2));
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn svg {
    width: 18px;
    height: 18px;
}

/* Hover restricted to mouse devices to prevent sticky hovers */
@media (hover: hover) {
    .close-btn:hover {
        transform: translateY(-50%) scale(1.2);
    }
}

/* ============================================================
   5. MAIN NAVBAR PILL CORE
   ============================================================ */
.main-navbar {
    position: sticky;
    top: calc(20px + env(safe-area-inset-top, 0px));
    margin: 20px auto 0 auto;
    width: calc(100% - 40px);
    max-width: 1800px;
    border-radius: 16px;
    z-index: 1000;
    background: transparent;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: box-shadow 0.2s ease, border-bottom-color 0.2s ease;
}

/* Using a pseudo-element for the background fixes nested-blur bugs across browsers */
.main-navbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: var(--glass-bg);
    background-image: var(--glass-noise);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    
    /* PERFORMANCE OPTIMIZATIONS */
    background-blend-mode: overlay;
    transform: translateZ(0);
    will-change: transform, backdrop-filter;
    
    z-index: -1;
}

.main-navbar.dropdown-active {
    box-shadow: 0 0 0 transparent;
    border-bottom-color: transparent;
}

/* The Universal Flush Corner Constraint: Snaps the pill square during full-width drops */
.main-navbar.search-results-active,
.main-navbar.search-results-active::before,
.main-navbar.search-results-active-mobile,
.main-navbar.search-results-active-mobile::before {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.navbar-container {
    width: 100%;
    height: 60px;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* LOGO & TYPOGRAPHY */
.nav-logo-container {
    display: flex;
    align-items: center;
    height: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-logo img {
    height: 40px;
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.3s ease;
}

@media (hover: hover) {
    .nav-logo:hover img {
        transform: scale(1.03);
        filter: drop-shadow(0 0 8px rgba(217, 0, 0, 0.4));
    }
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    height: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-link {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}

.nav-link .caret {
    width: 16px;
    height: 16px;
    margin-left: 6px;
    transition: transform 0.3s ease;
}

@media (hover: hover) {
    .nav-link:hover {
        color: rgb(217, 0, 0);
    }
}

/* ============================================================
   6. DESKTOP NAVIGATION COMPONENT (> 850px)
   ============================================================ */
@media (min-width: 851px) {
    .hide-desktop {
        display: none !important;
    }

    .dropdown:hover .nav-link .caret {
        transform: rotate(180deg);
    }

    .dropdown:hover .dropdown-content {
        display: block;
        animation: dropFade 0.2s ease forwards;
    }
    
    /* Safely flattens our new PHP scroll wrapper so it doesn't break desktop's flex layout */
    .mobile-dropdown-scroll {
        display: contents; 
    }
}

@keyframes dropFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* THE INVERSE FILLETS (DOM-Injected via JS) */
.nav-flare {
    position: absolute;
    top: 100%;
    width: 25px;
    height: 24px;
    margin-top: -1px;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
    background-color: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    
    /* OPTIMIZATIONS */
    transform: translateZ(0);
    will-change: transform, opacity, backdrop-filter;
    
    opacity: 0;
    visibility: hidden;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.nav-item.dropdown:hover .nav-flare {
    visibility: visible;
    animation: dropFade 0.2s ease forwards;
}

.nav-flare.flare-hovered {
    background-color: rgba(65, 15, 15, 0.55);
}

.nav-flare.is-scrolled {
    pointer-events: none;
}

.nav-flare-left {
    left: -24px;
    background-image: var(--glass-noise), radial-gradient(circle at 0% 100%, transparent 23px, var(--glass-border) 23.5px, var(--glass-border) 24px, transparent 24.5px);
    -webkit-mask-image: radial-gradient(circle at 0% 100%, transparent 23.5px, black 24px);
    mask-image: radial-gradient(circle at 0% 100%, transparent 23.5px, black 24px);
}

.nav-flare-right {
    left: 219px;
    background-image: var(--glass-noise), radial-gradient(circle at 100% 100%, transparent 23px, var(--glass-border) 23.5px, var(--glass-border) 24px, transparent 24.5px);
    -webkit-mask-image: radial-gradient(circle at 100% 100%, transparent 23.5px, black 24px);
    mask-image: radial-gradient(circle at 100% 100%, transparent 23.5px, black 24px);
}

/* DESKTOP DROPDOWN PANELS */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 0;
    background-color: var(--glass-bg);
    background-image: var(--glass-noise);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    
    /* PERFORMANCE OPTIMIZATIONS */
    background-blend-mode: overlay;
    transform: translateZ(0);
    will-change: transform, backdrop-filter;
    
    border-radius: 0 0 16px 16px;
    border: 1px solid var(--glass-border);
    border-top: none;
    box-shadow: var(--glass-shadow);

    /* Guillotine Mask: Allows scrolling content without spilling over the injected curved fillets */
    -webkit-mask-image: linear-gradient(to right, transparent 1px, black 1px, black calc(100% - 1px), transparent calc(100% - 1px)), linear-gradient(to bottom, black, black);
    -webkit-mask-size: 100% 24px, 100% calc(100% - 24px);
    -webkit-mask-position: top left, bottom left;
    -webkit-mask-repeat: no-repeat;
    mask-image: linear-gradient(to right, transparent 1px, black 1px, black calc(100% - 1px), transparent calc(100% - 1px)), linear-gradient(to bottom, black, black);
    mask-size: 100% 24px, 100% calc(100% - 24px);
    mask-position: top left, bottom left;
    mask-repeat: no-repeat;

    scrollbar-width: thin;
    scrollbar-color: rgb(217, 0, 0) transparent;
}

.dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 0 16px 0;
}

.dropdown-content::-webkit-scrollbar-thumb {
    background: rgb(217, 0, 0);
    border-radius: 10px;
}

.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: rgb(255, 50, 50);
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

@media (hover: hover) {
    .dropdown-content a:hover,
    .dropdown-content a.link-hovered {
        background: rgba(217, 0, 0, 0.20);
        padding-left: 20px;
        color: #ffffff;
    }
}

/* ============================================================
   7. ICONS & DESKTOP FULL-WIDTH SEARCH BAR
   ============================================================ */
.nav-icons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    height: 100%;
    position: static;
}

.icon-btn {
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.icon-btn svg {
    width: 22px;
    height: 22px;
}

/* * FIX: The Sticky Hover Eradicator
 * By locking this inside a (hover: hover) media query, iOS/WebKit will no longer
 * cache the hover state on touch events, allowing the hamburger menu to return to white.
 */
@media (hover: hover) {
    .icon-btn:hover {
        color: rgb(217, 0, 0);
        transform: scale(1.1);
    }
}

/* * Binds to the JS class toggle so the hamburger icon explicitly turns red
 * *only* while the mobile menu is actively deployed.
 */
.icon-btn.active {
    color: rgb(217, 0, 0);
}

.cart-btn {
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: rgb(217, 0, 0);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Ensures Search Bar expands without bumping the Cart */
.search-container {
    position: static;
    display: flex;
    align-items: center;
    width: 210px;
    height: 100%;
}

/* Unexpanded Search Form */
.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 0 15px;
    height: 36px;
    width: 210px;
    position: absolute;
    right: 67px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Chrome/Safari standard placeholder */
.search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    color: white;
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* The Detached Chevron Back Arrow */
.close-desktop-search {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
}

.close-desktop-search svg {
    width: 24px;
    height: 24px;
}

@media (hover: hover) {
    .close-desktop-search:hover {
        color: rgb(217, 0, 0);
        transform: translateY(-50%) scale(1.1);
    }
}

/* --- THE FULL-WIDTH CSS TAKEOVER --- */
.navbar-container.desktop-search-active .search-form {
    width: calc(100% - 127px);
    height: 44px;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgb(217, 0, 0);
    box-shadow: 0 0 10px rgba(217, 0, 0, 0.3);
}

.navbar-container.desktop-search-active .search-btn {
    display: none;
}

.navbar-container.desktop-search-active .close-desktop-search {
    display: flex;
    animation: fadeInIcon 0.3s forwards;
}

.navbar-container.desktop-search-active .nav-logo-container,
.navbar-container.desktop-search-active .nav-menu,
.navbar-container.desktop-search-active .cart-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.98);
}

.mobile-search-toggle,
.mobile-toggle,
.close-search-btn,
.mobile-search-form {
    display: none;
}

/* ============================================================
   8. LIVE AJAX SEARCH RESULTS CONTAINER (Unified)
   ============================================================ */
.live-search-results {
    /* Fillets purged. This snaps perfectly to outer borders with zero gaps. */
    position: absolute;
    top: 100%;
    left: -1px;
    width: calc(100% + 2px);
    margin-top: 0;

    background-color: var(--glass-bg);
    background-image: var(--glass-noise);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    
    /* PERFORMANCE OPTIMIZATIONS */
    background-blend-mode: overlay;
    border-radius: 0 0 16px 16px;
    border: 1px solid var(--glass-border);
    border-top: none;
    box-shadow: var(--glass-shadow);
    z-index: 1010;
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;

    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    
    transform: translateY(-8px) translateZ(0);
    will-change: transform, opacity, backdrop-filter;
    transition: opacity 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.25s linear;

    scrollbar-width: thin;
    scrollbar-color: rgb(217, 0, 0) transparent;
}

.live-search-results.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) translateZ(0);
}

.live-search-results::-webkit-scrollbar {
    width: 6px;
}

.live-search-results::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 0 16px 0;
}

.live-search-results::-webkit-scrollbar-thumb {
    background: rgb(217, 0, 0);
    border-radius: 10px;
}

/* SEARCH RESULT LIST ITEMS */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    text-decoration: none;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

@media (hover: hover) {
    .search-result-item:hover {
        background: rgba(217, 0, 0, 0.15);
        padding-left: 25px;
    }
}

/* UPDATED THUMBNAILS: Larger 3:2 Aspect Ratio */
.search-result-img {
    width: 120px;       /* Massively increased for premium visibility */
    height: 80px;       /* Strictly maintains 3:2 aspect ratio */
    border-radius: 8px;
    object-fit: cover;
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;     /* CRITICAL: Prevents text from squishing the image */
}

.search-result-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 0.95rem;
    font-weight: 500;
    /* Force long titles to wrap exactly 2 lines. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    line-height: 1.4;
}

.search-result-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
}

.search-result-price {
    color: rgb(217, 0, 0);
    font-weight: bold;
}

.search-message {
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

/* View All CTA */
.view-all-btn {
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.view-all-btn svg {
    width: 18px;
    height: 18px;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

@media (hover: hover) {
    .view-all-btn:hover svg {
        transform: translateX(4px);
    }
}

/* ============================================================
   9. SMALL DESKTOP / TABLET (Search Overlay Mode)
   ============================================================ */
@media (max-width: 1250px) {
    .desktop-search {
        display: none;
    }

    .mobile-search-toggle {
        display: flex;
    }

    .close-search-btn {
        display: none;
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.7);
        cursor: pointer;
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 15;
    }

    .close-search-btn svg {
        width: 24px;
        height: 24px;
    }

    @media (hover: hover) {
        .close-search-btn:hover {
            color: rgb(217, 0, 0);
            transform: translateY(-50%) scale(1.1);
        }
    }

    .mobile-search-form {
        display: flex;
        position: absolute;
        left: 55px;
        right: 20px;
        top: 50%;
        transform: translateY(-50%) translateX(15px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 10;
    }

    .mobile-search-form input {
        width: 100%;
        background: rgba(255, 255, 255, 0.12);
        border: 1px solid rgb(217, 0, 0);
        color: white;
        padding: 0 15px;
        height: 40px;
        border-radius: 20px;
        outline: none;
        box-shadow: 0 0 10px rgba(217, 0, 0, 0.2);
        font-size: 1rem;
    }

    .nav-logo-container,
    .mobile-search-toggle,
    .cart-btn,
    .mobile-toggle,
    .nav-menu {
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .navbar-container.search-active .close-search-btn {
        display: flex;
        animation: fadeInIcon 0.3s forwards;
    }

    @keyframes fadeInIcon {
        from {
            opacity: 0;
            transform: translateY(-50%) translateX(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(-50%) translateX(0);
        }
    }

    .navbar-container.search-active .nav-logo-container,
    .navbar-container.search-active .nav-menu {
        opacity: 0;
        transform: translateX(-20px);
        pointer-events: none;
    }

    .navbar-container.search-active .mobile-search-form {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
        transform: translateY(-50%) translateX(0);
    }

    .navbar-container.search-active .mobile-search-toggle,
    .navbar-container.search-active .cart-btn,
    .navbar-container.search-active .mobile-toggle {
        opacity: 0;
        transform: translateX(20px);
        pointer-events: none;
    }
}

/* ============================================================
   10. MOBILE HAMBURGER ENGINE (< 850px)
   ============================================================ */
@media (max-width: 850px) {
    .hide-mobile {
        display: none !important;
    }

    .announcement-bar {
        padding: calc(8px + env(safe-area-inset-top, 0px)) 30px 8px 15px;
        font-size: 0.8rem;
    }

    .main-navbar {
        top: calc(10px + env(safe-area-inset-top, 0px));
        margin: 10px auto 0 auto;
        width: calc(100% - 20px);
    }

    .navbar-container {
        height: 64px;
        padding: 0 20px;
    }

    .mobile-toggle {
        display: flex;
    }

    .main-navbar.dropdown-active,
    .main-navbar.dropdown-active::before,
    .main-navbar.search-results-active-mobile,
    .main-navbar.search-results-active-mobile::before {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    /* Main Full-Width Mobile Canvas */
    .nav-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 0;
        border-radius: 0 0 16px 16px;
        background-color: var(--glass-bg);
        background-image: var(--glass-noise);
        backdrop-filter: var(--glass-blur);
        -webkit-backdrop-filter: var(--glass-blur);
        
        background-blend-mode: overlay;
        border: 1px solid var(--glass-border);
        border-top: none;
        box-shadow: var(--glass-shadow);
        padding: 0;
        align-items: stretch;
        visibility: hidden;
        opacity: 0;
        
        transform: translateY(-10px) translateZ(0);
        will-change: transform, opacity, backdrop-filter;
        
        transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.3s;
        z-index: 999;
        height: auto;
        max-height: 70vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    /* OPTION 1 & 2 FUSION: Locks the outer container scroll when the inner scroll mask takes over */
    .nav-menu.submenu-open {
        overflow: hidden;
    }

    .nav-menu.active {
        visibility: visible;
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }

    .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        height: auto;
        display: block;
        animation: fadeInMenu 0.3s ease;
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        width: 100%;
        padding: 20px 25px;
        font-size: 1.1rem;
        display: flex;
        justify-content: space-between;
        transition: background 0.2s ease, color 0.2s ease;
    }

    @keyframes fadeInMenu {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    /* --- DRILL-DOWN LOGIC --- */
    .nav-menu.submenu-open .nav-item:not(.active-node) {
        display: none;
    }

    .nav-menu.submenu-open .nav-item.active-node>.nav-link {
        display: none;
    }

    .nav-item.active-node .dropdown-content {
        display: flex;
        flex-direction: column;
        animation: slideInRight 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
        height: 100%;
        max-height: 70vh; /* Re-establishes the scroll limit for the inner wrapper */
    }

    @keyframes slideInRight {
        from {
            transform: translateX(30px);
            opacity: 0;
        }

        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        display: none;
        background: transparent;
        backdrop-filter: none;
        background-image: none;
        border: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
        max-height: none;
        overflow: visible;
        width: 100%;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .mobile-back-btn {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        background: transparent; /* No background filter required anymore! */
        color: rgb(217, 0, 0);
        border: none;
        padding: 18px 25px;
        font-size: 1.1rem;
        font-weight: 500;
        cursor: pointer;
        border-bottom: 1px solid var(--glass-border);
        transition: background-color 0.2s ease;
        position: relative; /* Removes sticky positioning */
        z-index: 5;
    }

    @media (hover: hover) {
        .mobile-back-btn:hover {
            background-color: rgba(255, 255, 255, 0.05);
        }
    }

    .mobile-back-btn svg {
        width: 22px;
        height: 22px;
    }
    
    /* OPTION 1 & 2 FUSION: The scroll container is pulled underneath the transparent back button */
    .mobile-dropdown-scroll {
        flex: 1;
        overflow-y: auto;
        margin-top: -61px; /* Pulls the div entirely behind the button */
        padding-top: 61px; /* Pushes the links back down into the visible area */
        
        /* Pushed the transparent deadzone down to 45px to clear the text, and stretched the fade to 90px for a smoother ghosting effect */
        -webkit-mask-image: linear-gradient(to bottom, transparent 45px, black 90px);
        mask-image: linear-gradient(to bottom, transparent 45px, black 90px);
        
        scrollbar-width: none; /* Hides the scrollbar inside the fade zone for maximum cleanliness */
    }
    
    .mobile-dropdown-scroll::-webkit-scrollbar {
        display: none;
    }

    .dropdown-content a {
        padding: 20px 25px;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 0;
        margin: 0;
        transition: background 0.2s ease, padding-left 0.2s ease;
    }

    @media (hover: hover) {
        .dropdown-content a:hover,
        .dropdown-content a:active {
            background: rgba(217, 0, 0, 0.15);
            padding-left: 30px;
            color: #ffffff;
        }
    }

    /* Override Mobile Results bounds */
    #mobileSearchResults {
        width: 100%;
        right: auto;
        left: 0;
        -webkit-mask-image: none;
        mask-image: none;
    }
}