/* ==================================================
   TIRE & WHEEL FILTER SIDEBAR
   Uses the theme tokens from css/style.css
================================================== */

.fst-shop-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    padding-top: 30px;
}

.fst-shop-layout .fst-shop-toolbar {
    margin-top: 0;
}

.fst-shop-layout .prod-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (min-width: 1500px) {
    .fst-shop-layout .prod-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ---------- Panel ---------- */

/* No inner scroll: the Apply button sticks to the bottom of the screen instead. */
.fst-filter-panel {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    scrollbar-width: thin;
}

.fst-facets {
    padding: 4px 20px 20px;
}

.fst-facets.is-loading {
    opacity: .6;
    pointer-events: none;
}

.fst-facets-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 -20px;
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.fst-facets-head h2 {
    margin: 0;
    font-family: var(--head);
    font-size: 24px;
    font-style: italic;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--ink);
}

.fst-facets-clear {
    margin-left: auto;
    color: var(--red);
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fst-facets-close {
    display: none;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f1f2f4;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

/* ---------- One filter ---------- */

.fst-facet {
    margin: 0;
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    min-width: 0;
}

.fst-facet:last-of-type {
    border-bottom: 0;
}

.fst-facet legend {
    float: left;
    width: 100%;
    margin: 0 0 10px;
    padding: 0;
    font-family: var(--head);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--ink);
}

.fst-facet legend small {
    color: var(--grey);
    font-family: var(--body);
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
}

.fst-facet.is-active legend::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--red);
    vertical-align: middle;
}

.fst-facet > *:not(legend) {
    clear: both;
}

.fst-facet-search {
    width: 100%;
    height: 38px;
    margin: 0 0 8px;
    padding: 0 12px;
    border: 1px solid #ccd5e2;
    border-radius: 8px;
    background: #fff;
    font-family: var(--body);
    font-size: 14px;
    box-sizing: border-box;
}

.fst-facet-search:focus,
.fst-select select:focus,
.fst-range-fields select:focus {
    outline: 2px solid rgba(227, 22, 28, .25);
    border-color: var(--red);
}

.fst-facet-options.is-scroll-legacy {
    max-height: 238px;
    overflow-y: auto;
    margin-right: -8px;
    padding-right: 8px;
    scrollbar-width: thin;
}

.fst-check {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    color: var(--charcoal);
    font-size: 14.5px;
    line-height: 1.3;
    cursor: pointer;
}

.fst-check[hidden] {
    display: none;
}

.fst-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--red);
    cursor: pointer;
}

.fst-check span {
    overflow-wrap: anywhere;
}

.fst-check em {
    min-width: 28px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #f1f2f4;
    color: var(--grey);
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    text-align: center;
}

.fst-check:hover span {
    color: var(--red);
}

.fst-check input:checked ~ span {
    color: var(--ink);
    font-weight: 700;
}

/* ---------- Tire size ---------- */

.fst-size-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.fst-select span,
.fst-range-fields label span {
    display: block;
    margin-bottom: 5px;
    color: var(--grey);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.fst-select select,
.fst-range-fields select {
    width: 100%;
    height: 40px;
    padding: 0 8px;
    border: 1px solid #ccd5e2;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-family: var(--body);
    font-size: 14px;
    box-sizing: border-box;
}

/* ---------- Min / max slider ---------- */

.fst-range-track {
    position: relative;
    height: 30px;
    margin: 4px 4px 10px;
}

.fst-range-track::before,
.fst-range-track::after {
    content: "";
    position: absolute;
    top: 13px;
    height: 4px;
    border-radius: 4px;
}

.fst-range-track::before {
    left: 0;
    right: 0;
    background: #e3e5e9;
}

.fst-range-track::after {
    left: var(--from, 0%);
    right: calc(100% - var(--to, 100%));
    background: var(--red);
}

.fst-range-track input[type="range"] {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 30px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.fst-range-track input[type="range"]::-webkit-slider-runnable-track {
    background: none;
}

.fst-range-track input[type="range"]::-moz-range-track {
    background: none;
}

.fst-range-track input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border: 3px solid var(--red);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(17, 18, 20, .25);
    cursor: grab;
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
}

.fst-range-track input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 3px solid var(--red);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(17, 18, 20, .25);
    cursor: grab;
    pointer-events: auto;
}

.fst-range-track input[type="range"]:focus-visible::-webkit-slider-thumb {
    outline: 3px solid rgba(227, 22, 28, .3);
}

.fst-range-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 8px;
}

.fst-range-dash {
    padding-bottom: 10px;
    color: var(--grey);
}

/* ---------- Actions ---------- */

/* Filters apply only with this button, which stays in view at the panel's foot. */
.fst-facets-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin: 0 -20px -20px;
    padding: 14px 20px 16px;
    border-top: 1px solid var(--line);
    background: var(--paper);
}

.fst-facets .fst-facets-apply {
    width: 100%;
    height: 48px;
    border: 0 !important;
    border-radius: 10px !important;
    background: var(--ink) !important;
    color: #fff !important;
    font-family: var(--head) !important;
    font-size: 17px !important;
    font-style: italic;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
}

.fst-facets.has-changes .fst-facets-apply {
    background: var(--red) !important;
    box-shadow: var(--shadow-red);
}

.fst-facets .fst-facets-apply:hover {
    background: var(--red-dark) !important;
}

/* ---------- Active filter chips ---------- */

.fst-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.fst-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(227, 22, 28, .3);
    border-radius: 999px;
    background: rgba(227, 22, 28, .06);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.fst-chip span[aria-hidden] {
    color: var(--red);
    font-size: 16px;
    line-height: 1;
}

.fst-chip:hover {
    border-color: var(--red);
    background: var(--red);
    color: #fff;
}

.fst-chip:hover span[aria-hidden] {
    color: #fff;
}

/* ---------- Mobile drawer ---------- */

.fst-filter-toggle {
    display: none;
}

@media (max-width: 1100px) {

    .fst-shop-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .fst-shop-layout .prod-grid {
        grid-template-columns: 1fr 1fr;
    }

    .fst-filter-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        justify-self: start;
        height: 44px;
        margin: 0 0 16px;
        padding: 0 18px;
        border: 0;
        border-radius: 10px;
        background: var(--ink);
        color: #fff;
        font-family: var(--head);
        font-size: 16px;
        font-style: italic;
        font-weight: 800;
        text-transform: uppercase;
        cursor: pointer;
    }

    .fst-filter-toggle svg {
        width: 18px;
        height: 18px;
    }

    .fst-filter-badge {
        display: inline-grid;
        place-items: center;
        min-width: 20px;
        height: 20px;
        padding: 0 5px;
        border-radius: 999px;
        background: var(--red);
        font-family: var(--body);
        font-size: 12px;
        font-style: normal;
    }

    .fst-filter-panel {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 2147482000;
        width: min(360px, 88vw);
        max-height: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 0;
        border-radius: 0;
        box-shadow: 0 0 0 100vmax rgba(17, 18, 20, 0);
        transform: translateX(-102%);
        transition: transform .3s ease, box-shadow .3s ease;
    }

    body.fst-filters-open {
        overflow: hidden;
    }

    body.fst-filters-open .fst-filter-panel {
        transform: none;
        box-shadow: 0 0 0 100vmax rgba(17, 18, 20, .55);
    }

    .fst-facets-head {
        position: sticky;
        top: 0;
        z-index: 4;
    }

    .fst-facets-close {
        display: inline-grid;
        place-items: center;
    }

    .fst-facets-actions {
        position: sticky;
        bottom: 0;
        display: block !important;
        margin: 0 -20px -20px;
        padding: 14px 20px;
        border-top: 1px solid var(--line);
        background: var(--paper);
    }
}

@media (max-width: 640px) {
    .fst-shop-layout .prod-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================================================
   INPUT RESET
   css/fst-custom.css styles every input and select with
   !important padding and background, which clipped the
   drop-down text and boxed in the sliders. The filter
   controls get their own, more specific styles.
================================================== */

.fst-facets input[type="checkbox"],
.fst-facets input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: none !important;
    box-shadow: none !important;
}

.fst-facets .fst-facet-search {
    height: 40px !important;
    padding: 0 12px 0 36px !important;
    border: 1px solid #d7dde6 !important;
    border-radius: 10px !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 16px !important;
    font-family: var(--body) !important;
    font-size: 14px !important;
    line-height: 40px !important;
}

.fst-facets select {
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    padding: 0 28px 0 10px !important;
    border: 1px solid #d7dde6 !important;
    border-radius: 10px !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111214' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 13px !important;
    color: var(--ink) !important;
    font-family: var(--body) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 40px !important;
    text-overflow: ellipsis;
    cursor: pointer;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.fst-facets select:hover,
.fst-facets .fst-facet-search:hover {
    border-color: #b9c2cf !important;
}

.fst-facets select:focus,
.fst-facets .fst-facet-search:focus {
    border-color: var(--red) !important;
    outline: 3px solid rgba(227, 22, 28, .15) !important;
}

.fst-facets .fst-range-track input[type="range"] {
    height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Size: three compact drop-downs side by side. */
.fst-size-grid {
    gap: 6px;
}

.fst-size-grid select {
    padding-left: 8px !important;
    padding-right: 22px !important;
    background-position: right 6px center !important;
    font-size: 13.5px !important;
}

/* ---------- Show more / less ---------- */

.fst-facet-options .fst-check.is-extra {
    display: none;
}

.fst-facet-options.is-expanded .fst-check.is-extra,
.fst-facet-options.is-searching .fst-check.is-extra {
    display: grid;
}

.fst-facet-options .fst-check[hidden] {
    display: none !important;
}

.fst-facet-options.is-expanded {
    max-height: 320px;
    overflow-y: auto;
    margin-right: -8px;
    padding-right: 8px;
    scrollbar-width: thin;
}

.fst-facet-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 0;
    border: 0 !important;
    background: none !important;
    color: var(--red) !important;
    font-family: var(--body) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer;
}

.fst-facet-more:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fst-facet-empty {
    margin: 4px 0 0;
    color: var(--grey);
    font-size: 13px;
}

.fst-facet-options.is-searching {
    max-height: 320px;
    overflow-y: auto;
}

.fst-facet-options.is-searching {
    max-height: 320px;
    overflow-y: auto;
}

/*
 * css/style.css sets body { overflow-x: hidden }, which turns the body into a
 * scroll container and stops position: sticky from following the window.
 * "clip" hides sideways overflow the same way without that side effect.
 * (This file only loads on shop pages.)
 */
@supports (overflow: clip) {
    body {
        overflow-x: clip !important;
    }
}
