:root { --header-height: 80px; --font-main: "Inter", sans-serif; }

/* 1. LAYOUT RESET */
body { padding-top: var(--header-height) !important; }
body.no-scroll { overflow: hidden !important; position: fixed; width: 100%; }

/* NEUTRALIZE WP BLOCK GAP ON HOME PAGE */
body.home :where(.wp-site-blocks) > * { margin-block-start: 0 !important; }

/* ADMIN BAR */
.admin-bar .site-header-custom { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header-custom { top: 46px; } }

/* NUCLEAR RESET */
.site-header-custom *, .mega-menu-overlay *, .search-modal-overlay * { 
    text-decoration: none !important; 
    list-style: none !important; 
    box-sizing: border-box; 
    outline: none !important;
}
.site-header-custom ul, .mega-menu-overlay ul { margin: 0; padding: 0; }

/* MAIN HEADER */
.site-header-custom {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--header-height);
    background: #fff; z-index: 20000; font-family: var(--font-main);
    text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 1px solid #f2f2f2;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.header-inner {
    display: grid; 
    grid-template-columns: 1fr auto 1fr;
    align-items: center; 
    height: 100%; padding: 0 40px; position: relative; z-index: 30001; 
    background: #fff;
    transition: background 0.4s ease;
}

.header-left, .header-right { display: flex; align-items: center; width: 100%; }
.header-left { justify-content: flex-start; }
.header-right { justify-content: flex-end; gap: 20px; }
.header-center { display: flex; justify-content: center; }

.logo-link { width: 250px; line-height: 0; display: block; }
.main-logo { width: 100%; height: auto; transition: filter 0.4s ease; }

/* DESKTOP NAV - ENSURE VISIBLE */
.desktop-only-nav { display: block !important; }
.nav-links { display: flex; gap: 25px; font-size: 11px; }
.nav-item { position: relative; height: var(--header-height); display: flex; align-items: center; }
.nav-item > a { color: #000; opacity: 1; transition: opacity 0.3s, color 0.4s; font-weight: 500; }
.nav-item:hover > a { opacity: 0.6; }

/* MEGA MENU DESKTOP */
.desktop-mega {
    position: fixed; top: var(--header-height); left: 0; width: 100%;
    background: #fff; padding: 40px; border-bottom: 1px solid #f2f2f2;
    z-index: 10002; clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path 0.4s ease;
}
.nav-item.has-subs:hover .desktop-mega { clip-path: inset(0 0 0 0); visibility: visible; }
.sub-list-vertical li { padding: 10px 0; font-size: 11px; }
.sub-list-vertical li a { color: #000; opacity: 1; transition: opacity 0.2s; }
.sub-list-vertical li a:hover { opacity: 0.5; }

/* BLUR OVERLAY */
.header-blur-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(10px);
    opacity: 0; pointer-events: none; transition: opacity 0.5s; z-index: 9998; 
}
.site-header-custom:has(.nav-item.has-subs:hover) ~ .header-blur-overlay,
.header-blur-overlay.active { opacity: 1; pointer-events: auto; }

/* SEARCH MODAL STYLES */
.search-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.98); z-index: 50000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.4s ease;
    cursor: pointer;
}
.search-modal-overlay.active { opacity: 1; visibility: visible; }
.search-form-container { width: 100%; max-width: 600px; padding: 20px; text-align: center; cursor: default; }
.search-close-btn { position: absolute; top: 30px; right: 40px; background: none; border: none; cursor: pointer; padding: 10px; }
.search-input-field {
    width: 100%; border: none; border-bottom: 2px solid #000;
    padding: 15px 0; font-size: 24px; font-family: var(--font-main);
    text-transform: uppercase; letter-spacing: 0.1em; outline: none; background: transparent;
}

/* --- FORCE HIDE MOBILE ELEMENTS ON DESKTOP --- */
.mobile-nav-toggle, .mega-menu-overlay, .mobile-level-2 { display: none !important; }

/* --- MOBILE STYLES (SCREEN ONLY) --- */
@media (max-width: 1023px) {
    .header-inner { padding: 0 20px; }
    .logo-link { width: 160px; }
    
    /* Hide Desktop Nav */
    .desktop-only-nav, .hide-mobile { display: none !important; }
    
    /* Show Mobile Nav Toggle */
    .mobile-nav-toggle { display: flex !important; flex-direction: column; gap: 6px; background: none !important; border: none !important; cursor: pointer; padding: 10px; z-index: 40000; position: relative; }
    .mobile-nav-toggle .bar { width: 22px; height: 1px; background: #000; transition: 0.3s; }
    
    .menu-open .mobile-nav-toggle .bar:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
    .menu-open .mobile-nav-toggle .bar:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

    .mega-menu-overlay {
        display: block !important; position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background: #fff; z-index: 15000; transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
        overflow: hidden;
    }
    .menu-open .mega-menu-overlay { transform: translateX(0); }
    .mobile-nav-container { position: relative; width: 100%; height: 100%; transition: transform 0.4s ease; margin-top: var(--header-height) !important; }
    .mobile-nav-container.drilled { transform: translateX(-100%); }
    .mega-menu-overlay a { display: block; padding: 25px 40px; font-size: 11px; color: #000; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; }
    .mobile-level-2 { display: block !important; position: absolute; top: 0; left: 100%; width: 100%; height: 100%; background: #fff; visibility: hidden; transition: visibility 0.4s; }
    .mobile-level-2.active { visibility: visible; }
    .drill-up-trigger { border-bottom: 1px solid #f2f2f2 !important; margin-bottom: 10px; color: #000 !important; font-weight: bold; }
}

/* --- HOME PAGE TRANSPARENCY & OVERRIDES --- */
@media (min-width: 1024px) {
    body.home { padding-top: 0 !important; }

    body.home .site-header-custom:not(.is-scrolled),
    body.home .site-header-custom:not(.is-scrolled) .header-inner {
        background: transparent !important;
        border-bottom-color: transparent;
    }

    body.home .site-header-custom:not(.is-scrolled):has(.nav-item:hover),
    body.home .site-header-custom:not(.is-scrolled):has(.nav-item:hover) .header-inner {
        background: #fff !important;
        border-bottom-color: #f2f2f2;
    }

    /* Text & Icon Colors */
    body.home .site-header-custom:not(.is-scrolled) .nav-item > a,
    body.home .site-header-custom:not(.is-scrolled) .header-icon,
    body.home .site-header-custom:not(.is-scrolled) .header-cart-wrapper * { color: #fff !important; }
    
    body.home .site-header-custom:not(.is-scrolled) .header-icon svg,
    body.home .site-header-custom:not(.is-scrolled) .header-cart-wrapper svg * { stroke: #fff !important; }
    
    body.home .site-header-custom:not(.is-scrolled) .main-logo { filter: brightness(0) invert(1); }

    /* Hover States (Black) */
    body.home .site-header-custom:not(.is-scrolled):has(.nav-item:hover) .nav-item > a,
    body.home .site-header-custom:not(.is-scrolled):has(.nav-item:hover) .header-icon,
    body.home .site-header-custom:not(.is-scrolled):has(.nav-item:hover) .header-cart-wrapper * { color: #000 !important; }
    
    body.home .site-header-custom:not(.is-scrolled):has(.nav-item:hover) .header-icon svg,
    body.home .site-header-custom:not(.is-scrolled):has(.nav-item:hover) .header-cart-wrapper svg * { stroke: #000 !important; }
    
    body.home .site-header-custom:not(.is-scrolled):has(.nav-item:hover) .main-logo { filter: none; }
}

/* Scrolled State */
.site-header-custom.is-scrolled, 
.site-header-custom.is-scrolled .header-inner { background: #fff !important; border-bottom: 1px solid #f2f2f2; }
.site-header-custom.is-scrolled .nav-item > a,
.site-header-custom.is-scrolled .header-icon,
.site-header-custom.is-scrolled .header-cart-wrapper * { color: #000 !important; }
.site-header-custom.is-scrolled .header-icon svg,
.site-header-custom.is-scrolled .header-cart-wrapper svg * { stroke: #000 !important; }
.site-header-custom.is-scrolled .main-logo { filter: none !important; }