/**
 * Products Mega Menu Styles
 */

/* Products dropdown specific styles */
.site-navigation ul.navigation a{
    text-align: left;
}
.site-navigation ul.navigation .subcategory-item{
    font-weight: 400;
    text-align: left;
}
.site-navigation ul.navigation .subcategory-item:hover{
    text-decoration: underline;
}

.products-dropdown {
    position: relative;
}

/* Override default dropdown behavior for products */
.main-menu .navigation > li.products-dropdown > .products-mega-menu {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 1000;
    /* width: 900px;  */
    width: 80vw;
    background-color: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    padding: 0;
    border-radius: 4px;
    transform: translateX(-25%) translateY(15px);
    /* max-height: 500px; */
    height: 80vh;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Show the mega menu on hover */
.main-menu .navigation > li.products-dropdown:hover > .products-mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-25%) translateY(0);
}

/* Container for the menu content */
.products-menu-container {
    width: 100%;
    height: 100%;
}

/* Row structure for the menu */
.products-menu-row {
    display: flex;
    height: 100%;
}

/* Left sidebar with main categories */
.category-sidebar {
    width: 230px;
    background-color: #f5f5f5;
    border-right: 1px solid #e0e0e0;
    padding: 0;
    height: 100%;
}

/* Main category list */
.main-categories {
    list-style: none;
    padding: 0;
    margin: 0;
    height: 100%;
}

/* Main category items */
.main-category {
    padding: 0;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    transition: background-color 0.2s ease;
}

.main-category:last-child {
    border-bottom: none;
}

/* Main category links */
.main-category a {
    display: block;
    padding: 16px 20px;
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 15px;
    position: relative;
    padding-right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Main category hover/active states */
.main-category:hover a, 
.main-category.active a {
    background-color: #124772;
    color: #ffffff;
}

/* Active indicator for main category */
.main-category.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #ffffff;
    z-index: 2;
}

/* Remove arrows from product category items */
.main-category a:after,
.product-category-header:after,
.category-item a:after {
    display: none !important; /* Remove all category arrows */
}

/* Dropdown arrows for main header menu items with dropdowns */
.main-menu .navigation > li.dropdown > a:after {
    /* content: '▼'; */
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: inline-block;
}

/* Rotate arrow 180° on hover instead of moving it */
.main-menu .navigation > li.dropdown:hover > a:after {
    transform: translateY(-50%) rotate(180deg);
    opacity: 1;
}

/* Active state for arrow */
.main-menu .navigation > li.dropdown.active > a:after {
    transform: translateY(-50%) rotate(180deg);
    opacity: 1;
}

/* Reset for active item when hovered */
.main-category.active:hover a:after {
    transform: rotate(90deg) translateX(3px);
}

/* Right content area for subcategories */
.subcategory-content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    max-height: 500px;
    background-color: #ffffff;
}

/* Custom scrollbar for subcategory content */
.subcategory-content::-webkit-scrollbar {
    width: 6px;
}

.subcategory-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.subcategory-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.subcategory-content::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Subcategory panels (only one visible at a time) */
.subcategory-panel {
    display: none;
}

.subcategory-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Grid layout for subcategories */
.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.subcategory-grid a:hover {
    text-decoration: underline !important;
}

/* Subcategory items */
.subcategory-item {
    padding: 10px 12px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    display: block;
    border-radius: 4px;
    line-height: 1.3;
}

.subcategory-item:hover {
    background-color: #f0f7ff;
    color: #124772;
    padding-left: 16px;
}

/* Animation for panel changes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .main-menu .navigation > li.products-dropdown > .products-mega-menu {
        width: 800px;
    }
    
    .subcategory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .main-menu .navigation > li.products-dropdown > .products-mega-menu {
        width: 700px;
        transform: translateX(-15%) translateY(15px);
    }
    
    .main-menu .navigation > li.products-dropdown:hover > .products-mega-menu {
        transform: translateX(-15%) translateY(0);
    }
}

@media (max-width: 768px) {
    .main-menu .navigation > li.products-dropdown > .products-mega-menu {
        width: 100%;
        position: static;
        transform: none;
        max-height: none;
        box-shadow: none;
        padding: 0;
    }
    
    .products-menu-row {
        flex-direction: column;
    }
    
    .category-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .subcategory-content {
        padding: 15px;
        max-height: 300px;
    }
    
    .subcategory-grid {
        grid-template-columns: 1fr;
    }
}

/* Add dropdown arrows to ALL dropdown items in the header */
.navigation li.dropdown > a,
.pbmit-menu-wrap li.dropdown > a,
.navbar-nav li.dropdown > a,
li.products-dropdown > a,
li.has-submenu > a {
    position: relative;
    padding-right: 18px !important; /* Make space for the arrow */
}

/* Apply the arrow to multiple possible dropdown classes */
.navigation li.dropdown > a:after,
.pbmit-menu-wrap li.dropdown > a:after,
.navbar-nav li.dropdown > a:after,
li.products-dropdown > a:after,
li.has-submenu > a:after {
    /* content: '▼'; */
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: inline-block !important;
}

/* Rotate arrow 180° on hover for all dropdown items */
.navigation li.dropdown:hover > a:after,
.pbmit-menu-wrap li.dropdown:hover > a:after,
.navbar-nav li.dropdown:hover > a:after,
li.products-dropdown:hover > a:after,
li.has-submenu:hover > a:after {
    transform: translateY(-50%) rotate(180deg);
    opacity: 1;
}

/* Active state for all dropdown arrows */
.navigation li.dropdown.active > a:after,
.pbmit-menu-wrap li.dropdown.active > a:after,
.navbar-nav li.dropdown.active > a:after,
li.products-dropdown.active > a:after,
li.has-submenu.active > a:after {
    transform: translateY(-50%) rotate(180deg);
    opacity: 1;
} 

.main-category>a:hover {
    color: rgb(255, 255, 255) !important;
}