/* The box "Filters" beside a list of products (filters.php). One file for a page written from either side: it says
   "start" and "end", never "left" and "right" (only the slider of prices is laid from the left, as SpinasWebShop's own
   slider reckons it). The groups inside are SpinasWebShop's own lists; their names are SpinasWebShop's. */
.filters { --f-ink: #3f4064; --f-soft: #81858b; --f-line: #e0e0e2; --f-hair: #f0f0f1; --f-on: var(--sf-accent, #0d9488); margin: 0 0 24px; padding: 16px 20px 0; border: 1px solid var(--f-line); border-radius: 8px; background: #fff; color: var(--f-ink); font-size: 15px; line-height: 1.6; text-align: start; }
.filters *, .filters *::before, .filters *::after { box-sizing: border-box; }
.filters a { text-decoration: none; }
.filters__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.filters .filters__title { margin: 0; padding: 0; border: 0; color: var(--f-ink); font-size: 19px; line-height: 40px; font-weight: 700; }
.filters .filters__clear { color: #1672dd; font-size: 12px; line-height: 26px; font-weight: 700; }

/* a group */
.filters .facet { display: block; margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--f-hair); }
.filters .facets > .facet:last-child { border-bottom: 0; }
.filters .facet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; margin: 0; padding: 12px 0; color: var(--f-ink); font-size: 15px; line-height: 32px; font-weight: 700; cursor: pointer; list-style: none; user-select: none; }
.filters .facet__head::-webkit-details-marker { display: none; }
.filters .facet__head::marker { content: ''; }
.filters .facet__head:focus-visible { outline: 2px solid var(--f-on); outline-offset: 2px; border-radius: 4px; }
.filters details[open] > .facet__head { min-height: 0; padding-bottom: 4px; }
.filters .facet__chev { flex: none; color: #a2a2a2; transition: transform .22s cubic-bezier(.2, .7, .2, 1); }
.filters details[open] > .facet__head .facet__chev { transform: rotate(180deg); }
.filters .facet__body { padding: 2px 0 12px; }
.filters .facet__body ul { list-style: none; margin: 0; padding: 0; }
.filters .facet__body li { margin: 0; padding: 0; }
.filters .facet__body li::before, .filters .facet__body li::after { content: none; }

/* a list of values to tick: SpinasWebShop's list of links, one link a value; the chosen one carries "chosen" */
.filters .facet--list .facet__body > ul { max-height: 286px; overflow: auto; padding-inline-end: 12px; scrollbar-width: thin; scrollbar-color: var(--f-line) transparent; }
.filters .facet--list li { border-bottom: 1px solid var(--f-hair); }
.filters .facet--list li:last-child { border-bottom: 0; }
.filters .facet--list li[hidden] { display: none; }
.filters .facet--list li > a, .filters .facet--list li > span { display: flex; align-items: center; gap: 16px; min-height: 57px; padding: 12px 0; color: var(--f-ink); font-size: 15px; line-height: 32px; font-weight: 700; }
.filters .facet--list li > span { color: #a1a3a8; }
.filters .facet--list li > a::before, .filters .facet--list li > span::before { content: ''; flex: none; width: 18px; height: 18px; border: 2px solid var(--f-ink); border-radius: 4px; background: #fff no-repeat center / 12px; transition: background-color .12s, border-color .12s; }
.filters .facet--list li > span::before { border-color: #c0c2c5; }
.filters .facet--list li > a:hover::before { border-color: var(--f-soft); }
.filters .facet--list li.chosen > a::before { border-color: var(--f-on); background-color: var(--f-on); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.filters .facet--list li > a:focus-visible { outline: 2px solid var(--f-on); outline-offset: -2px; border-radius: 4px; }

/* the search inside a long list (put there by filters.js) */
.filters .facet-search { display: flex; align-items: center; gap: 8px; height: 48px; margin: 0 0 12px; padding: 0 12px; border: 1px solid var(--f-line); border-radius: 8px; background: #fff; }
.filters .facet-search:focus-within { border-color: #a1a3a8; }
.filters .facet-search svg { flex: none; color: #23254e; }
.filters .facet-search input { flex: 1; min-width: 0; height: 32px; margin: 0; padding: 0; border: 0; outline: 0; box-shadow: none; background: none; color: var(--f-ink); font: inherit; font-size: 14px; font-weight: 400; }
.filters .facet-search input::placeholder { color: #a1a3a8; }
.filters .facet-search input::-webkit-search-cancel-button { display: none; }
.filters .facet-none { margin: 0; padding: 16px 0; color: var(--f-soft); font-size: 12px; text-align: center; }

/* tiles of colour */
.filters .facet--tiles .facet__body > ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; padding: 8px 0 4px; }
.filters .ctile { display: grid; justify-items: center; gap: 6px; color: var(--f-ink); }
.filters .ctile__sw { position: relative; display: block; width: 48px; height: 48px; border: 1px solid var(--f-line); border-radius: 8px; background: var(--c, #fff); background: linear-gradient(90deg, var(--c) 0 25%, color-mix(in srgb, var(--c) 85%, #fff) 25% 50%, color-mix(in srgb, var(--c) 70%, #fff) 50% 75%, color-mix(in srgb, var(--c) 55%, #fff) 75%); box-shadow: inset 0 0 0 3px #fff; transition: border-color .12s, box-shadow .12s; }
/* (a value whose own mark is a picture, a pattern of cloth: the picture fills the square) */
.filters .ctile__sw.ctile__sw--picture { background-color: #fff; background-position: center; background-size: cover; background-repeat: no-repeat; }
.filters .ctile:hover .ctile__sw { border-color: #a1a3a8; }
.filters li.chosen .ctile__sw { border-color: var(--f-on); box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px var(--f-on); }
.filters li.chosen .ctile__sw::after { content: ''; position: absolute; top: -6px; inset-inline-end: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--f-on) no-repeat center / 10px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.filters .ctile__name { color: var(--f-ink); font-size: 11px; line-height: 24px; font-weight: 400; text-align: center; }
.filters .ctile:focus-visible { outline: 2px solid var(--f-on); outline-offset: 2px; border-radius: 8px; }

/* the categories: plain links, a category under another set in */
.filters .facet--links .facet__body li > a { display: block; padding: 8px 0; color: var(--f-ink); font-size: 14px; line-height: 28px; font-weight: 400; }
.filters .facet--links .facet__body li.current-cat > a { color: var(--f-on); font-weight: 700; }
.filters .facet--links .facet__body ul ul { padding-inline-start: 16px; }

/* the range of prices: SpinasWebShop's own form and its own slider */
.filters .range { margin: 0; }
.filters .range .price_slider_amount { text-align: start; line-height: 1.6; }
.filters .range input[type="text"] { width: 100%; margin: 0 0 8px; }
.filters .range__row { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 0 0 8px; border-bottom: 1px solid var(--f-line); }
.filters .range__k { flex: none; width: 16px; color: var(--f-soft); font-size: 15px; }
.filters .range__value { flex: 1; min-width: 0; color: #23254e; font-size: 19px; line-height: 40px; font-weight: 700; text-align: center; }
.filters .range__value [class*="currencySymbol"] { margin: 0 6px; color: var(--f-soft); font-size: 12px; font-weight: 400; }
.filters .range .price_slider { position: relative; height: 2px; margin: 18px 10px 14px; border: 0; border-radius: 2px; background: var(--f-line); direction: ltr; }
.filters .range .price_slider .ui-slider-range { position: absolute; top: 0; height: 100%; border: 0; border-radius: 2px; background: var(--f-on); }
.filters .range .price_slider .ui-slider-handle { position: absolute; top: -9px; z-index: 2; width: 20px; height: 20px; margin-left: -10px; border: 0; border-radius: 50%; outline: 0; background: var(--f-on); box-shadow: 0 0 0 3px #fff, 0 1px 4px rgba(0, 0, 0, .3); cursor: grab; touch-action: none; }
.filters .range .price_slider .ui-slider-handle:active { cursor: grabbing; }
.filters .range .price_slider .ui-slider-handle:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--f-on); }
.filters .range__ends { display: flex; justify-content: space-between; margin: 0 0 12px; color: var(--f-soft); font-size: 11px; line-height: 24px; font-weight: 700; direction: ltr; }
.filters .range .range__go { display: block; width: 100%; margin: 0; }

/* "only products in stock": a link that looks like a switch */
.filters .facet--switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; padding: 12px 0; color: var(--f-ink); font-size: 15px; line-height: 32px; font-weight: 700; }
.filters .facet--switch:focus-visible { outline: 2px solid var(--f-on); outline-offset: 2px; border-radius: 4px; }
.filters .switch { flex: none; position: relative; width: 40px; height: 20px; border: 2px solid #a2a2a2; border-radius: 9999px; background: #fff; transition: background-color .12s, border-color .12s; }
.filters .switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 10px; height: 10px; border-radius: 50%; background: #a2a2a2; transition: inset-inline-start .22s cubic-bezier(.2, .7, .2, 1), background-color .12s; }
.filters .facet--switch.is-on .switch { border-color: var(--f-on); background: var(--f-on); }
.filters .facet--switch.is-on .switch::after { inset-inline-start: 23px; background: #fff; }

@media (prefers-reduced-motion: reduce) {
    .filters .facet__chev, .filters .switch, .filters .switch::after, .filters .ctile__sw { transition: none; }
}
