﻿/* Desktop Category Dropdown Styles */
.desktop-category {
    background: linear-gradient(to right, #003C8F 0%, #1E6FC4 98%);
    padding: 0 1em;
    width: 235px;
    border-radius: 25px;
}

.navbar-brand .dropdown-menu {
    margin-top: 0;
    border-radius: 0px;
    font-size: 12px;
    margin-left: -12px;
    min-width: 235px;
    max-width: 300px;
    white-space: normal;
    word-wrap: break-word;
}

.navbar-brand .dropdown-menu .dropdown-toggle::after {
    vertical-align: middle;
    border-left: 0px solid;
    border-bottom: 0px solid transparent;
    border-top: 0px solid transparent;
}

.navbar-brand .dropdown-menu .dropdown .dropdown-menu {
    left: 100%;
    top: 0%;
    margin: 0 20px;
    border-width: 0;
    min-width: 200px;
    max-width: 250px;
    white-space: normal;
    word-wrap: break-word;
}

.navbar-brand .dropdown-menu .dropdown .dropdown-menu.left {
    right: 100%;
    left: auto;
}

.navbar-brand .dropdown-menu > li a:hover,
.navbar-brand .dropdown-menu > li.show {
    background: #1E6FC4;
    color: white;
}

.navbar-brand .navbar-brand .dropdown-menu > li.show > a {
    color: white;
}

.navbar-brand .dropdown-sa {
    position: static !important;
}

.navbar-brand .dropdown-toggle svg {
    margin-top: -2px;
}

.navbar-brand .dropdown-toggle .bt-span {
    color: white;
    font-weight: 600;
}

@media (min-width: 768px) {
    .navbar-brand .dropdown-menu .dropdown .dropdown-menu {
        margin: 0;
        border-width: 1px;
    }

    .bt-dropdown .dropdown-toggle::after {
        display: none;
    }
}

.navbar-brand .bt-dropdown-item::after {
    font-family: 'Poppins', sans-serif;
    display: inline-block;
    margin-right: 1rem;
    content: ">";
    font-weight: bold;
    border-bottom: 0;
    position: absolute;
    right: 0;
}

.navbar-brand .bt-dropdown-menu {
    min-width: 235px;
    max-width: 300px;
    white-space: normal;
    word-wrap: break-word;
}

.navbar-brand .bt-dropdown {
    margin-top: 5px;
}

/* Fix for dropdown items with long text */
.navbar-brand .dropdown-item {
    white-space: normal;
    word-wrap: break-word;
    padding-right: 25px;
    line-height: 1.4;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Fix for items with arrow */
.navbar-brand .bt-dropdown-item {
    position: relative;
    padding-right: 30px !important;
}

.navbar-brand .bt-dropdown-item::after {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 0;
}

@media (max-width: 991.98px) {
    .navbar-brand .bt-dropdown {
        display: none;
    }
}

/* ========== NEW: Equal Height Submenu Styles ========== */
@media (min-width: 992px) {
    .navbar-brand .bt-dropdown {
        display: block;
    }
    
    /* Hover functionality */
    .navbar-brand .dropdown:hover > .dropdown-menu {
        display: block;
    }

    .navbar-brand .dropdown-menu .dropdown:hover > .dropdown-menu {
        display: block;
        position: absolute;
    }
    
    /* CRITICAL: Make parent dropdown menu have a defined height context */
    .navbar-brand .dropdown-menu {
        position: absolute;
        display: none;
        min-height: auto;
    }
    
    /* Make dropdown items have consistent height */
    .navbar-brand .dropdown-menu .dropdown-item {
        min-height: 42px;
        display: flex;
        align-items: center;
    }
    
    /* Submenu positioning for equal height */
    .navbar-brand .dropdown-menu .dropdown {
        position: relative;
    }
    
    /* Key fix: Make submenu stretch to full parent height */
    .navbar-brand .dropdown-menu .dropdown > .dropdown-menu {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 100%;
        margin: 0;
        min-height: 100%;
        height: auto;
        overflow-y: auto;
        max-height: 500px; /* Fallback max height */
        border: 1px solid rgba(0,0,0,.15);
        background-color: #fff;
        background-clip: padding-box;
        border-radius: 0;
    }
    
    /* For right-aligned submenus */
    .navbar-brand .dropdown-menu .dropdown > .dropdown-menu.left {
        left: auto;
        right: 100%;
    }
    
    /* Ensure submenu items are properly styled */
    .navbar-brand .dropdown-menu .dropdown > .dropdown-menu .dropdown-item {
        padding: 8px 20px;
        white-space: normal;
        word-wrap: break-word;
    }
    
    /* Fix for long submenu content */
    .navbar-brand .dropdown-menu .dropdown > .dropdown-menu {
        max-height: 400px;
        overflow-y: auto;
    }
    
    /* Custom scrollbar for submenus */
    .navbar-brand .dropdown-menu .dropdown > .dropdown-menu::-webkit-scrollbar {
        width: 6px;
    }
    
    .navbar-brand .dropdown-menu .dropdown > .dropdown-menu::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    .navbar-brand .dropdown-menu .dropdown > .dropdown-menu::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }
    
    .navbar-brand .dropdown-menu .dropdown > .dropdown-menu::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* For Bootstrap 4 submenu support */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

/* Mobile adjustments */
@media (max-width: 991px) {
    .dropdown-submenu > .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }

    .dropdown-submenu > .dropdown-menu .dropdown-item {
        padding-left: 30px;
    }
}