/* ============================================================
   1. MAIN GRID LAYOUT (DESKTOP)
   ============================================================ */
.custom-shop-grid-layout {
    display: grid;
    grid-template-columns: 280px 1fr; /* Sidebar is 280px, Products take rest */
    gap: 40px;
    align-items: start;
    margin-top: 30px;
}

/* Container for products */
#ajax-product-container {
    min-height: 400px;
    transition: opacity 0.3s ease;
}

#ajax-product-container.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================================
   2. FILTER GROUP STYLING
   ============================================================ */
.filter-group {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.filter-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    color: #333;
}

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

.filter-list li {
    margin-bottom: 8px;
}

.filter-list label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: color 0.2s;
}

.filter-list label:hover {
    color: #000;
}

.filter-list .count {
    margin-left: auto;
    font-size: 12px;
    color: #999;
}

/* ============================================================
   3. CUSTOM CHECKBOX STYLING
   ============================================================ */
.checkbox-style input[type="checkbox"] {
    display: none;
}

.custom-box {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    margin-right: 10px;
    display: inline-block;
    position: relative;
    border-radius: 3px;
    transition: all 0.2s;
}

.checkbox-style input[type="checkbox"]:checked + .custom-box {
    background-color: #000;
    border-color: #000;
}

.checkbox-style input[type="checkbox"]:checked + .custom-box:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ============================================================
   4. PRICE SLIDER UI
   ============================================================ */
.price-slider-container {
    position: relative;
    height: 30px;
    margin-top: 10px;
}

.slider-track {
    width: 100%;
    height: 5px;
    background: #ddd;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 5px;
}

.slider-progress {
    height: 5px;
    background: #000;
    position: absolute;
    left: 0;
    right: 0;
    border-radius: 5px;
}

.range-inputs {
    position: relative;
}

.range-inputs input {
    position: absolute;
    width: 100%;
    height: 5px;
    top: 12px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #000;
    pointer-events: auto;
    -webkit-appearance: none;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.price-display {
    margin-top: 15px;
    font-size: 14px;
}

/* ============================================================
   5. STAR RATING WIDGET
   ============================================================ */
.star-rating-widget {
    display: flex;
    gap: 5px;
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    margin-bottom: 5px;
}

.star-item.active {
    color: #ffc107;
}

.rating-label-text {
    font-size: 13px;
    color: #888;
    font-style: italic;
}

/* ============================================================
   6. MOBILE RESPONSIVE DRAWER (< 992px)
   ============================================================ */
/* Hide Mobile elements on Desktop */
#mobile-filter-trigger, 
.drawer-header, 
.apply-filters-mobile-only {
    display: none;
}

@media screen and (max-width: 991px) {
    /* Stack the grid */
    .custom-shop-grid-layout {
        grid-template-columns: 1fr;
    }

    /* Show the Mobile Trigger Button */
    #mobile-filter-trigger {
        display: block;
        width: 100%;
        padding: 15px;
        background: #000;
        color: #fff;
        border: none;
        margin-bottom: 25px;
        font-weight: 700;
        letter-spacing: 1px;
        cursor: pointer;
        border-radius: 4px;
    }

    /* Transform Sidebar into a Slide-out Drawer */
    .custom-shop-sidebar-column {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%; /* Full screen width */
        height: 100%;
        background: #fff;
        z-index: 999999;
        padding: 25px;
        overflow-y: auto; /* Allow scrolling within the filters */
        transform: translateX(-100%); /* Start off-screen */
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* Active state to slide in */
    .custom-shop-sidebar-column.active {
        transform: translateX(0);
    }

    /* Drawer Header (Title + Close X) */
    .drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 25px;
        padding-bottom: 15px;
        border-bottom: 2px solid #333;
    }

    .drawer-header h3 {
        margin: 0;
        font-size: 22px;
        font-weight: 800;
    }

    .close-drawer {
        background: none;
        border: none;
        font-size: 40px;
        font-weight: 300;
        line-height: 1;
        cursor: pointer;
        color: #000;
    }

    /* Mobile Apply Button */
    .apply-filters-mobile-only {
        display: block;
        width: 100%;
        background: #27ae60;
        color: #fff;
        padding: 16px;
        border: none;
        margin-top: 20px;
        font-weight: 700;
        text-transform: uppercase;
        border-radius: 4px;
    }

    /* Prevent background from scrolling when drawer is open */
    body.filter-open {
        overflow: hidden;
    }
}

/* ============================================================
   7. MISC UTILS
   ============================================================ */
.custom-dropdown {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.clear-filters-btn {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: #d9534f;
}