/* Shop All Button Styles */
.shop-all-btn {
    display: flex;
    align-items: center;
    background-color: transparent;
    /* Or match navbar color */
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-right: 15px;
    /* Spacing from pagination arrows if any */
}

.shop-all-btn:hover {
    color: #84C44C;
}

.shop-all-mobile-wrapper {
    padding: 0 15px;
    margin-bottom: 10px;
}

.shop-all-mobile-wrapper .shop-all-btn {
    width: 100%;
    justify-content: center;
    border-radius: 10px;
    color: #000000;
}


/* Show mobile Shop All button for screens 992px - 1200px */
@media (min-width: 992px) and (max-width: 1200px) {
    .shop-all-mobile-wrapper {
        display: block !important;
    }
}

/* Sidebar Overlay */
.shop-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    /* Below sidebar, above content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.shop-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Container */
.shop-sidebar {
    position: fixed;
    /* top: dynamic set by JS for desktop */
    left: -100%;
    /* Hidden by default */
    width: 300px;
    /* Width of parent list */
    background: #fff;
    z-index: 10005;
    /* High z-index */
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    /* Important: Overflow must be visible for sub-panel to show outside */
    overflow: visible;
}

@media (max-width: 991px) {
    .shop-sidebar {
        width: 85%;
        overflow: hidden;
        /* On mobile, we want overflow hidden/scroll internal */
        top: 0 !important;
        /* Force top 0 on mobile */
        height: 100vh !important;
        z-index: 10010;
        /* Above everything */
    }
}

/* Mobile: Full Screen, Top 0 */


/* Desktop: Below Navbar */
@media (min-width: 992px) {
    .shop-sidebar {
        top: 156px;
        /* Approximate height of header components */
        /* JS will calculate exact top if needed */
        width: 300px;
        height: calc(100vh - 156px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        z-index: 2000;
        /* Behind navbar dropdowns if any, but above page content */
    }

    /* When active, align to left edge or specific container logic */
    .shop-sidebar.active {
        left: 0;
    }
}

.shop-sidebar.active {
    left: 0;
}

/* Sidebar Header */
.shop-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    flex-shrink: 0;
}

.shop-sidebar-title {
    font-weight: 700;
    font-size: 18px;
    margin: 0;
}

.close-shop-sidebar {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

/* Sidebar Body Wrapper */
.shop-sidebar-body {
    min-height: 0;
    /* Critical for flex scrolling */
}

/* Parent List (Left Pane) */
.shop-sidebar-parents {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #eee;
    position: relative;
    z-index: 2;
    overscroll-behavior: contain;
}

/* Featured Categories Top Section (New) */
.sidebar-featured-top {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    background: #fafafa;
}

.sidebar-featured-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: #333;
}

.sidebar-featured-item:hover .sidebar-feat-img {
    transform: scale(1.1);
}

.sidebar-feat-img-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 5px;
    overflow: hidden;
}

.sidebar-feat-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    transition: transform 0.2s;
}

.sidebar-feat-text {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Parent Item Styles */
.shop-parent-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
}

.parent-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.parent-item-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
    background: #f0f0f0;
    padding: 2px;
}

.shop-parent-item:hover,
.shop-parent-item.active {
    background-color: #f0f4ff;
    color: #230b9e;
}

.shop-parent-item i {
    font-size: 12px;
    color: #999;
}

/* Sub-Menu Panel (Detailed View) */
.shop-sidebar-subs-panel {
    position: absolute;
    top: 0;
    left: 300px;
    /* Right of parent list */
    width: 600px;
    /* Wider for columns/grid */
    height: 100%;
    background: #fff;
    border-left: 1px solid #eee;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.05);
    display: none;
    /* Hidden by default */
    overflow-y: auto;
    padding: 20px;
    z-index: 1;
    /* Behind parent list visually if needed, but actually side-by-side */
    overscroll-behavior: contain;
    /* Prevent background scrolling */
}

/* Show on Parent Hover (Desktop) */
/* We will use JS to handle showing/hiding to keep it robust */
.shop-sidebar-subs-panel.active {
    display: block;
}

/* Feature Categories Section */
.feature-cats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.feature-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: transform 0.2s;
    background: #fafafa;
    text-decoration: none;
    color: #333;
}

.feature-cat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
}

.feature-cat-img-wrapper {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.feature-cat-img {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
}

.feature-cat-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

/* Sub-Category Lists */
.sub-cat-group {
    margin-bottom: 20px;
}

.sub-cat-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    color: #222;
}

.sub-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns for links */
    gap: 8px 15px;
}

.sub-cat-link {
    font-size: 13px;
    color: #555;
    text-decoration: none;
    display: block;
    padding: 2px 0;
}

.sub-cat-link:hover {
    color: #230b9e;
    text-decoration: underline;
}

/* =========================================
   Mobile / Tablet Media Queries
   ========================================= */
@media (max-width: 991px) {
    .shop-sidebar {
        width: 85%;
        overflow: hidden;
        /* On mobile, we want overflow hidden/scroll internal */
        top: 0 !important;
        /* Force top 0 on mobile */
        height: 100vh !important;
        z-index: 10010;
        /* Above everything */
    }

    .shop-sidebar-subs-panel {
        position: absolute;
        top: 0;
        left: 0;
        /* Overlap parent list */
        width: 100%;
        height: 100%;
        z-index: 10;
        transform: translateX(100%);
        /* Slide out to right initially */
        transition: transform 0.3s ease;
        display: block !important;
        /* Always "display:block" but hidden via transform */
        opacity: 0;
        pointer-events: none;
    }

    .shop-sidebar-subs-panel.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* Back Button in Sub Panel (Mobile Only) */
    .mobile-sub-header {
        display: flex;
        align-items: center;
        padding-bottom: 15px;
        margin-bottom: 15px;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        color: #230b9e;
        font-weight: 600;
    }

    .mobile-sub-header i {
        margin-right: 10px;
    }

    .sub-cat-list {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    .feature-cats-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Keep 2 cols for features */
    }
}