.filter-sidebar-col {
    margin-bottom: 20px;
}

.filter-sidebar {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
}

/* ---- Tabs header ---- */
.filter-tabs {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 14px;
    border-bottom: 1px solid #eee;
}

.filter-tab {
    display: inline-block;
    padding: 12px 2px;
    font-family: titleFont;
    font-size: 14px;
    color: #888;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.filter-tab.is-active {
    color: #222;
    border-bottom-color: #df2121;
}

a.filter-tab-clear:hover,
a.filter-tab-clear:focus {
    color: #df2121;
    text-decoration: none;
}

.filter-sidebar-close {
    display: none;
    margin-left: auto;
    background: transparent;
    border: 0;
    color: #888;
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
    outline: none;
}

/* ---- Body / sections ---- */
.filter-sidebar-body {
    padding: 4px 14px;
}

.filter-section {
    border-bottom: 1px solid #efefef;
}

.filter-section:last-child {
    border-bottom: 0;
}

.filter-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    cursor: pointer;
    user-select: none;
}

.filter-section-title {
    font-family: titleFont;
    font-size: 14px;
    color: #222;
}

.filter-section-caret {
    color: #aaa;
    font-size: 13px;
    transition: transform 0.2s ease;
}

.filter-section.is-open .filter-section-caret {
    transform: rotate(180deg);
}

.filter-section-body {
    display: none;
    padding: 0 0 14px;
}

.filter-section.is-open .filter-section-body {
    display: block;
}

/* ---- Section count badge ---- */
.filter-count-badge {
    display: inline-block;
    min-width: 18px;
    padding: 0 6px;
    margin-left: 6px;
    background: #df2121;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    font-family: arial, sans-serif;
    font-weight: bold;
    vertical-align: middle;
}

.filter-count-badge[hidden] {
    display: none;
}

/* ---- In-section search ---- */
.filter-search {
    position: relative;
    margin-bottom: 8px;
}

.filter-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #b0b0b0;
    font-size: 12px;
    pointer-events: none;
}

.filter-search-input {
    width: 100%;
    height: 32px;
    padding: 0 10px 0 30px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    background: #fafafa;
    font-size: 12px;
    color: #333;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.filter-search-input:focus {
    border-color: #df2121;
    background: #fff;
}

/* ---- Checkbox lists ---- */
.filter-check-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-check-list.is-scroll {
    max-height: 244px;
    overflow-y: auto;
    margin-right: -4px;
    padding-right: 4px;
}

.filter-check-list.is-scroll::-webkit-scrollbar {
    width: 6px;
}

.filter-check-list.is-scroll::-webkit-scrollbar-thumb {
    background: #d6d6d6;
    border-radius: 3px;
}

.filter-check-list.is-scroll::-webkit-scrollbar-thumb:hover {
    background: #bcbcbc;
}

.filter-check-item {
    margin: 0;
}

.filter-check-item.is-hidden {
    display: none;
}

.filter-check-item label {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 6px 8px;
    border-radius: 5px;
    font-weight: normal;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.12s ease;
}

.filter-check-item label:hover {
    background: #fbf2f2;
}

.filter-check-item label:hover .filter-check-text {
    color: #df2121;
}

/* custom checkbox */
.filter-check-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-check-box {
    position: relative;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    border: 1.5px solid #cfcfcf;
    border-radius: 4px;
    background: #fff;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.filter-check-item input[type="checkbox"]:checked + .filter-check-box {
    background: #df2121;
    border-color: #df2121;
}

.filter-check-item input[type="checkbox"]:checked + .filter-check-box::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-check-item input[type="checkbox"]:focus + .filter-check-box {
    box-shadow: 0 0 0 3px rgba(223, 33, 33, 0.15);
}

.filter-check-text {
    flex: 1 1 auto;
    line-height: 1.3;
}

.filter-no-results {
    list-style: none;
    padding: 12px 2px;
    color: #999;
    font-size: 12px;
    text-align: center;
}

/* ---- Native select fallback ---- */
.filter-native-select {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    height: 36px;
    outline: none;
}

.filter-native-select:focus {
    border-color: #df2121;
}

/* ---- Price slider ---- */
.price-slider {
    position: relative;
    height: 32px;
    margin-top: 4px;
}

.price-slider-rail {
    position: absolute;
    top: 14px;
    left: 6px;
    right: 6px;
    height: 4px;
    background: #e2e2e2;
    border-radius: 2px;
}

.price-slider-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: #df2121;
    border-radius: 2px;
}

.price-range {
    position: absolute;
    top: 6px;
    left: 0;
    width: 100%;
    height: 20px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.price-range:focus {
    outline: none;
}

.price-range::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    background: transparent;
    height: 20px;
}

.price-range::-moz-range-track {
    background: transparent;
    height: 20px;
}

.price-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #df2121;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    margin-top: 1px;
}

.price-range::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #df2121;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.price-values {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.price-val {
    font-size: 12px;
    color: #444;
}

/* ---- Toggle switch ---- */
.filter-section-toggle {
    padding: 12px 0;
}

.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.filter-toggle-text {
    font-family: titleFont;
    font-size: 14px;
    color: #222;
}

.filter-toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex: 0 0 auto;
}

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

.filter-toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 22px;
    transition: background 0.2s ease;
}

.filter-toggle-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.filter-toggle-switch input:checked + .filter-toggle-slider {
    background: #df2121;
}

.filter-toggle-switch input:checked + .filter-toggle-slider::before {
    transform: translateX(20px);
}

/* ---- Apply button ---- */
.filter-actions {
    padding: 12px 14px;
    border-top: 1px solid #eee;
}

.btn-filter-apply {
    width: 100%;
    background: #df2121;
    border: 1px solid #df2121;
    color: #fff;
    padding: 9px 10px;
    border-radius: 8px;
    font-family: titleFont;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    cursor: pointer;
    outline: none;
}

.btn-filter-apply:hover,
.btn-filter-apply:focus {
    background: #a30d0d;
    border-color: #a30d0d;
    color: #fff;
}

/* ---- Mobile drawer ---- */
.filter-mobile-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: #df2121;
    color: #fff;
    border: 1px solid #df2121;
    border-radius: 8px;
    font-family: titleFont;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    cursor: pointer;
    outline: none;
    text-align: center;
    justify-content: center;
}

.filter-mobile-toggle:hover,
.filter-mobile-toggle:focus {
    background: #a30d0d;
    border-color: #a30d0d;
    color: #fff;
}

.filter-mobile-toggle .filter-mobile-toggle-count {
    background: #fff;
    color: #df2121;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 11px;
    line-height: 1.4;
    font-family: arial, sans-serif;
}

.filter-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.filter-sidebar-overlay.is-open {
    display: block;
}

@media screen and (max-width: 912px) {
    .filter-mobile-toggle {
        display: flex;
    }

    .filter-sidebar-col {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 340px;
        margin: 0;
        padding: 0;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #fff;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    }

    .filter-sidebar-col.is-open {
        transform: translateX(0);
    }

    .filter-sidebar-col .filter-sidebar {
        border: 0;
        border-radius: 0;
        min-height: 100%;
    }

    .filter-sidebar-close {
        display: inline-block;
    }

    body.filter-sidebar-locked {
        overflow: hidden;
    }
}

/* ---- Sort toolbar ---- */
.sort-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #f7f7f7;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
}

.sort-toolbar-label {
    margin: 0;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}

.sort-toolbar-select {
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: #333;
    min-width: 180px;
    max-width: 100%;
}

.sort-toolbar-select:focus {
    outline: none;
    border-color: #999;
}

@media (max-width: 480px) {
    .sort-toolbar {
        justify-content: space-between;
    }

    .sort-toolbar-select {
        min-width: 0;
        flex: 1;
    }
}

/* ---- Results count ---- */
.results-count {
    padding: 10px 14px;
    margin-bottom: 12px;
    background: #f5f5f5;
    border-left: 3px solid #df2121;
    border-radius: 10px;
    font-size: 13px;
    color: #444;
}

.results-count strong {
    color: #222;
}

.results-count .fa {
    margin-right: 4px;
    color: #df2121;
}
