/* ==========================================================================
   CUSTOM FIXED HEADER STYLES
   ========================================================================== */

:root {
    --header-height: 100px;
    --header-bg: #e0deed;
    --header-padding-top: 20px;
    --header-padding-side: 50px;
    --brand-blue: #003366;
    --brand-orange: #FF6B00;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #eee;
}

/* Prevent body scroll when mobile menu is open */
body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    overscroll-behavior: none;
}

/* ----------------------------------------
   1. SITE HEADER CONTAINER
   ---------------------------------------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--header-bg);
    padding: var(--header-padding-top) var(--header-padding-side) 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease, box-shadow 0.4s ease;
    /* Smooth complex transition */
}

/* Scrolled State (Scroll-Driven Animation) */
.site-header.header-scrolled {
    padding-top: 5px;
    padding-bottom: 5px;
    background: rgba(224, 222, 237, 0.85);
    backdrop-filter: blur(12px);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
}

/* Scrolled: Shrink logo */
.site-header.header-scrolled .site-logo img {
    height: 45px !important;
}

/* Scrolled: Shrink nav links */
.site-header.header-scrolled .nav-link {
    font-size: 1rem;
}

/* Scrolled: Shrink contact info */
.site-header.header-scrolled .contact-item {
    font-size: 0.9rem;
}

.site-header.header-scrolled .contact-icon {
    width: 18px;
    height: 18px;
}

/* Body padding to prevent content overlap */
body {
    padding-top: 80px;
    /* Adjust based on actual header height */
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

/* ----------------------------------------
   2. HEADER LEFT: BRANDING + CONTACT
   ---------------------------------------- */
.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.site-logo {
    display: flex;
    align-items: center;
    max-width: 300px;
}

.site-logo img {
    height: 60px !important;
    /* Default: larger */
    width: auto !important;
    max-width: 100%;
    object-fit: contain;
    display: block;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-contact-info {
    display: flex;
    flex-wrap: wrap;
    /* Allow items to wrap naturally */
    gap: 10px 25px;
    /* row-gap column-gap */
    border-left: 1px solid var(--border-color);
    padding-left: 25px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    /* Default: larger */
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s, font-size 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.contact-item:hover {
    color: var(--brand-blue);
}

.contact-icon {
    width: 20px;
    /* Default: larger */
    height: 20px;
    color: var(--brand-blue);
    transition: width 0.4s, height 0.4s;
}

.whatsapp-icon {
    color: #25D366;
}

/* ----------------------------------------
   3. HEADER RIGHT: NAVIGATION
   ---------------------------------------- */
.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav {
    display: block;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    padding: 10px 0;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    position: relative;
    /* For pseudo-element */
}

/* Underline Effect */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 5px;
    /* Adjust distance */
    left: 0;
    width: 0;
    height: 2px;
    background-color: #000;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-item.active .nav-link::after {
    width: 100%;
}

.nav-link:hover,
.nav-item.active .nav-link {
    color: var(--text-primary);
}

/* Keep underline active when mega menu is open */
.nav-item.has-mega-menu:hover .nav-link::after,
.nav-item.has-dropdown:hover .nav-link::after {
    width: 100%;
}

/* ----------------------------------------
   4. NAV DROPDOWN (Download Menu)
   ---------------------------------------- */
.nav-item.has-dropdown {
    position: relative;
}

/* Invisible bridge to maintain hover connection */
.nav-item.has-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 220px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    overflow: hidden;
    padding: 10px 0;
}

.nav-item.has-dropdown:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-dropdown .dropdown-item:hover {
    background: #f5f5f5;
    color: var(--brand-blue);
    border-left-color: var(--brand-blue);
}

.nav-dropdown .dropdown-item svg {
    flex-shrink: 0;
    color: var(--brand-blue);
}

.nav-dropdown .dropdown-item:hover svg {
    color: var(--brand-orange);
}

/* ----------------------------------------
   5. MEGA MENU
   ---------------------------------------- */
.nav-item.has-mega-menu {
    position: relative;
}

/* Invisible bridge to maintain hover connection */
.nav-item.has-mega-menu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 15px;
    /* Bridge height matches the gap */
    background: transparent;
}

.mega-menu {
    position: absolute;
    top: calc(100% + 15px);
    /* Sits below the bridge */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 600px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Prevent triggering when hidden */
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    overflow: hidden;
}

.nav-item.has-mega-menu:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* Enable interaction when visible */
    transform: translateX(-50%) translateY(0);
}

.mega-menu-inner {
    display: flex;
    min-height: 320px;
}

/* Left: Parent Categories */
.mega-menu-parents {
    width: 200px;
    background: rgba(245, 245, 250, 0.9);
    padding: 20px 0;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.mega-parent-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.mega-parent-link:hover,
.mega-parent-link.active {
    background: #fff;
    color: var(--brand-blue);
    border-left-color: var(--brand-blue);
}

.mega-arrow {
    font-size: 1.2rem;
    opacity: 0.4;
    transition: transform 0.2s;
}

.mega-parent-link:hover .mega-arrow,
.mega-parent-link.active .mega-arrow {
    opacity: 1;
    transform: translateX(3px);
}

/* Right: Child Categories */
.mega-menu-children {
    flex: 1;
    position: relative;
    background: #fff;
}

.mega-child-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 25px 30px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
    /* Enable vertical scrolling */
}

.mega-child-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.mega-child-link {
    display: block;
    padding: 10px 0;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.mega-child-link:hover {
    color: var(--brand-blue);
    padding-left: 8px;
    border-bottom-color: var(--brand-blue);
}

.mega-no-children {
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
}

/* ----------------------------------------
   5. MOBILE HEADER
   ---------------------------------------- */
.header-mobile-toggle,
.mobile-nav-panel {
    display: none;
}

/* Hamburger Button */
.header-mobile-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text-primary);
}


/* ----------------------------------------
   6. RESPONSIVE
   ---------------------------------------- */
@media (max-width: 992px) {
    .site-header {
        padding: 15px 20px;
    }

    /* Hide main nav on mobile */
    .main-nav {
        display: none;
    }

    /* Stack contact info vertically */
    .header-left {
        gap: 20px;
    }

    .header-contact-info {
        flex-direction: column;
        gap: 5px;
        padding-left: 15px;
        border-left-width: 1px;
    }

    .contact-item {
        font-size: 0.8rem;
        gap: 6px;
    }

    .contact-icon {
        width: 14px;
        height: 14px;
    }

    .header-mobile-toggle {
        display: block;
    }

    /* Mobile Menu Drawer */
    .mobile-nav-panel {
        display: block;
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: #fff;
        z-index: 1001;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        padding: 80px 30px;
        overflow-y: auto;
    }

    .mobile-nav-panel.open {
        right: 0;
    }

    /* Swipe Hint Indicator */
    .mobile-nav-panel::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 12px;
        width: 4px;
        height: 40px;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.15);
        border-radius: 2px;
        transition: background 0.2s;
    }

    .mobile-nav-panel:active::before {
        background: rgba(0, 0, 0, 0.3);
    }

    .mobile-nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .mobile-nav-overlay.open {
        display: block;
    }

    /* Mobile Menu Items */
    .mobile-nav-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-nav-item {
        margin-bottom: 20px;
    }

    .mobile-nav-link {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--text-primary);
        text-decoration: none;
        display: block;
    }

    /* Mobile Products Accordion */
    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-expand-btn {
        background: none;
        border: 1px solid #ddd;
        width: 28px;
        height: 28px;
        border-radius: 4px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
    }

    .mobile-expand-btn:hover {
        background: #f5f5f5;
    }

    .expand-icon {
        font-size: 1.2rem;
        font-weight: 300;
        line-height: 1;
        transition: transform 0.3s;
    }

    .mobile-nav-item.has-children.open .expand-icon {
        transform: rotate(45deg);
    }

    .mobile-sub-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding-left: 15px;
        border-left: 2px solid var(--brand-blue);
        margin-left: 10px;
        margin-top: 0;
    }

    .mobile-nav-item.has-children.open .mobile-sub-menu {
        max-height: 500px;
        /* Large enough for content */
        margin-top: 15px;
    }

    .mobile-cat-link {
        display: block;
        padding: 10px 0;
        color: #555;
        text-decoration: none;
        font-size: 1rem;
        border-bottom: 1px solid #f0f0f0;
        transition: color 0.2s, padding-left 0.2s;
    }

    .mobile-cat-link:hover {
        color: var(--brand-blue);
        padding-left: 5px;
    }

    .mobile-contact-info {
        margin-top: 40px;
        padding-top: 30px;
        border-top: 1px solid #eee;
    }

    .mobile-contact-item {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 15px;
        color: var(--text-primary);
        text-decoration: none;
    }

}