/* Category Navbar Styles */

#category-navbar-container {
    background-color: #f8f9fa;
    /* border-bottom: 1px solid #e0e0e0; */
    padding: 0;
    position: fixed;
    z-index: 1000;
    /* height: 38px; */
    transition: all 0.16s ease;
    width: 100%;
}

#category-navbar-container.sticky {
    position: fixed;
    top: 0;
    width: 100%;
    left: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.32s ease;
}

#category-navbar {
    max-width: 100%;
    margin: 0 auto;
}

#category-navbar ul li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

#category-navbar .desktop-menu >ul {
    display: flex;
    justify-content: center;
    margin-bottom: 0 !important;
    flex-wrap: wrap;
}

#category-navbar .desktop-menu ul li {
    position: relative;
    display: flex;
    flex-shrink: 0;
    height: 36px;
    align-items: center;
}

#category-navbar .desktop-menu ul li a {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    width: 100%;
}

#category-navbar .desktop-menu ul li:hover>a {
    color: var(--nectar-accent-hover-color);
}

@media (min-width: 1000px) {
    /* Hide mobile structure on desktop */
    .mobile-menu {
        display: none;
    }
    
    /* Desktop dropdown styles */
    .desktop-menu ul ul {
        display: none;
        position: absolute;
        top: 99%;
        left: 0;
        background-color: #fff;
        list-style: none;
        padding: 10px 0;
        margin: 0;
        min-width: 200px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-radius: 4px;
    }

    .desktop-menu ul li:hover>ul {
        display: block;
        z-index: 100001;
    }

    /* Dropout (Sub-sub-categories) */
    .desktop-menu ul ul ul {
        top: 0;
        left: 100%;
    }

    .desktop-menu ul ul li a {
        padding: 10px 20px;
        white-space: nowrap;
    }

    /* Add arrows for dropdowns */
    .desktop-menu li.has-dropdown>a:after {
        content: '\25BE';
        display: inline-block;
        font-size: 1.25em;
        margin-left: 7px;
        position: absolute;
        right: -7px;
        top: 50%;
        transform: translateY(-50%);
    }

    .desktop-menu ul ul li.has-dropdown>a:after {
        content: '\25B8';
        /* Right arrow */
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
    }

    .desktop-menu ul li.has-dropdown ul li.has-dropdown>a:after{
        right: 0;
    }
}

#category-navbar ol,
ul {
    margin-bottom: 0;
}

#mobile-menu-trigger {
    display: none;
}


    /* Mobile Drilldown Styles */
    @media (max-width: 999px) {
        
        /* Hide desktop structure on mobile */
        .desktop-menu {
            display: none;
        }

        #category-navbar-container {
            height: 0;
            overflow: hidden;
            transition: height 0.35s ease-in-out;
            background: #fff;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            width: 100%;
            z-index: 9999;
        }

    #category-navbar-container.open {
        border-bottom: 1px solid #e0e0e0;
    }

    #category-navbar {
        position: relative;
        background: #fff;
    }

    /* All mobile menu lists are positioned absolutely and off-screen */
    .mobile-menu ul {
        list-style: none !important;
        padding: 0;
        margin: 0;
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.35s ease-in-out, opacity 0.35s ease-in-out;
    }

    /* The active menu slides in from the right */
    .mobile-menu ul.menu-active {
        position: relative;
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
        z-index: 2;
    }

    /* Forward navigation: old menu slides out to the left */
    .mobile-menu ul.menu-exiting-left {
        transform: translateX(-100%);
        opacity: 1;
        pointer-events: none;
        z-index: 1;
    }

    /* Back navigation: old menu slides out to the right */
    .mobile-menu ul.menu-exiting-right {
        transform: translateX(100%);
        opacity: 1;
        pointer-events: none;
        z-index: 1;
    }

    /* Forward navigation: new menu enters from the right */
    .mobile-menu ul.menu-entering-from-right {
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
    }

    /* Back navigation: new menu enters from the left */
    .mobile-menu ul.menu-entering-from-left {
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
    }

    /* General list item styles */
    .mobile-menu ul li {
        display: block;
        border-bottom: 1px solid #eee;
        position: relative;
    }
    
    .mobile-menu ul li a {
        padding: 15px;
        display: block;
        text-decoration: none;
        color: #333;
        width: calc(100% - 60px); /* Leave space for toggle */
    }
    
    .mobile-menu ul li:hover > a {
        color: #333; /* Disable hover on mobile */
    }

    /* Back button */
    .menu-back {
        background-color: #f8f8f8;
        border-bottom: 2px solid #ddd;
    }

    .menu-back a {
        font-weight: bold;
        color: #555;
        width: 100%; /* Back button takes full width */
    }

    /* Toggle (+) button */
    .accordion-toggle {
        position: absolute;
        right: 0;
        top: 0;
        width: 100px;
        height: 100%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        z-index: 2;
        background: #f8f8f8;
        border-left: 1px solid #eee;
    }
    
    .accordion-toggle:before {
        content: '→';
    }

        /* Main trigger bar */
        #mobile-menu-trigger {
            display: block;
            width: 100%;
            background-color: #f1f1f1;
            color: #333;
            padding: 15px;
            text-align: center;
            font-weight: bold;
            cursor: pointer;
            border-bottom: 1px solid #e0e0e0;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 9998;
            transition: all 0.16s ease;
        }
}