/* Vertical Product Category Menu Styles */

.vertical-product-category-menu {
    width: 100%;
    max-width: 300px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    /* overflow: hidden; */ /* Removed to allow absolute positioning of menu/submenu */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    position: relative;
}

/* Base state for menu */
.vpcm-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    display: block; /* Default visible on desktop homepage */
}

/* --- LOGIC: Hide on other pages (Desktop) --- */
body:not(.home):not(.front-page) .vpcm-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

/* Hover to show on other pages (Desktop) */
body:not(.home):not(.front-page) .vertical-product-category-menu:hover .vpcm-menu {
    display: block;
    animation: vpcmSlideDown 0.3s ease;
}

@keyframes vpcmSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- LOGIC: Mobile & Tablet (All pages) --- */
@media (max-width: 1024px) {
    .vpcm-menu {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 999;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border: 1px solid #e0e0e0;
        border-top: none;
    }

    /* Show when toggled via JS */
    .vpcm-menu.vpcm-active {
        display: block !important;
    }

    .vpcm-header {
        cursor: pointer;
    }
}

/* Standard Styles */
.vpcm-header {
    background-color: #4CAF50;
    color: #ffffff;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 4px 4px 0 0;
}

.vpcm-icon {
    font-size: 20px;
}

.vpcm-title {
    flex: 1;
}

.vpcm-category-item {
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.vpcm-category-item:last-child {
    border-bottom: none;
}

.vpcm-category-item > a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #333333;
    transition: all 0.3s ease;
    gap: 10px;
}

.vpcm-category-item:hover > a {
    background-color: #f5f5f5;
    color: #4CAF50;
    padding-left: 25px;
}

.vpcm-cat-icon {
    font-size: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.vpcm-cat-name {
    flex: 1;
    font-weight: 500;
}

.vpcm-cat-count {
    font-size: 12px;
    color: #999999;
    margin-left: auto;
}

.vpcm-arrow {
    font-size: 18px;
    color: #cccccc;
    transition: transform 0.3s ease;
    margin-left: 5px;
}

.vpcm-category-item:hover .vpcm-arrow {
    transform: translateX(5px);
    color: #4CAF50;
}

/* Submenu Styles */
.vpcm-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: #fafafa;
    transition: opacity 0.3s ease;
}

.vertical-product-category-menu .vpcm-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 250px;
    max-width: 350px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    z-index: 1000;
    display: none;
    opacity: 0;
}

/* Hover mode - show on hover */
.vertical-product-category-menu[data-always-show="no"] .vpcm-category-item:hover > .vpcm-submenu {
    display: block;
    opacity: 1;
}

/* Always show products mode (Desktop only) */
@media (min-width: 1025px) {
    .vertical-product-category-menu[data-always-show="yes"] .vpcm-submenu {
        display: block;
        opacity: 1;
    }
}

/* Static positioning override (if needed) */
.vertical-product-category-menu[data-submenu-position="static"] .vpcm-submenu {
    position: static;
    box-shadow: none;
    border: none;
    border-top: 1px solid #eeeeee;
    min-width: auto;
    max-width: none;
    display: block;
    opacity: 1;
}

.vpcm-product-item {
    border-top: 1px solid #eeeeee;
}

.vpcm-product-item:first-child {
    border-top: none;
}

.vpcm-product-item a {
    display: block;
    padding: 10px 20px 10px 50px;
    text-decoration: none;
    color: #666666;
    font-size: 14px;
    transition: all 0.3s ease;
}

.vpcm-product-item:hover a {
    background-color: #f0f0f0;
    color: #4CAF50;
    padding-left: 55px;
}

/* Nested subcategories */
.vpcm-submenu-nested {
    background-color: #f5f5f5;
    border-left: 2px solid #4CAF50;
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    border-left: 2px solid #4CAF50 !important;
    margin-top: 0;
    display: block !important;
    opacity: 1 !important;
}

.vpcm-submenu-nested .vpcm-product-item a {
    padding-left: 60px;
    font-size: 13px;
}

/* Responsive adjustments for submenus */
@media (max-width: 1024px) {
    .vertical-product-category-menu .vpcm-submenu {
        position: static !important;
        min-width: 100%;
        max-width: 100%;
        display: none !important;
        box-shadow: none !important;
        border: none !important;
        border-top: 1px solid #eee !important;
    }
    
    .vpcm-category-item.mobile-active > .vpcm-submenu {
        display: block !important;
        opacity: 1 !important;
    }

    .vpcm-category-item.mobile-active > a .vpcm-arrow {
        transform: rotate(90deg);
    }
}
