/**
 * Mobile Menu Responsive Fixes
 * This file contains overrides and improvements for the mobile navigation drawer.
 */

/* 1. Global Drawer Foundation (Only visible when active, but classes are safe) */
.mobile-nav__wrapper {
    z-index: 9999;
    /* Ensure it's above everything */
}

/* Apply most fixes only on mobile screens */
@media (max-width: 991px) {
    .mobile-nav__content {
        width: 320px;
        /* Standard mobile drawer width */
        max-width: 85%;
        padding: 0;
        /* Remove default padding to handle sections better */
        display: flex;
        flex-direction: column;
        background-color: #fff;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
        text-align: left;
        /* Ensure left alignment */
    }

    /* 2. Logo Box & Close Button */
    .mobile-nav__content .logo-box {
        padding: 1.5rem;
        margin-bottom: 0;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .mobile-nav__content .logo-box a {
        display: flex;
        align-items: center;
        flex: 1;
    }

    .mobile-nav__content .logo-box img {
        height: 45px !important;
        /* Fixed height for consistency */
        width: auto !important;
        max-width: 180px;
        object-fit: contain;
        display: block;
    }

    .mobile-nav__close {
        position: static;
        /* Reset from absolute */
        font-size: 1.5rem;
        color: #333;
        transition: color 0.3s ease;
        padding: 0.5rem;
    }

    .mobile-nav__close:hover {
        color: #FF6C00;
    }

    /* 3. Navigation List */
    .mobile-nav__container {
        flex: 1;
        overflow-y: auto;
        padding: 1.5rem 0;
        border: none;
        /* Remove default borders */
    }

    .mobile-menu__list {
        list-style: none !important;
        /* Force remove bullets */
        padding: 0 !important;
        margin: 0 !important;
    }

    .mobile-menu__list li {
        list-style: none !important;
        position: relative;
    }

    .mobile-menu__list>li {
        border-bottom: 1px solid #f9f9f9;
    }

    .mobile-menu__list li a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        /* Text and icon at ends */
        flex-direction: row-reverse;
        /* Swap order: Text left, Icon right */
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        color: #1b2534;
        text-decoration: none;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-align: left;
    }

    .nav-icon {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s ease;
    }

    .mobile-menu__list li a:hover,
    .mobile-menu__list li.current>a,
    .mobile-menu__list li.expanded>a {
        color: #FF6C00;
        background-color: rgba(255, 108, 0, 0.05);
    }

    .nav-icon.rotated {
        transform: rotate(180deg);
    }

    /* Submenu Styles */
    .mobile-menu__list ul,
    .mobile-menu__list .sub-menu,
    .mobile-menu__list .pm-mega-menu {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background-color: #fcfcfc;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.4s ease-out;
        display: block !important;
        /* Override display: none */
        position: relative !important;
        /* Override position: absolute */
        top: 0 !important;
        width: 100% !important;
        opacity: 1 !important;
        /* Ensure visible */
        visibility: visible !important;
        /* Ensure visible */
        border: none !important;
        box-shadow: none !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    .mobile-menu__list .mobile-submenu-open,
    .mobile-menu__list .sub-menu.mobile-submenu-open,
    .pm-mega-menu.mobile-submenu-open,
    .mobile-submenu-open {
        max-height: 2500px !important;
        /* Increased for mega menus */
        padding-bottom: 1rem !important;
        visibility: visible !important;
        opacity: 1 !important;
        overflow: visible !important;
        /* Allow content to show */
    }

    .mobile-menu__list .sub-menu li a {
        padding: 0.6rem 1.5rem 0.6rem 2.5rem;
        font-size: 0.9rem;
        font-weight: 500;
        text-transform: none;
        justify-content: flex-start !important;
        flex-direction: row !important;
    }

    /* 4. Contact Info Section */
    .mobile-nav__contact {
        padding: 1.5rem;
        background-color: #f8f9fa;
        margin: 0 !important;
        border-top: 1px solid #eee;
    }

    .mobile-nav__contact li {
        list-style: none !important;
        margin-bottom: 1rem;
    }

    .mobile-nav__contact li:last-child {
        margin-bottom: 0;
    }

    .mobile-nav__contact li a {
        font-size: 0.9rem;
        font-weight: 500;
        color: #333;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        text-decoration: none;
    }

    .mobile-nav__contact li i {
        width: 32px;
        height: 32px;
        background-color: #FF6C00;
        color: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
    }

    /* 5. Social Links Section */
    .mobile-nav__top {
        padding: 1rem 1.5rem 2rem;
        background-color: #f8f9fa;
        margin-bottom: 0;
    }

    /* Mega Menu Inner Specifics for Mobile */
    .pm-mega-menu__inner {
        display: block !important;
        min-height: auto !important;
        padding: 1rem !important;
    }

    .pm-mega-menu__categories {
        border: none !important;
        padding: 0 !important;
    }

    .pm-mega-menu__cat-list {
        display: block !important;
    }

    .pm-mega-menu__cat-item a {
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem !important;
        border: none !important;
        text-transform: none !important;
        justify-content: flex-start !important;
        flex-direction: row !important;
    }

    /* Hide desktop-only panels on mobile if they don't work well */
    .pm-mega-menu__panel--lvl2 {
        display: none !important;
    }

    .mobile-nav__social {
        display: flex;
        gap: 1rem;
        justify-content: flex-start;
    }

    .mobile-nav__social a {
        width: 36px;
        height: 36px;
        background-color: #000094;
        color: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        text-decoration: none;
    }

    .mobile-nav__social a:hover {
        background-color: #FF6C00;
        transform: translateY(-3px);
    }

    /* 6. Body Lock */
    body.locked {
        overflow: hidden;
    }

    /* 7. Redundant/unconstrained logos */
    .mobile-nav__content>img,
    .mobile-nav__content>a>img:not(.logo-box img) {
        display: none !important;
    }

    /* Specific fix for the giant logo seen in screenshots */
    .mobile-nav__content .logo-box~img,
    .mobile-nav__content .logo-box~a img {
        max-width: 150px;
        height: auto;
        margin: 1rem auto;
        display: block;
    }

    .mobile-nav__container img {
        max-width: 100%;
        height: auto;
    }
}

/* Product Card Brand Logo */
.product__card--brand {
    display: flex;
    align-items: center;
}

.product__card--brand img {
    max-width: 100px;
    height: auto;
    filter: grayscale(0.5);
    opacity: 0.8;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.product__card:hover .product__card--brand img {
    filter: grayscale(0);
    opacity: 1;
}

/* Category Card Styling */
.categoryList__card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.categoryList__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.categoryList__card--img {
    margin: 0;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.categoryList__card--img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.categoryList__card:hover .categoryList__card--img img {
    transform: scale(1.05);
}

.categoryList__card--title {
    padding: 1.5rem;
    text-align: center;
}

.categoryList__card--title h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1b2534;
}