/* ═══════════════════════════════════════ */
/* Category Mobile-First Optimization      */
/* ═══════════════════════════════════════ */

@media (max-width: 991px) {

    .mobile-filter-bar {
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(13, 22, 36, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 12px 0;
        margin-bottom: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        display: flex;
        gap: 8px;
    }

    .mobile-filter-btn {
        flex: 1;
        background: rgba(16, 185, 129, 0.1);
        border: 1px solid rgba(16, 185, 129, 0.25);
        color: #10b981;
        padding: 11px 14px;
        border-radius: 12px;
        font-size: 13px;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-filter-btn:active {
        transform: scale(0.97);
        background: rgba(16, 185, 129, 0.2);
    }

    .mobile-filter-btn .badge {
        background: #10b981;
        color: white;
        padding: 2px 7px;
        border-radius: 10px;
        font-size: 11px;
        font-weight: 800;
    }

    .desktop-only-sidebar {
        display: none !important;
    }

    .category-products-wrapper {
        width: 100% !important;
    }
}

/* Bottom Sheet */
.filter-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #1a2640, #111c2d);
    border-radius: 24px 24px 0 0;
    padding: 8px 20px 30px;
    z-index: 9999;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-sheet.active { transform: translateY(0); }

.filter-sheet-handle {
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    margin: 8px auto 16px;
}

.filter-sheet-title {
    color: white;
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 16px;
    text-align: center;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 8px;
    color: white;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.filter-option:hover,
.filter-option.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.filter-option .check {
    margin-right: auto;
    color: #10b981;
    opacity: 0;
}

.filter-option.active .check { opacity: 1; }

.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.filter-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 992px) {
    .mobile-filter-bar { display: none !important; }
}

@media (max-width: 768px) {
    .products-wrapper .product-card {
        width: 150px;
        flex: 0 0 150px;
    }
}

/* ═══════════════════════════════════════ */
/* Advanced Filter Components              */
/* ═══════════════════════════════════════ */

/* ── Active filter pills ──────────────────────────────────────────── */
.cat-active-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 4px 0;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(37, 186, 132, 0.15);
    border: 1px solid rgba(37, 186, 132, 0.35);
    color: #25ba84;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.cat-pill-clear {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s;
}

.cat-pill-clear:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ── Filter badge on mobile button ─────────────────────────────────── */
.cat-filter-badge {
    background: #25ba84;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.4;
}

/* ── Dual range price slider ──────────────────────────────────────── */
.cat-price-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    direction: ltr;
}

.cat-price-display .price-val {
    background: rgba(37, 186, 132, 0.12);
    border: 1px solid rgba(37, 186, 132, 0.25);
    border-radius: 8px;
    padding: 4px 12px;
    min-width: 60px;
    text-align: center;
    color: #25ba84;
}

.cat-price-display .price-sep {
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
}

.cat-price-range-wrap {
    position: relative;
    height: 36px;
    direction: ltr;
}

.cat-slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    transform: translateY(-50%);
    z-index: 0;
}

.cat-slider-fill {
    position: absolute;
    top: 50%;
    height: 5px;
    background: linear-gradient(90deg, #25ba84, #1ea870);
    border-radius: 3px;
    transform: translateY(-50%);
    z-index: 1;
    left: 0%;
    right: 0%;
}

.cat-range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 36px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    outline: none;
    margin: 0;
    padding: 0;
    z-index: 2;
}

.cat-range::-webkit-slider-runnable-track {
    background: transparent;
    height: 5px;
}

.cat-range::-moz-range-track {
    background: transparent;
    height: 5px;
    border: none;
}

.cat-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #25ba84;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    margin-top: -8.5px;
    transition: transform 0.15s;
}

.cat-range:active::-webkit-slider-thumb {
    transform: scale(1.15);
}

.cat-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #25ba84;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.cat-price-apply-btn {
    width: 100%;
    background: rgba(37, 186, 132, 0.15);
    border: 1px solid rgba(37, 186, 132, 0.3);
    color: #25ba84;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.cat-price-apply-btn:hover {
    background: rgba(37, 186, 132, 0.25);
}

/* ── Toggle switch ────────────────────────────────────────────────── */
.cat-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cat-toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.cat-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.cat-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cat-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: background 0.25s;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.cat-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    top: 2px;
    left: 2px;
    transition: transform 0.25s, background 0.25s;
}

.cat-toggle input:checked + .cat-toggle-slider {
    background: rgba(37, 186, 132, 0.3);
    border-color: #25ba84;
}

.cat-toggle input:checked + .cat-toggle-slider::before {
    transform: translateX(18px);
    background: #25ba84;
}

/* ── Rating filter ────────────────────────────────────────────────── */
.cat-rating-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-rating-opt {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.2s;
}

.cat-rating-opt input { display: none; }

.cat-rating-opt.active,
.cat-rating-opt:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

/* ── Sheet sections ───────────────────────────────────────────────── */
.cat-sheet-scroll {
    padding-bottom: 80px;
}

.cat-sheet-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cat-sheet-section:last-of-type {
    border-bottom: none;
}

.cat-sheet-section-title {
    font-size: 12px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 10px;
}

/* ── Sheet radio labels ───────────────────────────────────────────── */
.cat-sheet-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-sheet-radio-label input { display: none; }

.cat-sheet-radio-label.active,
.cat-sheet-radio-label:hover {
    background: rgba(37, 186, 132, 0.1);
    border-color: rgba(37, 186, 132, 0.3);
    color: #25ba84;
}

.cat-radio-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    transition: all 0.2s;
}

.cat-sheet-radio-label.active .cat-radio-dot {
    border-color: #25ba84;
    background: #25ba84;
    box-shadow: 0 0 0 3px rgba(37, 186, 132, 0.2);
}

/* ── Sheet footer buttons ─────────────────────────────────────────── */
.filter-sheet-footer {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, #111c2d 80%, transparent);
    padding: 16px 0 4px;
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.cat-sheet-reset {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.cat-sheet-reset:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.cat-sheet-apply {
    flex: 2;
    padding: 12px;
    border-radius: 12px;
    background: #25ba84;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.cat-sheet-apply:hover {
    background: #1ea870;
}

/* ── noUiSlider custom theme ─────────────────────────────────────────── */
.noUi-target {
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    box-shadow: none !important;
    height: 6px !important;
}
.noUi-connect {
    background: linear-gradient(90deg, #10b981, #059669) !important;
}
.noUi-handle {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: white !important;
    border: 3px solid #10b981 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4) !important;
    cursor: pointer !important;
    top: -8px !important;
    right: -11px !important;
}
.noUi-handle::before,
.noUi-handle::after {
    display: none !important;
}
