/* Vertical Multilevel Mega Menu */

/* Overlay */
.mega-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

.mega-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Main Menu Container */
.mega-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    max-width: 1400px;
    height: 100%;
    background: #fff;
    box-shadow: 2px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
}

.mega-menu.show {
    left: 0;
}

/* Left Panel - Categories */
.mega-menu-left {
    width: 280px;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
}

/* Right Panel - Subcategories */
.mega-menu-right {
    flex: 1;
    background: #fff;
    overflow-y: auto;
    padding: 30px;
    display: none;
    flex-direction: row;
    gap: 30px;
}

.mega-menu-right.active {
    display: flex;
}

/* Submenu Content Wrapper */
.submenu-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Menu Header */
.mega-menu-header {
    background: linear-gradient(135deg, #0e9b00 0%, #0fc800 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mega-menu-header h3 {
    font-family: 'Baloo 2', sans-serif;
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mega-menu-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 20px;
}

.mega-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Root Categories List */
#vertical-multilevel-menu {
    list-style: none;
    margin: 0;
    padding: 15px 0;
}

.root-item {
    border-bottom: 1px solid #e9ecef;
}

.root-item-link {
    font-family: 'Baloo 2', sans-serif;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: #272727;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.root-item:hover .root-item-link,
.root-item.active .root-item-link {
    background: linear-gradient(90deg, rgba(14, 155, 0, 0.1) 0%, transparent 100%);
    color: #0e9b00;
    padding-left: 25px;
}

.parent-item_img {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    background: #fff;
    border-radius: 10px;
    padding: 6px;
    transition: all 0.3s;
}

.root-item:hover .parent-item_img,
.root-item.active .parent-item_img {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(14, 155, 0, 0.15);
}

.parent-item_img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Submenu Content */
.root-item-menu {
    padding: 0;
}

.submenu-header {
    font-family: 'Baloo 2', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #0e9b00;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #0e9b00;
    display: flex;
    align-items: center;
    gap: 10px;
}

.submenu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    flex: 1;
}

.parent {
    margin-bottom: 30px;
}

.parent-link {
    font-family: 'Baloo 2', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #272727;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0e9b00;
    display: flex;
    align-items: center;
}

.parent-link::before {
    content: '';
    width: 4px;
    height: 16px;
    background: #0e9b00;
    margin-right: 8px;
    border-radius: 2px;
}

.parent ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.parent ul li {
    margin: 8px 0;
}

.parent ul li a {
    font-family: 'Baloo 2', sans-serif;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    padding: 4px 0;
}

.parent ul li a::before {
    content: '›';
    color: #0e9b00;
    font-size: 18px;
    margin-right: 6px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s;
}

.parent ul li a:hover {
    color: #0e9b00;
    padding-left: 8px;
}

.parent ul li a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Banner in submenu */
.wrapper_menu_banner {
    flex-shrink: 0;
    width: 350px;
    height: auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(14, 155, 0, 0.15);
    transition: all 0.3s;
    align-self: flex-start;
}

.wrapper_menu_banner:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(14, 155, 0, 0.25);
}

.link_wrapper_banner {
    display: block;
}

.wrapper_menu_banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* Mobile Hide/Show */
.desktop_hide {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile_hide {
        display: none !important;
    }

    .desktop_hide {
        display: block !important;
    }

    .mega-menu {
        max-width: 100%;
    }

    .mega-menu-left {
        width: 100%;
    }

    .mega-menu-right {
        position: absolute;
        left: 0;
        width: 100%;
        height: 100%;
        background: #fff;
        z-index: 10;
        transform: translateX(100%);
        transition: transform 0.3s;
    }

    .mega-menu-right.active {
        transform: translateX(0);
    }

    .submenu-grid {
        grid-template-columns: 1fr;
    }

    .wrapper_menu_banner {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        margin-top: 20px;
    }
}

/* Scrollbar Styles */
.mega-menu-left::-webkit-scrollbar,
.mega-menu-right::-webkit-scrollbar {
    width: 6px;
}

.mega-menu-left::-webkit-scrollbar-track,
.mega-menu-right::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mega-menu-left::-webkit-scrollbar-thumb,
.mega-menu-right::-webkit-scrollbar-thumb {
    background: #0e9b00;
    border-radius: 3px;
}

.mega-menu-left::-webkit-scrollbar-thumb:hover,
.mega-menu-right::-webkit-scrollbar-thumb:hover {
    background: #0a7500;
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mega-menu-right.active .parent {
    animation: slideIn 0.4s ease forwards;
}

.mega-menu-right.active .parent:nth-child(1) { animation-delay: 0.05s; }
.mega-menu-right.active .parent:nth-child(2) { animation-delay: 0.1s; }
.mega-menu-right.active .parent:nth-child(3) { animation-delay: 0.15s; }
.mega-menu-right.active .parent:nth-child(4) { animation-delay: 0.2s; }
.mega-menu-right.active .parent:nth-child(5) { animation-delay: 0.25s; }
