/*
 * Rimsoutlet filters v2 (staging, behind the ram_card_v2 flag / ?card_v2=1 preview).
 * CSS-first restyle of BeRocket AAPF's own markup. Every rule is scoped to body.ram-filters-v2, a class
 * that assets/js/filters-v2.js adds only after it has built the sticky bar, so if the JS does not run the
 * page keeps today's filters. BeRocket's inputs, AJAX, URLs, counts and reset are untouched.
 *
 * Real BeRocket selectors used (RO staging markup, AAPF 3.5):
 *   aside.ram__before-shop                         theme widget area holding the filters
 *   .berocket_single_filter_widget(.berocket_hidden_clickable)  one wrapper per filter (BeRocket JS sets inline widths)
 *   .bapf_sfilter[data-taxonomy][data-op]          the filter; .bapf_ckbox / .bapf_asradio = input type
 *   .bapf_head > h3.bapf_hascolarr                 header / collapse toggle (BeRocket JS)
 *   .bapf_colaps_smb                               chevron
 *   .bapf_body > ul > li > input + label + .pcs    options with counts
 * BeRocket's theme-2 rules use !important at (0,4,0), so overrides use the prefix
 * `body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter`.
 */
body.ram-filters-v2 {
    --rf-blue: #1f64d6;          /* RimsOutlet blue (logo "OUTLET", header) */
    --rf-blue-ink: #0341fc;      /* card v2 link blue */
    --rf-red: #e02022;           /* card v2 CTA red */
    --rf-red-dark: #c3181a;
    --rf-ink: #16181d;
    --rf-muted: #6b6f76;
    --rf-line: #e7e7ea;
    --rf-soft: #f4f6fa;
    --rf-chip: #eef3fd;
    --rf-ok: #12804a;
    --rf-header-h: 50px;         /* Flatsome stuck header height; the shim measures it */
    --rf-head-font: Poppins, "Open Sans", sans-serif;
}

/* ---------- 1. Sticky bar (wrapper printed before aside.ram__before-shop) ---------- */
body.ram-filters-v2 .ram-fbar {
    position: sticky;
    top: var(--rf-header-h);
    z-index: 40;
    margin: 0 -15px 12px;
    padding: 8px 15px 10px;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--rf-line);
    box-shadow: 0 6px 16px -12px rgba(16, 24, 40, 0.35);
    /* no transform/filter/backdrop-filter here: they would trap the position:fixed sheet inside the bar */
}

body.ram-filters-v2 .ram-fbar__fit {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    column-gap: 8px;
    min-height: 36px;
    margin-bottom: 8px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.25;
    color: var(--rf-ink);
    background: #ecf8f1;
    border: 1px solid #cbeedb;
    border-radius: 12px;
}

body.ram-filters-v2 .ram-fbar__fit svg { grid-row: span 2; }
body.ram-filters-v2 .ram-fbar__fit strong { font: 700 13px/1.2 var(--rf-head-font); color: var(--rf-ok); }
body.ram-filters-v2 .ram-fbar__fit .ram-fbar__veh { grid-column: 2; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.ram-filters-v2 .ram-fbar__fit a { grid-column: 3; grid-row: 1 / span 2; padding: 8px 4px; color: var(--rf-blue-ink); font-weight: 700; white-space: nowrap; }
body.ram-filters-v2 .ram-fbar__fit--prompt { grid-template-columns: 1fr auto; color: var(--rf-ink); background: var(--rf-soft); border-color: var(--rf-line); }
body.ram-filters-v2 .ram-fbar__fit--prompt span { font-weight: 600; }
body.ram-filters-v2 .ram-fbar__fit--prompt a {
    grid-column: 2; grid-row: 1;
    padding: 8px 14px;
    color: #fff;
    background: var(--rf-blue);
    border-radius: 999px;
    text-decoration: none;
}

/* Once stuck under the header, keep it compact: drop the vehicle prompt and the count line */
body.ram-filters-v2.ram-fbar-stuck .ram-fbar__fit--prompt,
body.ram-filters-v2.ram-fbar-stuck .ram-fbar__count-wrap { display: none; }
body.ram-filters-v2.ram-fbar-stuck .ram-fbar__fit { min-height: 30px; padding: 4px 10px; margin-bottom: 6px; }

body.ram-filters-v2 .ram-fbar__row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
}

body.ram-filters-v2 .ram-fbar__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    margin: 0;
    padding: 0 16px;
    font: 700 15px/1 var(--rf-head-font);
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
    background: var(--rf-ink);
    border: 0;
    border-radius: 12px;
}

body.ram-filters-v2 .ram-fbar__badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font: 700 12px/22px "Open Sans", sans-serif;
    text-align: center;
    color: #fff;
    background: var(--rf-red);
    border-radius: 999px;
}

body.ram-filters-v2 .ram-fbar__badge:empty,
body.ram-filters-v2 .ram-fbar__badge[data-n="0"] { display: none; }

body.ram-filters-v2 .ram-fbar__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

/* Woo's own ordering form + result count, relocated into the bar server-side (same markup and classes) */
body.ram-filters-v2 .ram-fbar form.woocommerce-ordering { margin: 0; }
body.ram-filters-v2 .ram-fbar form.woocommerce-ordering select.orderby {
    height: 44px;
    margin: 0;
    padding: 0 30px 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rf-ink);
    background-color: #fff;
    border: 1px solid var(--rf-line);
    border-radius: 12px;
    box-shadow: none;
    max-width: 52vw;
}

body.ram-filters-v2 .ram-fbar .woocommerce-result-count {
    display: block !important;      /* Flatsome hides it under "medium" (hide-for-medium) */
    margin: 0;
    font-size: 12px;
    color: var(--rf-muted);
    white-space: nowrap;
}

body.ram-filters-v2 .ram-fbar__count-wrap { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* Quick chips (wheels: Diameter, tires: rim size). Scrolls sideways, 40px chips */
body.ram-filters-v2 .ram-fbar__quick {
    display: flex;
    gap: 8px;
    margin: 8px -15px 0;
    padding: 0 15px 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

body.ram-filters-v2 .ram-fbar__quick::-webkit-scrollbar { display: none; }

body.ram-filters-v2 .ram-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    margin: 0;
    padding: 0 14px;
    font: 600 14px/1 "Open Sans", sans-serif;
    color: var(--rf-ink);
    text-transform: none;
    background: #fff;
    border: 1px solid var(--rf-line);
    border-radius: 999px;
}

body.ram-filters-v2 .ram-chip[aria-pressed="true"] { color: #fff; background: var(--rf-blue); border-color: var(--rf-blue); }
body.ram-filters-v2 .ram-chip small { font-weight: 400; color: var(--rf-muted); }
body.ram-filters-v2 .ram-chip[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.8); }
body.ram-filters-v2 .ram-chip--label { padding: 0 2px; color: var(--rf-muted); background: none; border: 0; font-weight: 700; }

/* Active filter chips (look for BeRocket's Selected Filters widget, or the shim's mirror of it) */
body.ram-filters-v2 .ram-fbar__active { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
body.ram-filters-v2 .ram-fbar__active:empty { display: none; }
body.ram-filters-v2 .ram-achip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    margin: 0;
    padding: 0 6px 0 12px;
    font: 600 13px/1 "Open Sans", sans-serif;
    color: var(--rf-blue-ink);
    text-transform: none;
    background: var(--rf-chip);
    border: 1px solid #cfdcf8;
    border-radius: 999px;
}
body.ram-filters-v2 .ram-achip span { color: var(--rf-muted); font-weight: 400; }
body.ram-filters-v2 .ram-achip i { display: inline-grid; place-items: center; width: 24px; height: 24px; font-style: normal; font-size: 16px; color: var(--rf-ink); background: #fff; border-radius: 50%; }
body.ram-filters-v2 .ram-achip--clear { color: var(--rf-red-dark); background: none; border-color: transparent; text-decoration: underline; padding: 0 8px; }

/* ---------- 2. Mobile (< 64rem): aside.ram__before-shop becomes a full-height bottom sheet ---------- */
@media (width < 64rem) {
    body.ram-filters-v2 aside.ram__before-shop {
        position: fixed;
        inset: 0;
        z-index: 1000000;               /* above Zendesk launcher (999998) and the reCAPTCHA badge */
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch !important;      /* theme centres .ram__before-shop children */
        justify-content: flex-start !important;
        gap: 0;
        margin: 0;
        padding: 0;
        background: #fff;
        transform: translateY(102%);
        transition: transform 0.28s ease;
        visibility: hidden;
    }

    body.ram-filters-v2.ram-fsheet-open aside.ram__before-shop { transform: none; visibility: visible; }
    body.ram-filters-v2.ram-fsheet-open { overflow: hidden; }
    body.ram-filters-v2.ram-fsheet-open .ram-fbar { z-index: 1000000; }   /* lift the bar's stacking context over header + chat */
    body.ram-filters-v2 .ram-fsheet__body { width: 100%; box-sizing: border-box; }

    body.ram-filters-v2 .ram-fsheet__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex: 0 0 auto;
        padding: 14px 16px;
        border-bottom: 1px solid var(--rf-line);
    }

    body.ram-filters-v2 .ram-fsheet__head h2 { margin: 0; font: 800 20px/1.2 var(--rf-head-font); color: var(--rf-ink); }
    body.ram-filters-v2 .ram-fsheet__close {
        width: 44px; height: 44px; margin: 0; padding: 0;
        font-size: 26px; line-height: 44px; color: var(--rf-ink);
        background: var(--rf-soft); border: 0; border-radius: 50%;
    }

    body.ram-filters-v2 .ram-fsheet__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px; }

    /* BeRocket's JS gives each wrapper an inline width (the "uneven" pills): neutralise it inside the sheet */
    body.ram-filters-v2 aside.ram__before-shop .berocket_single_filter_widget {
        float: none !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border-bottom: 1px solid var(--rf-line);
    }

    body.ram-filters-v2 aside.ram__before-shop .berocket_single_filter_widget:empty,
    body.ram-filters-v2 aside.ram__before-shop .berocket_single_filter_widget.bapf_mt_none { display: none; border: 0; }

    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter { position: static !important; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }

    /* Header = accordion row (BeRocket's own collapse toggle keeps working) */
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head { position: relative; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; }
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head h3 {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        min-height: 56px;
        margin: 0;
        padding: 0 4px;
        font: 700 16px/1.2 var(--rf-head-font);
        color: var(--rf-ink);
        border: 0 !important;
        background: none !important;
        box-shadow: none !important;
        cursor: pointer;
    }

    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head h3 .ram-fsel {
        margin-left: auto; margin-right: 10px;
        max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        font: 600 13px/1 "Open Sans", sans-serif; color: var(--rf-blue-ink);
    }

    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_colaps_smb { display: inline-block !important; }

    /* Body: BeRocket shows it as an absolute 240x320 dropdown; in the sheet it is an inline panel */
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body {
        position: static !important;
        width: auto !important;
        max-height: none !important;
        margin: 0 0 12px;
        padding: 0;
        border: 0 !important;
        box-shadow: none !important;
        background: none !important;
        overflow: visible !important;
    }

    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body ul { max-height: 50vh; overflow-y: auto; margin: 0; padding: 0; }

    /* Options: 48px rows, whole row tappable through the real <label for> */
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li {
        position: relative;
        display: flex;
        align-items: center;
        min-height: 48px;
        margin: 0;
        padding: 0 4px;
        border-top: 1px solid #f1f1f3;
        list-style: none;
    }

    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li input[type="checkbox"],
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li input[type="radio"] {
        flex: 0 0 22px;
        width: 22px; height: 22px;
        margin: 0 12px 0 0;
        accent-color: var(--rf-blue);
    }

    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li label {
        flex: 1 1 auto;
        margin: 0;
        padding: 13px 0;
        font-size: 15px;
        font-weight: 500;
        color: var(--rf-ink);
        cursor: pointer;
    }

    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li label::after { content: ""; position: absolute; inset: 0; }   /* full-row hit area */
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li .pcs { font-size: 13px; color: var(--rf-muted); }
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li input:checked ~ label { font-weight: 700; }

    /* Short numeric lists (Diameter, Width, Load Range, Run Flat): a tidy 3-col grid of tiles */
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter:is([data-taxonomy="pa_diameter"],[data-taxonomy="pa_width"],[data-taxonomy="pa_tire-rim-size"],[data-taxonomy="pa_load-range"]) .bapf_body ul {
        display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: none;
    }
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter:is([data-taxonomy="pa_diameter"],[data-taxonomy="pa_width"],[data-taxonomy="pa_tire-rim-size"],[data-taxonomy="pa_load-range"]) .bapf_body li {
        justify-content: center; min-height: 52px; padding: 0 6px; border: 1px solid var(--rf-line); border-radius: 12px; flex-wrap: wrap; text-align: center;
    }
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter:is([data-taxonomy="pa_diameter"],[data-taxonomy="pa_width"],[data-taxonomy="pa_tire-rim-size"],[data-taxonomy="pa_load-range"]) .bapf_body li input {
        position: absolute; opacity: 0; pointer-events: none;     /* still the real, focusable input */
    }
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter:is([data-taxonomy="pa_diameter"],[data-taxonomy="pa_width"],[data-taxonomy="pa_tire-rim-size"],[data-taxonomy="pa_load-range"]) .bapf_body li label { flex: 0 0 100%; padding: 8px 0 0; font-weight: 700; font-size: 16px; }
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter:is([data-taxonomy="pa_diameter"],[data-taxonomy="pa_width"],[data-taxonomy="pa_tire-rim-size"],[data-taxonomy="pa_load-range"]) .bapf_body li .pcs { flex: 0 0 100%; padding-bottom: 8px; font-size: 12px; }
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter:is([data-taxonomy="pa_diameter"],[data-taxonomy="pa_width"],[data-taxonomy="pa_tire-rim-size"],[data-taxonomy="pa_load-range"]) .bapf_body li:has(input:checked) { color: #fff; background: var(--rf-blue); border-color: var(--rf-blue); }
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter:is([data-taxonomy="pa_diameter"],[data-taxonomy="pa_width"],[data-taxonomy="pa_tire-rim-size"],[data-taxonomy="pa_load-range"]) .bapf_body li:has(input:checked) :is(label,.pcs) { color: #fff; }
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter:is([data-taxonomy="pa_diameter"],[data-taxonomy="pa_width"],[data-taxonomy="pa_tire-rim-size"],[data-taxonomy="pa_load-range"]) .bapf_body li:has(input:focus-visible) { outline: 2px solid var(--rf-blue-ink); outline-offset: 2px; }

    /* In-list search (Brand / Finish / Offset): display-only, hides rows; BeRocket inputs untouched */
    body.ram-filters-v2 .ram-fsearch {
        width: 100%; height: 44px; margin: 0 0 8px; padding: 0 12px 0 38px;
        font-size: 15px; border: 1px solid var(--rf-line); border-radius: 12px;
        background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236b6f76' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") 12px 50% no-repeat;
    }
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li.ram-fhide { display: none; }

    body.ram-filters-v2 .ram-fsheet__foot {
        flex: 0 0 auto;
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 12px;
        align-items: center;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid var(--rf-line);
        box-shadow: 0 -8px 20px -14px rgba(16, 24, 40, 0.4);
    }

    body.ram-filters-v2 .ram-fsheet__clear { margin: 0; padding: 0 8px; height: 48px; font-weight: 700; color: var(--rf-ink); text-decoration: underline; text-transform: none; background: none; border: 0; }
    body.ram-filters-v2 .ram-fsheet__show { margin: 0; height: 52px; font: 700 16px/1 var(--rf-head-font); color: #fff; text-transform: none; background: var(--rf-red); border: 0; border-radius: 12px; }
    body.ram-filters-v2 .ram-fsheet__show:active { background: var(--rf-red-dark); }
}

/* ---------- 3. Desktop (>= 64rem): one tidy sticky row of equal BeRocket dropdowns ---------- */
@media (width >= 64rem) {
    body.ram-filters-v2 .ram-fbar {
        display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: start;
        margin: 0 0 16px; padding: 10px 0 12px;
    }
    body.ram-filters-v2 .ram-fbar > * { grid-column: 1 / -1; }
    body.ram-filters-v2 .ram-fbar > aside.ram__before-shop { grid-column: 1; grid-row: 2; }
    body.ram-filters-v2 .ram-fbar > .ram-fbar__row { grid-column: 2; grid-row: 2; display: block; }
    body.ram-filters-v2 .ram-fbar__btn { display: none; }
    body.ram-filters-v2 .ram-fsheet__head,
    body.ram-filters-v2 .ram-fsheet__foot { display: none; }
    body.ram-filters-v2 .ram-fsheet__body { display: contents; }

    /* the aside (BeRocket widgets) sits in the sticky bar's first column as a row of equal pills */
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop {
        display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; background: none;
    }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_single_filter_widget {
        float: none !important; width: auto !important; margin: 0 !important; padding: 0 !important;
    }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_single_filter_widget:empty { display: none; }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter { position: relative !important; margin: 0; }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head { padding: 0 !important; border: 0 !important; background: none !important; }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head h3 {
        display: inline-flex !important; align-items: center; gap: 10px;
        height: 44px; margin: 0; padding: 0 14px 0 16px !important;
        font: 700 14px/1 var(--rf-head-font); color: var(--rf-ink) !important;
        background: #fff !important; border: 1px solid var(--rf-line) !important; border-radius: 999px !important; box-shadow: none !important;
    }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter:has(input:checked) .bapf_head h3 { border-color: var(--rf-blue) !important; color: var(--rf-blue-ink); background: var(--rf-chip) !important; }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head h3 .ram-fsel { font: 700 12px/1 "Open Sans", sans-serif; color: #fff; background: var(--rf-blue); border-radius: 999px; padding: 4px 7px; }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body {
        position: absolute !important; top: 52px !important; left: 0; z-index: 60 !important;
        width: 300px !important; min-width: 0 !important; max-width: none !important; max-height: 420px !important; overflow: auto !important;
        padding: 8px !important; background: #fff !important;
        border: 1px solid var(--rf-line) !important; border-radius: 14px !important; box-shadow: 0 16px 40px rgba(16, 24, 40, 0.18) !important;
    }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li { display: flex; align-items: center; min-height: 40px; padding: 0 8px; border-radius: 8px; list-style: none; margin: 0; }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li:hover { background: var(--rf-soft); }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li input { width: 18px; height: 18px; margin: 0 10px 0 0; accent-color: var(--rf-blue); }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li label { flex: 1; margin: 0; font-size: 14px; cursor: pointer; }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li .pcs { font-size: 12px; color: var(--rf-muted); }
    body.ram-filters-v2 .ram-fsearch { width: 100%; height: 38px; margin: 0 0 6px; padding: 0 10px; border: 1px solid var(--rf-line); border-radius: 10px; }
    body.ram-filters-v2 aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_body li.ram-fhide { display: none; }
    body.ram-filters-v2 .ram-fbar__quick { margin: 10px 0 0; padding: 0; }
}

/* Empty state (Woo's own .woocommerce-info "No products were found") */
body.ram-filters-v2 .ram-fempty { margin: 24px 0; padding: 28px 20px; text-align: center; background: var(--rf-soft); border-radius: 16px; }
body.ram-filters-v2 .ram-fempty h3 { margin: 0 0 6px; font: 800 18px/1.3 var(--rf-head-font); }
body.ram-filters-v2 .ram-fempty p { margin: 0 0 14px; color: var(--rf-muted); }
body.ram-filters-v2 .ram-fempty button { height: 44px; padding: 0 18px; font-weight: 700; color: #fff; background: var(--rf-blue); border: 0; border-radius: 12px; text-transform: none; }
body.ram-filters-v2 .ram-fempty a.ram-fempty__clear { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; font-weight: 700; color: #fff; background: var(--rf-blue); border-radius: 12px; text-decoration: none; }

/* Saved vehicle on a non-vehicle page: link back to the fitted results (no guarantee claim here) */
body.ram-filters-v2 .ram-fbar__fit--saved strong { font-weight: 700; }

/* ===== Round 3 (Mike, 5:17 PM) ===== */
/* Desktop pills: chevron sits after the wording with a gap (BeRocket positions it absolute at right:0) */
@media (width >= 64rem) {
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head h3 .bapf_colaps_smb {
        position: relative !important;  /* in flow after the label; its drawn ::before chevron centres on it */
        top: auto !important;
        right: auto !important;
        flex: none;
        align-self: center;
        width: 12px !important;
        height: 12px !important;
        margin-left: 0;
        font-size: 12px !important;
        line-height: 1 !important;
        color: var(--rf-muted) !important;
    }
    /* keep six pills + a selected badge on one line at 1440 now that the chevron takes real width */
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head h3.bapf_hascolarr {
        gap: 6px;
        padding: 0 12px 0 14px !important;
    }
}

/* ---------- Round 8: tire size control (includes/tire-size-v2.php + js/tire-size-v2.js) ---------- */
body.ram-filters-v2 .ram-tsz { margin: 0 0 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--rf-line); border-radius: 12px; }
body.ram-filters-v2 .ram-tsz__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.ram-filters-v2 .ram-tsz__title { min-width: 0; font: 700 14px/1.3 var(--rf-head-font); color: var(--rf-ink); }
body.ram-filters-v2 .ram-tsz__toggle { flex: none; height: 40px; margin: 0; padding: 0 14px; font-weight: 700; font-size: 14px; color: var(--rf-blue-ink); text-transform: none; background: var(--rf-chip); border: 0; border-radius: 10px; }
body.ram-filters-v2 .ram-tsz__toggle[aria-expanded="true"] { color: #fff; background: var(--rf-blue); }
body.ram-filters-v2 .ram-tsz__banner { margin: 10px 0 0; padding: 10px 12px; font-size: 14px; line-height: 1.45; color: var(--rf-ink); background: #f4f7fb; border: 1px solid #e1e8f0; border-radius: 10px; }
body.ram-filters-v2 .ram-tsz__tag { display: inline-block; margin-right: 4px; padding: 1px 8px; font: 700 12px/1.6 var(--rf-head-font); color: var(--rf-blue-ink); background: var(--rf-chip); border-radius: 999px; }

body.ram-filters-v2 .ram-tsz__banner[hidden], body.ram-filters-v2 .ram-tsz__body[hidden] { display: none; }
body.ram-filters-v2 .ram-tsz__body { margin-top: 10px; }
body.ram-filters-v2 .ram-tsz__note { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: var(--rf-muted); }
body.ram-filters-v2 .ram-tsz .ram__form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
body.ram-filters-v2 .ram-tsz .ram__form > .ram__input-row { margin: 0; }
body.ram-filters-v2 .ram-tsz .ram__form > .ram__input-row:last-child,
body.ram-filters-v2 .ram-tsz .ram__form > .ram__input-row:has(#ts__input--tires-staggered) { grid-column: 1 / -1; }
body.ram-filters-v2 .ram-tsz .ram__form .ram__input { width: 100%; height: 44px; margin: 0; font-size: 15px; }
body.ram-filters-v2 .ram-tsz .ram__form .ram__input--button { color: #fff; background: var(--rf-blue); border-radius: 10px; }
/* Round 9: the plugin's red step bullet becomes a small blue pointer inside the size panel (no red near the size note). */
body.ram-filters-v2 .ram-tsz .ram__input-row--current::before { left: -13px; top: 50%; width: 0; height: 0; background: none; border-style: solid; border-width: 6px 0 6px 8px; border-color: transparent transparent transparent var(--rf-blue); transform: translateY(-50%); }
body.ram-filters-v2 .ram-tsz .ram__input-label { grid-column: 1 / -1; margin: 2px 0 -2px; font: 700 13px/1.2 var(--rf-head-font); color: var(--rf-ink); }
body.ram-filters-v2 .ram-tsz .ram__form:not(.ram__form--show-staggered) .ram__input-label.ram__input-row--staggered { display: none; }
body.ram-filters-v2 .ram-tsz__reset { display: inline-block; margin-top: 10px; font-weight: 700; color: var(--rf-blue-ink); }
body.ram-filters-v2 .ram-fempty .ram-fempty__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
body.ram-filters-v2 .ram-fempty a.ram-fempty__alt { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; font-weight: 700; color: var(--rf-blue-ink); background: #fff; border: 1px solid var(--rf-line); border-radius: 12px; text-decoration: none; }
@media (width >= 64rem) {
    body.ram-filters-v2 .ram-tsz .ram__form { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 760px; }
    body.ram-filters-v2 .ram-tsz .ram__form > .ram__input-row:last-child { grid-column: auto; }
}

/* ---------- Round 12 (Mike, Nov 30): no outline, "Diameter Options" dropdown, two-row sticky bar ---------- */
/* 1. The bar loses its outline (bottom border + shadow); it stays solid white so cards don't show through when stuck */
body.ram-filters-v2 .ram-fbar { border-bottom: 0; box-shadow: none; background: #fff; }
body.ram-filters-v2 .ram-fbar__quick { display: none !important; }   /* replaced by the dropdown */

/* Diameter Options: same height and look as the sort select; the menu lists BeRocket's own diameter values */
body.ram-filters-v2 .ram-fdd { position: relative; flex: 0 1 auto; min-width: 0; }
body.ram-filters-v2 .ram-fdd[hidden] { display: none; }
body.ram-filters-v2 .ram-fdd__btn {
    display: inline-flex; align-items: center; gap: 6px;
    width: 100%; height: 44px; margin: 0; padding: 0 12px;
    font: 600 14px/1 "Open Sans", sans-serif; color: var(--rf-ink); text-transform: none; letter-spacing: 0; white-space: nowrap;
    background: #fff; border: 1px solid var(--rf-line); border-radius: 12px; box-shadow: none;
}
body.ram-filters-v2 .ram-fdd__lbl { overflow: hidden; text-overflow: ellipsis; }
body.ram-filters-v2 .ram-fdd.is-sel .ram-fdd__btn { color: var(--rf-blue-ink); background: var(--rf-chip); border-color: var(--rf-blue); }
body.ram-filters-v2 .ram-fdd__n { flex: none; padding: 4px 7px; font: 700 12px/1 "Open Sans", sans-serif; color: #fff; background: var(--rf-blue); border-radius: 999px; }
body.ram-filters-v2 .ram-fdd__n[hidden] { display: none; }
body.ram-filters-v2 .ram-fdd__chev { flex: none; width: 8px; height: 8px; margin: -4px 2px 0 2px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: .7; }
body.ram-filters-v2 .ram-fdd.is-open .ram-fdd__chev { margin-top: 4px; transform: rotate(-135deg); }
body.ram-filters-v2 .ram-fdd__menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 70;
    width: max(100%, 220px); max-height: min(60vh, 420px); overflow: auto; padding: 6px;
    background: #fff; border: 1px solid var(--rf-line); border-radius: 14px; box-shadow: 0 16px 40px rgba(16, 24, 40, 0.18);
}
body.ram-filters-v2 .ram-fdd__menu[hidden] { display: none; }
body.ram-filters-v2 .ram-fdd__opt {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin: 0; padding: 0 10px;
    font: 600 15px/1 "Open Sans", sans-serif; color: var(--rf-ink); text-transform: none; letter-spacing: 0; text-align: left;
    background: none; border: 0; border-radius: 8px;
}
body.ram-filters-v2 .ram-fdd__opt:hover, body.ram-filters-v2 .ram-fdd__opt:focus-visible { background: var(--rf-soft); }
body.ram-filters-v2 .ram-fdd__opt i { flex: none; width: 18px; height: 18px; border: 2px solid #b8c0cc; border-radius: 4px; background: #fff; }
body.ram-filters-v2 .ram-fdd__opt[aria-checked="true"] i { background: var(--rf-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12 4 4 8-8' stroke='%23fff' stroke-width='3' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--rf-blue); }
body.ram-filters-v2 .ram-fdd__opt[aria-checked="true"] { color: var(--rf-blue-ink); }
body.ram-filters-v2 .ram-fdd__opt span { flex: 1; }
body.ram-filters-v2 .ram-fdd__opt small { font: 400 12px/1 "Open Sans", sans-serif; color: var(--rf-muted); }

/* 3. Phone (< 64rem): Filters | Diameter Options | Best Sellers on one row, nothing clipped at 360-390px */
@media (width < 64rem) {
    body.ram-filters-v2 .ram-fbar__row { display: flex; gap: 5px; }
    body.ram-filters-v2 .ram-fbar__btn { flex: none; gap: 5px; padding: 0 9px; font-size: 14px; }
    body.ram-filters-v2 .ram-fbar__btn svg { width: 16px; height: 16px; }
    body.ram-filters-v2 .ram-fbar__tools { flex: 1 1 auto; gap: 5px; justify-content: flex-end; }
    body.ram-filters-v2 .ram-fdd { flex: 0 0 auto; }                 /* the label never shrinks; the sort select takes what is left */
    body.ram-filters-v2 .ram-fdd__btn { padding: 0 7px; font-size: 13px; gap: 4px; }
    body.ram-filters-v2 .ram-fdd__chev { margin: -4px 1px 0 0; }
    body.ram-filters-v2 .ram-fdd.is-open .ram-fdd__chev { margin-top: 4px; }
    body.ram-filters-v2 .ram-fbar form.woocommerce-ordering { flex: 1 1 0; min-width: 0; }
    body.ram-filters-v2 .ram-fbar form.woocommerce-ordering select.orderby { width: 100%; max-width: none; padding: 0 20px 0 6px; font-size: 13px; background-position: right 5px center; }
    /* the menu opens under the button but never runs off the right edge */
    body.ram-filters-v2 .ram-fdd__menu { left: auto; right: auto; }
}
@media (width < 389.98px) {
    body.ram-filters-v2 .ram-fdd__w { display: none; }          /* very narrow phones: "Diameter" */
}

/* 2. Desktop (>= 64rem): vehicle box, then at most two rows — [filters … Diameter Options · Sort] / [active chips … count]
      Stuck: the vehicle box folds into row 2 (right side), so the sticky bar never exceeds two rows. */
@media (width >= 64rem) {
    body.ram-filters-v2 .ram-fbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; align-items: center; }
    body.ram-filters-v2 .ram-fbar > .ram-fbar__fit { grid-column: 1 / -1; grid-row: 1; }
    body.ram-filters-v2 .ram-fbar > aside.ram__before-shop { grid-column: 1; grid-row: 2; }
    body.ram-filters-v2 .ram-fbar > .ram-fbar__row { grid-column: 2; grid-row: 2; display: block; align-self: start; }
    body.ram-filters-v2 .ram-fbar > .ram-fbar__active { grid-column: 1; grid-row: 3; margin-top: 10px; }
    body.ram-filters-v2 .ram-fbar > .ram-fbar__count-wrap { grid-column: 2; grid-row: 3; justify-content: flex-end; margin-top: 10px; align-self: center; }
    body.ram-filters-v2.ram-fdd-on .ram-fbar aside.ram__before-shop .berocket_single_filter_widget:has(.bapf_sfilter:is([data-taxonomy="pa_diameter"], [data-taxonomy="pa_tire-rim-size"])) { display: none !important; }
    /* pills + Diameter Options + sort must share one line in the 1050px container (two-row sticky), so the pill type
       steps down from 17.92px to 16px (14px under 1200px); the dropdown uses the same type as the pills */
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop { gap: 6px; }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head h3, body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head h3.bapf_hascolarr { font-size: 15px !important; padding: 0 10px 0 13px !important; gap: 5px !important; }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head h3 .ram-fsel { padding: 3px 6px; font-size: 11px; }
    body.ram-filters-v2 .ram-fdd__btn { min-height: 44px; padding: 0 10px 0 13px; font: 700 15px/1 var(--rf-head-font); border-radius: 999px; }
    body.ram-filters-v2 .ram-fdd__n { padding: 3px 6px; font-size: 11px; }
    body.ram-filters-v2 .ram-fdd__menu { left: auto; right: 0; }
    body.ram-filters-v2 .ram-fbar form.woocommerce-ordering select.orderby { max-width: 190px; }
    body.ram-filters-v2 .ram-fbar { column-gap: 12px; }

    /* stuck: guarantee line becomes a slim text line in row 2 right; prompt + count already hidden */
    body.ram-filters-v2.ram-fbar-stuck .ram-fbar { padding: 8px 0; }
    body.ram-filters-v2.ram-fbar-stuck .ram-fbar > .ram-fbar__fit:not(.ram-fbar__fit--prompt) {
        grid-column: 2; grid-row: 3; justify-self: end; display: flex; align-items: center; gap: 6px;
        min-height: 0; margin: 8px 0 0; padding: 0; background: none; border: 0; font-size: 13px; white-space: nowrap;
    }
    body.ram-filters-v2.ram-fbar-stuck .ram-fbar > .ram-fbar__fit:not(.ram-fbar__fit--prompt) svg { width: 16px; height: 16px; }
    body.ram-filters-v2.ram-fbar-stuck .ram-fbar > .ram-fbar__fit:not(.ram-fbar__fit--prompt) .ram-fbar__veh { max-width: 280px; }
    body.ram-filters-v2.ram-fbar-stuck .ram-fbar > .ram-fbar__fit:not(.ram-fbar__fit--prompt) a { padding: 0 0 0 4px; }
    body.ram-filters-v2.ram-fbar-stuck .ram-fbar > .ram-fbar__active { margin-top: 8px; }
}
@media (64rem <= width < 75rem) {
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head h3, body.ram-filters-v2 .ram-fbar aside.ram__before-shop .berocket_hidden_clickable .bapf_sfilter .bapf_head h3.bapf_hascolarr { font-size: 14px !important; padding: 0 8px 0 11px !important; gap: 4px !important; }
    body.ram-filters-v2 .ram-fbar aside.ram__before-shop { gap: 5px; }
    body.ram-filters-v2 .ram-fdd__btn { font-size: 14px; padding: 0 8px 0 11px; }
    body.ram-filters-v2 .ram-fbar form.woocommerce-ordering select.orderby { max-width: 160px; }
}

/* ---------- Round 13 (Mike, Nov 30): faint divider only while the bar is stuck over the cards ---------- */
/* box-shadow, not border, so sticking/unsticking never shifts the layout by 1px; normal state keeps no outline */
body.ram-filters-v2.ram-fbar-stuck .ram-fbar { box-shadow: 0 1px 0 #e5e7eb; }
