/*
 * Look of the filter panel of the search page: matches the filters of the category pages (typography, colours and spacing of the Venture
 * theme as it is set up for the shop). Text uses the font of the page; the arrow, the cross and the filter icon come from the theme's
 * icon font ("venture-font"). The accent colour is the CSS variable --cbs-accent (the view adds it from the Cbs Custom Plugins > Common > Settings page); the
 * fallback after the comma is the Venture preset colour.
 */
.cbs-filters[hidden] { display: none; }
.cbs-filters { margin: 0 0 20px; color: #2c2c2c; letter-spacing: .2px; }
/* the head with the title and the close button, the dark overlay and the button that opens the panel exist for narrow screens only */
.cbs-filters__head, .cbs-filters__overlay { display: none; }
.cbs-filters__toggle { display: none; position: relative; width: 100%; box-sizing: border-box; height: 50px; margin: 0 0 10px; padding: 15px 40px 15px 50px; text-align: left; background: #fff; border: 0; box-shadow: 0 0 14px rgba(0, 0, 0, .06); cursor: pointer; font: inherit; font-size: 16px; letter-spacing: inherit; text-transform: uppercase; color: #000; }
.cbs-filters__toggle[hidden] { display: none !important; }
.cbs-filters__toggle::before { content: "1"; font-family: venture-font; text-transform: none; position: absolute; left: 21px; top: 0; bottom: 0; margin: auto; width: 18px; height: 16px; line-height: 16px; font-size: 15px; color: #909090; }

/* selected filters */
.cbs-filters__selected { margin: 0 0 20px; }
.cbs-filters__selected:empty { display: none; }
.cbs-filters__selected-title { position: relative; margin: 0 0 10px; padding: 0 3px 4px; border-bottom: .8px solid #d4d4d4; font-size: 18px; text-transform: uppercase; }
.cbs-filters__selected-title::before { content: ""; position: absolute; left: 0; bottom: -2px; width: 75px; height: 3px; background: var(--cbs-accent, #bc0019); }
.cbs-filters__chips { margin: 0 0 6px; padding: 0 5px; list-style: none; }
.cbs-filters__chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0; font-size: 15px; color: #2c2c2c; }
.cbs-filters__chip button { position: relative; flex: 0 0 25px; width: 25px; height: 25px; padding: 0; background: none; border: 0; cursor: pointer; }
.cbs-filters__chip button::before { content: "u"; font-family: venture-font; text-transform: none; position: absolute; inset: 0; margin: auto; width: 11px; height: 11px; line-height: 11px; font-size: 11px; color: #909090; transition: .2s ease-in-out; }
.cbs-filters__chip button:hover::before, .cbs-filters__chip button:focus::before { color: #2c2c2c; }
.cbs-filters__clear { padding: 0 5px; background: none; border: 0; cursor: pointer; font: inherit; font-size: 13px; letter-spacing: inherit; text-transform: uppercase; text-decoration: underline; color: #909090; }
.cbs-filters__clear:hover { color: #2c2c2c; }

/* a group: title with the grey rule and the short red bar, closed groups show a small arrow */
.cbs-filters__group { position: relative; margin: 0 auto 20px; }
.cbs-filters__group-head { position: relative; display: block; width: 100%; padding: 0 3px 4px; background: none; border: 0; border-bottom: .8px solid #d4d4d4; text-align: left; cursor: pointer; font: inherit; font-size: 18px; letter-spacing: inherit; text-transform: uppercase; color: #2c2c2c; }
.cbs-filters__group-head::before { content: ""; position: absolute; left: 0; bottom: -2px; width: 75px; height: 3px; background: var(--cbs-accent, #bc0019); }
.cbs-filters__group:not(.cbs-filters__group--open) > .cbs-filters__group-head::after { content: "c"; font-family: venture-font; text-transform: none; position: absolute; top: 0; right: 5px; bottom: 0; margin: auto; width: 8px; height: 9px; font-size: 7px; color: #2c2c2c; }
.cbs-filters__group-body { display: none; padding: 10px 5px; }
.cbs-filters__group--open > .cbs-filters__group-body { display: block; }

/* the values: square check boxes with a red mark, grey labels that turn dark when hovered or checked, the count at the end */
.cbs-filters__values { margin: 0; padding: 0; list-style: none; max-height: 400px; overflow-y: auto; }
.cbs-filters__value label { position: relative; display: flex; align-items: baseline; gap: 6px; padding: 6px 9px 4px 25px; cursor: pointer; font-size: 15px; letter-spacing: inherit; color: #909090; }
.cbs-filters__value label, .cbs-filters__count { text-transform: none; }
.cbs-filters__value label:hover, .cbs-filters__value--checked label { color: #2c2c2c; }
.cbs-filters__value input { position: absolute; width: 0; height: 0; margin: 0; opacity: 0; }
.cbs-filters__value label::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; margin: auto; width: 17px; height: 17px; box-sizing: border-box; border: .8px solid #d4d4d4; }
.cbs-filters__value--locked label { cursor: default; }
.cbs-filters__value--checked label::after { content: ""; position: absolute; top: 0; left: 3px; bottom: 0; margin: auto; width: 11px; height: 11px; background: var(--cbs-accent, #bc0019); }
/* keyboard focus only, and drawn inside the box: the list scrolls, so anything outside the box at the left edge would be cut off */
.cbs-filters__value label:has(input:focus-visible)::before { border-color: #2c2c2c; outline: 1px solid #2c2c2c; outline-offset: -2px; }
.cbs-filters__name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cbs-filters__count { margin-left: auto; font-size: 12px; white-space: nowrap; color: #909090; }

/* a group shown as a drop-down list (the display mode setting): one value, or all */
.cbs-filters__select { display: block; width: 100%; box-sizing: border-box; padding: 8px 10px; border: .8px solid #d4d4d4; background: #fff; font: inherit; font-size: 15px; letter-spacing: inherit; color: #2c2c2c; }
.cbs-filters__select:focus-visible { outline: 1px solid #2c2c2c; outline-offset: -2px; }
.cbs-filters__select:disabled { color: #909090; background: #f4f4f4; }

/* infinite scroll: a marker below the list, the next page is asked for when it comes near the window */
.cbs-filters__sentinel { height: 1px; }
.cbs-filters__loader { display: none; height: 70px; position: relative; }
.cbs-filters__loader--on { display: block; }
.cbs-filters__loader::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; width: 30px; height: 30px; box-sizing: border-box; border: 3px solid #d4d4d4; border-top-color: var(--cbs-accent, #bc0019); border-radius: 50%; animation: cbs-filters-spin .8s linear infinite; }
@keyframes cbs-filters-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cbs-filters__loader::after { animation-duration: 3s; } }

/* price: two boxes, and a track with a red stretch between two round handles */
.cbs-filters__price-inputs { display: flex; gap: 10px; margin: 0 0 14px; }
.cbs-filters__price-inputs label { flex: 1 1 0; font-size: 12px; text-transform: uppercase; color: #909090; }
.cbs-filters__price-inputs input { width: 100%; box-sizing: border-box; margin-top: 2px; padding: 6px 8px; border: .8px solid #d4d4d4; background: #fff; font: inherit; font-size: 14px; color: #2c2c2c; }
.cbs-filters__range { position: relative; height: 16px; margin: 0 8px 12px; }
.cbs-filters__range::before { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 6px; background: #bebebe; }
.cbs-filters__range-fill { position: absolute; top: 5px; height: 6px; background: var(--cbs-accent, #bc0019); }
.cbs-filters__range input[type=range] { position: absolute; left: 0; top: 0; width: 100%; height: 16px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.cbs-filters__range input[type=range]::-webkit-slider-runnable-track { height: 16px; background: transparent; }
.cbs-filters__range input[type=range]::-moz-range-track { height: 16px; background: transparent; }
.cbs-filters__range input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 13px rgba(0, 0, 0, .23); cursor: pointer; }
.cbs-filters__range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 13px rgba(0, 0, 0, .23); cursor: pointer; }

/* narrow screens: a button above the results opens the panel as a drawer from the left, over a dark overlay */
@media (max-width: 1024px) {
    .cbs-filters { margin: 0; }
    .cbs-filters__toggle { display: block; }
    .cbs-filters__panel { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1070; width: 320px; max-width: 90vw; padding: 0 0 20px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: #fff; box-shadow: 1px 0 5px rgba(0, 0, 0, .5); transform: translateX(-100%); visibility: hidden; transition: transform .3s ease, visibility 0s linear .3s; }
    .cbs-filters--open .cbs-filters__panel { transform: none; visibility: visible; transition: transform .3s ease; }
    .cbs-filters__overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1060; background: rgba(0, 0, 0, .6); }
    .cbs-filters--open .cbs-filters__overlay { display: block; }
    body.cbs-filters-locked { overflow: hidden; }
    /* the content of the page is a stacking context of its own (z-index 0), so the drawer would stay under the fixed bars of the header;
       while the drawer is open or sliding out the content is released, and the drawer and the overlay stack against the header bars */
    body.cbs-filters-raised .master-wrapper-content { z-index: auto; }

    .cbs-filters__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; height: 60px; margin: 0 0 20px; padding: 5px 5px 5px 20px; box-sizing: border-box; background: #2c2c2c; color: #fff; }
    .cbs-filters__title { position: relative; padding-left: 30px; font-size: 15px; text-transform: uppercase; }
    .cbs-filters__title::before { content: "1"; font-family: venture-font; text-transform: none; position: absolute; left: 0; top: 0; bottom: 0; margin: auto; width: 18px; height: 16px; line-height: 16px; font-size: 15px; color: #909090; }
    .cbs-filters__close { position: relative; flex: 0 0 50px; width: 50px; height: 50px; padding: 0; background: none; border: 0; cursor: pointer; }
    .cbs-filters__close::before { content: "u"; font-family: venture-font; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; line-height: 14px; font-size: 13.5px; color: #909090; transition: .2s ease-in-out; }
    .cbs-filters__close:hover::before, .cbs-filters__close:focus::before { color: #fff; }
    .cbs-filters__selected, .cbs-filters__groups, .cbs-filters .cbs-car { margin-left: 15px; margin-right: 15px; }
}
