/* ========================================
   MOBILE OFFCANVAS MENU IMPROVEMENTS
   Modern, clean design with smooth animations
   ======================================== */

/* Mobile Menu Container */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: #ffffff;
    z-index: 99999;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
}

.mobile-menu.active {
    left: 0;
}

/* Mobile Menu Header/Logo */
.mobile-menu-logo {
    padding: 20px;
    background: linear-gradient(135deg, #690BBA 0%, #1B0954 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-logo .logo-image img {
    max-height: 70px;
    width: auto;
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-close i {
    color: #ffffff;
    font-size: 20px;
}

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

/* Navigation List */
.mobile-menu .first-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Parent Category */
.mobile-menu .parent-category {
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.mobile-menu .parent-subcategory {
    position: relative;
}

.mobile-menu .parent-category > a.menu-category-name {
    display: flex;
    align-items: center;
    padding: 15px 55px 15px 20px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-menu .parent-category:hover > a.menu-category-name {
    background: rgba(105, 11, 186, 0.05);
    color: #690BBA;
}

/* Category Image */
.mobile-menu .side_cat_img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
    border: 1px solid #e0e0e0;
}

/* Toggle Arrow */
.menu-category-toggle,
.menu-subcategory-toggle {
    position: absolute;
    right: 20px;
    top: 15px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(105, 11, 186, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.menu-category-toggle i,
.menu-subcategory-toggle i {
    color: #690BBA;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.menu-category-toggle:hover,
.menu-subcategory-toggle:hover {
    background: rgba(105, 11, 186, 0.2);
}

.menu-category-toggle.active,
.menu-subcategory-toggle.active {
    top: 15px !important;
    right: 20px !important;
}

.menu-category-toggle.active i,
.menu-subcategory-toggle.active i {
    transform: rotate(180deg);
}

/* Second Level Navigation (Subcategories) */
.mobile-menu .second-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f8f9fa;
}

.mobile-menu .second-nav .parent-subcategory {
    border-bottom: 1px solid #e8ecef;
    position: relative;
}

.mobile-menu .second-nav .parent-subcategory:last-child {
    border-bottom: none;
}

.mobile-menu .second-nav .menu-subcategory-name {
    display: block;
    padding: 12px 55px 12px 50px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-menu .second-nav .parent-subcategory:hover > .menu-subcategory-name {
    background: rgba(105, 11, 186, 0.08);
    color: #690BBA;
    padding-left: 52px;
}

/* Third Level Navigation (Child Categories) */
.mobile-menu .third-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #ffffff;
}

.mobile-menu .third-nav .childcategory {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu .third-nav .childcategory:last-child {
    border-bottom: none;
}

.mobile-menu .third-nav .menu-childcategory-name {
    display: block;
    padding: 10px 20px 10px 70px;
    color: #6c757d;
    font-weight: 400;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-menu .third-nav .menu-childcategory-name::before {
    content: "•";
    position: absolute;
    left: 55px;
    color: #690BBA;
    font-size: 18px;
}

.mobile-menu .third-nav .childcategory:hover .menu-childcategory-name {
    background: rgba(105, 11, 186, 0.05);
    color: #690BBA;
    padding-left: 75px;
}

/* Scrollbar Styling */
.mobile-menu::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mobile-menu::-webkit-scrollbar-thumb {
    background: #690BBA;
    border-radius: 3px;
}

.mobile-menu::-webkit-scrollbar-thumb:hover {
    background: #550A95;
}

/* Animation for menu items */
.mobile-menu.active .parent-category {
    animation: slideInLeft 0.4s ease-out;
    animation-fill-mode: both;
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Overlay */
#page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    display: none;
    backdrop-filter: blur(2px);
}

/* Menu Toggle Icon Animation */
.toggle {
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle:hover {
    transform: scale(1.1);
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .mobile-menu {
        width: 280px;
        left: -280px;
    }

    .mobile-menu-logo {
        padding: 15px;
    }

    .mobile-menu-logo .logo-image img {
        max-height: 35px;
    }

    .mobile-menu .parent-category > a.menu-category-name {
        padding: 12px 50px 12px 15px;
        font-size: 14px;
    }

    .mobile-menu .side_cat_img {
        width: 28px;
        height: 28px;
        margin-right: 10px;
    }

    .menu-category-toggle,
    .menu-subcategory-toggle {
        right: 15px;
        width: 28px;
        height: 28px;
    }
}
