/* ═══════════════════════════════════════════════════════════
   Filter Sidebar — Unified Styles
   Used by: products.blade.php, category-products.blade.php
   ═══════════════════════════════════════════════════════════ */

/* ── Ensure category-browser fixed button stays visible above the filter sidebar ── */
body:has(.filter-sidebar) .cb-toggle-btn {
    z-index: 1060 !important;
    pointer-events: auto !important;
}

/* ── Sidebar Container ─────────────────────────────────── */
.filter-sidebar {
    width: 280px;
    min-width: 280px;
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    box-shadow: none;
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: clip;
    transition: all 0.3s ease;
}

.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Header ────────────────────────────────────────────── */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.filter-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.filter-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-filters-btn {
    background: transparent;
    color: #2762f3;
    border: 1px solid #2762f3;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
}

.clear-filters-btn:hover {
    background: #2762f3;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(39, 98, 243, 0.2);
}

/* ── Section ───────────────────────────────────────────── */
.filter-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

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

.filter-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    outline: none;
}

.filter-section-title:focus {
    outline: none;
}

.filter-section-title i {
    display: none;
}

/* ── Hierarchical Category Navigation ──────────────────── */
.cat-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cat-nav-item {
    border-bottom: 1px solid #f1f5f9;
}

.cat-nav-item:last-child {
    border-bottom: none;
}

.cat-nav-row {
    display: flex;
    align-items: center;
}

.cat-nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #334155;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.cat-nav-link:hover {
    background: rgba(39, 98, 243, 0.05);
    color: #2762f3;
}

.cat-nav-link.is-current {
    color: #dc2626;
    font-weight: 700;
}

.cat-nav-link.is-current .cat-nav-icon {
    color: #dc2626;
}

.cat-nav-icon {
    width: 20px;
    text-align: center;
    font-size: 14px;
    color: #64748b;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.cat-nav-link:hover .cat-nav-icon {
    color: #2762f3;
}

.cat-nav-count {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    flex-shrink: 0;
}

.cat-nav-expand {
    background: none;
    border: none;
    padding: 10px 12px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cat-nav-expand:hover {
    color: #2762f3;
}

.cat-nav-chevron {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.cat-nav-expand.expanded .cat-nav-chevron {
    transform: rotate(90deg);
}

/* Children */
.cat-nav-children {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: none;
}

.cat-nav-children.open {
    display: block;
}

.cat-nav-child-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 36px;
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

[dir="rtl"] .cat-nav-child-link {
    padding: 8px 36px 8px 12px;
}

.cat-nav-child-link:hover {
    background: #eff6ff;
    color: #2762f3;
}

.cat-nav-child-link.is-current {
    color: #dc2626;
    font-weight: 700;
}

.cat-nav-child-link::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.cat-nav-child-link:hover::before {
    background: #2762f3;
}

.cat-nav-child-link.is-current::before {
    background: #dc2626;
}

/* Grandchildren */
.cat-nav-grandchild-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 56px;
    color: #64748b;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 400;
    transition: all 0.2s ease;
}

[dir="rtl"] .cat-nav-grandchild-link {
    padding: 6px 56px 6px 12px;
}

.cat-nav-grandchild-link:hover {
    background: #eff6ff;
    color: #2762f3;
}

.cat-nav-grandchild-link.is-current {
    color: #dc2626;
    font-weight: 600;
}

.cat-nav-grandchild-link::before {
    content: '–';
    color: #cbd5e1;
    flex-shrink: 0;
}

.cat-nav-more-btn {
    width: 100%;
    padding: 8px;
    background: transparent;
    color: #2762f3;
    border: 1px dashed rgba(39, 98, 243, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 4px;
    font-family: inherit;
}

.cat-nav-more-btn:hover {
    background: rgba(39, 98, 243, 0.05);
    border-color: #2762f3;
}

.cat-nav-more-btn i {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.cat-nav-more-btn.expanded i {
    transform: rotate(180deg);
}

/* ── Filter form layout (flex for section ordering) ─────── */
.filter-form-ordered {
    display: flex;
    flex-direction: column;
}

/* ── Checkbox / Radio Lists ────────────────────────────── */
.filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.filter-check-item:hover {
    background: rgba(39, 98, 243, 0.05);
}

.filter-check-item.disabled-item {
    opacity: 0.45;
    cursor: not-allowed;
}

.filter-check-item.disabled-item:hover {
    background: transparent;
}

.filter-check-item input[type="checkbox"],
.filter-check-item input[type="radio"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background-color: #fff;
    position: relative;
    transition: all 0.2s ease;
}

.filter-check-item input:checked {
    background-color: #2762f3;
    border-color: #2762f3;
}

.filter-check-item input:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-check-item input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.filter-check-item label {
    flex: 1;
    cursor: pointer;
    font-size: 0.88rem;
    color: #334155;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.filter-check-item input:checked+label {
    color: #2762f3;
    font-weight: 600;
}

.item-count {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    flex-shrink: 0;
}

.item-count.count-zero {
    color: #cbd5e1;
}

.filter-check-item input:checked+label .item-count {
    color: #2762f3;
}

/* Active filter section indicator */
.filter-section:has(input:checked),
.filter-accordion:has(input:checked) {
    border-inline-start: 3px solid #2762f3;
    padding-inline-start: 0.5rem;
    margin-inline-start: -0.5rem;
}

[dir="rtl"] .filter-section:has(input:checked),
[dir="rtl"] .filter-accordion:has(input:checked) {
    border-inline-start: none;
    border-inline-end: 3px solid #2762f3;
    padding-inline-end: 0.5rem;
    margin-inline-end: -0.5rem;
}

/* ── Accordion ─────────────────────────────────────────── */
.filter-accordion {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.filter-accordion:last-of-type {
    border-bottom: none;
}

.filter-accordion-button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0 0 0.5rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    font-family: inherit;
}

.filter-accordion-button:hover {
    background: transparent;
}

.filter-accordion-button[aria-expanded="true"] {
    background: transparent;
    border: none;
}

.filter-accordion-button:focus {
    outline: none;
}

.filter-accordion-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-accordion-header i {
    display: none;
}

.filter-accordion-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.filter-accordion-button[aria-expanded="true"] .filter-accordion-title {
    color: #1e293b;
}

.filter-accordion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #64748b;
    font-size: 0.7rem;
    min-width: 20px;
    transition: color 0.3s ease;
}

.filter-accordion-button[aria-expanded="true"] .filter-accordion-icon {
    background: transparent;
    color: #1e293b;
}

.filter-accordion-content {
    border: none;
    padding: 0 0.5rem 1rem 0.5rem;
    margin: 0;
    animation: fsSlideDown 0.3s ease-out;
}

@keyframes fsSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-accordion-content[hidden] {
    display: none;
}

/* ── View More Button ──────────────────────────────────── */
.view-more-btn {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    color: #2762f3;
    border: 1px solid rgba(39, 98, 243, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-family: inherit;
}

.view-more-btn:hover {
    background: rgba(39, 98, 243, 0.1);
    border-color: #2762f3;
}

.view-more-btn:focus {
    outline: 2px solid #2762f3;
    outline-offset: 2px;
}

.view-more-btn i {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.view-more-btn.expanded i {
    transform: rotate(180deg);
}

/* ── Brand Search ──────────────────────────────────────── */
.brand-search-wrapper {
    position: relative;
    margin-bottom: 0.75rem;
}

.brand-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    padding-right: 2rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    background: #fff;
    color: #1e293b;
}

.brand-search-input:focus {
    border-color: #2762f3;
}

[dir="rtl"] .brand-search-input {
    padding-right: 0.75rem;
    padding-left: 2rem;
}

.brand-search-wrapper i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0.75rem;
    color: #94a3b8;
    font-size: 0.8rem;
    pointer-events: none;
}

[dir="rtl"] .brand-search-wrapper i {
    right: auto;
    left: 0.75rem;
}

/* ── Price Range ───────────────────────────────────────── */
.price-input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
}

.price-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.price-input-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    transition: all 0.2s ease;
}

.price-input-group:focus-within {
    border-color: #2762f3;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(39, 98, 243, 0.1);
}

.price-currency {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

[dir="rtl"] .price-currency {
    margin-right: 0;
    margin-left: 0.4rem;
}

.price-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    padding: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.price-input-separator {
    font-size: 1.1rem;
    font-weight: 600;
    color: #94a3b8;
    padding-bottom: 0.4rem;
    flex-shrink: 0;
}

[dir="rtl"] .price-input-container {
    flex-direction: row-reverse;
}

/* ── Dual-Range Price Slider ───────────────────────────── */
.price-range-slider {
    margin: 0.75rem 0 0.5rem;
    padding: 0.5rem 0;
}

.dual-range-wrapper {
    position: relative;
    height: 8px;
    margin: 18px 0;
    direction: ltr !important;
}

.dual-range-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e2e8f0;
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.dual-range-highlight {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #2762f3 0%, #3b82f6 100%);
    border-radius: 8px;
    z-index: 1;
    pointer-events: none;
}

.dual-range-wrapper input[type="range"] {
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 28px;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 3;
    outline: none;
    direction: ltr !important;
}

.dual-range-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #2762f3;
    box-shadow: 0 2px 8px rgba(39, 98, 243, 0.3);
    cursor: grab;
    pointer-events: auto;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    z-index: 4;
}

.dual-range-wrapper input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 4px 12px rgba(39, 98, 243, 0.4), 0 0 0 4px rgba(39, 98, 243, 0.1);
    border-color: #1a4dbf;
}

.dual-range-wrapper input[type="range"]::-webkit-slider-thumb:active {
    cursor: grabbing;
}

.dual-range-wrapper input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #2762f3;
    box-shadow: 0 2px 8px rgba(39, 98, 243, 0.3);
    cursor: grab;
    pointer-events: auto;
}

.dual-range-wrapper input[type="range"]::-moz-range-track {
    background: transparent;
    border: none;
    height: 0;
}

.dual-range-wrapper input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* ── Sort / Per-Page Toolbar ───────────────────────────── */
.filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-toolbar-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.filter-toolbar-select {
    padding: 0.4rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    background: #f8fafc;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.filter-toolbar-select:focus {
    border-color: #2762f3;
    box-shadow: 0 0 0 3px rgba(39, 98, 243, 0.1);
}

.filter-toolbar-count {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.filter-toolbar-count strong {
    color: #1e293b;
    font-weight: 700;
}

/* ── Tag Filter Styles ─────────────────────────────────── */
.tag-label-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Mobile Filter Toggle ──────────────────────────────── */
.mobile-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filter-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.mobile-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ── Mobile Apply Button ───────────────────────────────── */
.mobile-apply-filters-wrapper {
    display: none;
}

/* ── Screen Reader Only ────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ── RTL Support ───────────────────────────────────────── */
[dir="rtl"] .filter-sidebar {
    text-align: right;
}

[dir="rtl"] .filter-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .filter-header-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .filter-section-title {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .filter-accordion-header {
    flex-direction: row;
}

[dir="rtl"] .filter-check-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .filter-check-item label {
    flex-direction: row;
    text-align: right;
}

[dir="rtl"] .filter-accordion-button {
    flex-direction: row;
    text-align: right;
}

[dir="rtl"] .cat-nav-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .cat-nav-link {
    flex-direction: row-reverse;
}

[dir="rtl"] .filter-toolbar {
    flex-direction: row-reverse;
}

[dir="rtl"] .filter-toolbar-group {
    flex-direction: row-reverse;
}

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
    .filter-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        width: 320px;
        max-width: 85vw;
        min-width: 280px;
        z-index: 1000;
        max-height: 100vh;
        border-radius: 0;
        padding: 1.5rem;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
        box-sizing: border-box;
        left: 0;
        right: auto;
        transform: translateX(-100%);
    }

    .filter-sidebar.active {
        transform: translateX(0);
    }

    .filter-sidebar[dir="rtl"] {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    .filter-sidebar[dir="rtl"].active {
        transform: translateX(0);
    }

    .mobile-close-btn {
        display: flex;
    }

    .filter-header {
        position: sticky;
        top: -1.5rem;
        background: #fff;
        z-index: 10;
        margin-top: -1.5rem;
        padding-top: 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .filter-sidebar[dir="rtl"] .filter-header {
        flex-direction: row-reverse;
    }

    .filter-sidebar[dir="rtl"] .filter-header-actions {
        flex-direction: row-reverse;
    }

    .filter-sidebar[dir="rtl"] .filter-section-title {
        flex-direction: row-reverse;
        justify-content: flex-start;
    }

    .filter-sidebar[dir="rtl"] .filter-accordion-button {
        flex-direction: row-reverse;
    }

    .filter-sidebar[dir="rtl"] .filter-accordion-header {
        flex-direction: row-reverse;
    }

    .filter-sidebar[dir="rtl"] .filter-check-item {
        flex-direction: row-reverse;
    }

    .filter-sidebar[dir="rtl"] .filter-check-item label {
        flex-direction: row-reverse;
        text-align: right;
    }

    .filter-sidebar[dir="rtl"] .price-input-container {
        flex-direction: row-reverse;
    }

    .filter-sidebar[dir="rtl"] .cat-nav-row {
        flex-direction: row-reverse;
    }

    .filter-sidebar[dir="rtl"] .cat-nav-link {
        flex-direction: row-reverse;
    }

    .mobile-apply-filters-wrapper {
        display: block;
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem 0 0;
        margin: 0 -1.5rem -1.5rem;
        background: linear-gradient(to top, #ffffff 70%, rgba(255, 255, 255, 0));
        z-index: 20;
    }

    .mobile-apply-filters-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.625rem;
        width: calc(100% - 2rem);
        margin: 0 auto 1rem;
        padding: 1rem 1.5rem;
        background: linear-gradient(135deg, #2762f3, #1a4dbf);
        color: #ffffff;
        border: none;
        border-radius: 14px;
        font-size: 1.05rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 15px rgba(39, 98, 243, 0.35);
        letter-spacing: 0.3px;
        font-family: inherit;
    }

    .mobile-apply-filters-btn:hover {
        background: linear-gradient(135deg, #1a4dbf, #153fa0);
        box-shadow: 0 6px 20px rgba(39, 98, 243, 0.45);
        transform: translateY(-1px);
    }

    #filterForm {
        padding-bottom: 1rem;
    }

    .filter-toolbar {
        padding: 0.625rem 0.75rem;
        gap: 0.5rem;
    }
}

/* Phone */
@media (max-width: 640px) {
    .filter-sidebar {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
    }

    .filter-header {
        margin-top: -1rem;
        padding-top: 1rem;
        top: -1rem;
    }

    .filter-header h3 {
        font-size: 1.25rem;
    }

    .clear-filters-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }

    .filter-accordion-button {
        padding: 0 0 0.5rem 0;
    }

    .filter-accordion-title {
        font-size: 0.95rem;
    }

    .filter-accordion-icon {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }

    .filter-check-item {
        padding: 0.4rem;
        border-radius: 6px;
    }

    .filter-check-item label {
        font-size: 0.85rem;
    }

    .filter-check-item input[type="checkbox"],
    .filter-check-item input[type="radio"] {
        width: 16px;
        height: 16px;
        min-width: 16px;
    }

    .item-count {
        font-size: 0.72rem;
    }

    .price-input-container {
        flex-direction: column;
        gap: 0.6rem;
    }

    .price-input-wrapper {
        width: 100%;
    }

    .price-input-separator {
        display: none;
    }

    [dir="rtl"] .price-input-container {
        flex-direction: column;
    }

    .mobile-apply-filters-wrapper {
        margin: 0 -1rem -1rem;
    }

    .mobile-apply-filters-btn {
        width: calc(100% - 1.5rem);
        padding: 0.9rem 1.25rem;
        font-size: 1rem;
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }

    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .filter-toolbar-group {
        justify-content: space-between;
    }
}

/* Small phone */
@media (max-width: 380px) {
    .filter-sidebar {
        padding: 0.875rem;
    }

    .filter-header h3 {
        font-size: 1.1rem;
    }

    .filter-accordion-button {
        padding: 0 0 0.4rem 0;
    }

    .filter-accordion-title {
        font-size: 0.9rem;
    }

    .filter-check-item label {
        font-size: 0.8rem;
    }

    .mobile-apply-filters-wrapper {
        margin: 0 -0.875rem -0.875rem;
    }

    .mobile-apply-filters-btn {
        width: calc(100% - 1.25rem);
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
        border-radius: 10px;
    }
}

/* Touch-friendly handles on mobile */
@media (max-width: 768px) {
    .dual-range-wrapper input[type="range"]::-webkit-slider-thumb {
        width: 30px;
        height: 30px;
    }

    .dual-range-wrapper input[type="range"]::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    .dual-range-wrapper input[type="range"] {
        top: -12px;
        height: 32px;
    }
}