/**
 * Adilis Faceted Search - front.
 *
 * Self-contained: the module brings its own markup (`adfs-*` classes) and does not rely on the styles of the theme
 * (no Bootstrap, no Material font for the controls). Restyle by overriding the custom properties below
 * (--adfs-font-size is the base size, 16px, whatever the root font size of the theme).
 */
:root {
  --adfs-primary: #0a5bd6;
  --adfs-primary-contrast: #fff;
  --adfs-slider: #2fb5d2;
  --adfs-text: inherit;
  --adfs-muted: #6c757d;
  --adfs-border: #dee2e6;
  --adfs-field-border: #ced4da;
  --adfs-track: #d9d9d9;
  --adfs-pill: #111;
  --adfs-star: #111;
  --adfs-bg: #fff;
  --adfs-font-size: 16px;
  --adfs-radius: 4px;
  --adfs-thumb-size: 18px;
  --adfs-scrollbar: #c3c9d3;
  --adfs-scrollbar-hover: #8d95a3;
  --adfs-focus-ring: rgba(10, 91, 214, 0.35);
  --adfs-drawer-width: 420px;
  --adfs-z: 1050;
}

.adfs-filters,
.adfs-filters *,
.adfs-filters *::before,
.adfs-filters *::after,
.adfs-panel *,
.adfs-active *,
.adfs-active *::before,
.adfs-active *::after {
  box-sizing: border-box;
}

.adfs-filters {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--adfs-text);
  line-height: 1.5;
}

/* Sizes are in em from this base in px: the module looks the same whatever the root font size of the theme. */
.adfs-filters,
.adfs-panel,
.adfs-active {
  font-size: var(--adfs-font-size);
}

.adfs-filters ul,
.adfs-active ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.adfs-filters li,
.adfs-active li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.adfs-filters p {
  margin: 0;
}

.adfs-svg {
  flex: 0 0 auto;
  vertical-align: middle;
}

.adfs-title {
  margin: 0 0 1em;
  font-size: 1.25em;
  font-weight: 400;
  line-height: 1.3;
}

/* ---- Buttons ---- */
.adfs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin: 0;
  padding: 0.5em 1em;
  border: 1px solid transparent;
  border-radius: var(--adfs-radius);
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.adfs-btn[hidden] {
  display: none;
}

.adfs-btn-primary {
  border-color: var(--adfs-primary);
  background: var(--adfs-primary);
  color: var(--adfs-primary-contrast);
}

.adfs-btn-primary:hover:not(:disabled) {
  filter: brightness(0.92);
}

.adfs-btn-primary:disabled {
  cursor: default;
  opacity: 0.55;
}

.adfs-btn-outline {
  border-color: var(--adfs-field-border);
  background: var(--adfs-bg);
  color: inherit;
}

.adfs-btn-outline:hover {
  border-color: #adb5bd;
  background: #f8f9fa;
}

.adfs-btn:focus-visible,
.adfs-more:focus-visible,
.adfs-chip:focus-visible,
.adfs-drawer-close:focus-visible {
  outline: 2px solid var(--adfs-primary);
  outline-offset: 2px;
}

.adfs-facet-head:focus-visible {
  outline: 2px solid var(--adfs-primary);
  outline-offset: -2px;
  border-radius: var(--adfs-radius);
}

.adfs-clear {
  margin: 0.5rem 0 1em;
}

.adfs-apply {
  width: 100%;
  margin-top: 0.75em;
}

/* ---- Facets (accordion) ---- */
.adfs-facet {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--adfs-border);
}

.adfs-facets > .adfs-facet:last-child {
  border-bottom: 0;
}

.adfs-facet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  width: 100%;
  margin: 0;
  padding: 0.5em 0;
  border: 0;
  background: none;
  color: var(--adfs-primary);
  cursor: pointer;
  font: inherit;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
}

.adfs-facet-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

.adfs-chevron {
  flex: 0 0 auto;
  width: 0.55em;
  height: 0.55em;
  margin: 0 0.2em 0.2em;
  border: solid #212529;
  border-width: 0 2px 2px 0;
  transform: rotate(225deg);
  transition: transform 0.15s;
}

.adfs-collapsed > .adfs-facet-head .adfs-chevron {
  margin-bottom: 0.2em;
  transform: rotate(45deg);
}

.adfs-collapsed > .adfs-facet-body {
  display: none;
}

.adfs-facet-body {
  padding: 0.5em 0 0.75em;
}

.adfs-facet-count {
  display: none;
}

.adfs-icon {
  font-size: 1.25em;
}

.adfs-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* ---- Lists of values ---- */
.adfs-list-scroll {
  max-height: calc(var(--adfs-scroll-rows, 8) * 2.2em);
  overflow-y: auto;
}

.adfs-list li.adfs-extra {
  display: none;
}

.adfs-list.adfs-expanded li.adfs-extra {
  display: list-item;
}

.adfs-row {
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-height: 1.5em;
  margin: 0 0 0.125em;
  padding: 0;
  cursor: pointer;
  font-weight: 400;
}

.adfs-row.adfs-disabled,
.adfs-disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.adfs-value {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

a.adfs-value:hover {
  color: inherit;
  text-decoration: none;
}

.adfs-count {
  color: var(--adfs-muted);
}

/* Check box (native input, drawn by the module). */
.adfs-check {
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  margin: 0;
  border: 1px solid #adb5bd;
  border-radius: 3px;
  background: #fff center / 80% no-repeat;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.adfs-check:checked {
  border-color: var(--adfs-primary);
  background-color: var(--adfs-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3E%3C/svg%3E");
}

.adfs-check:focus-visible {
  box-shadow: 0 0 0 0.2em var(--adfs-focus-ring);
  outline: 0;
}

.adfs-check:disabled {
  cursor: not-allowed;
}

/* Search box above a long list of values, and the text fields in general. */
.adfs-search {
  display: block;
  width: 100%;
  margin: 0 0 0.5em;
  padding: 0.375em 0.75em;
  border: 1px solid var(--adfs-field-border);
  border-radius: var(--adfs-radius);
  background: var(--adfs-bg);
  color: inherit;
  font: inherit;
  line-height: 1.5;
}

.adfs-search:focus {
  border-color: var(--adfs-primary);
  box-shadow: 0 0 0 0.2em var(--adfs-focus-ring);
  outline: 0;
}

/* "Show more". */
.adfs-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0.25em 0 0;
  padding: 0.25em 0;
  border: 0;
  background: none;
  color: var(--adfs-primary);
  cursor: pointer;
  font: inherit;
  font-size: 0.875em;
  font-weight: 400;
}

.adfs-more::after {
  width: 0.4em;
  height: 0.4em;
  margin-top: -0.2em;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  content: '';
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.adfs-more[aria-expanded='true']::after {
  margin-top: 0.2em;
  transform: rotate(-135deg);
}

.adfs-more:hover {
  text-decoration: underline;
}

/* Colour swatches. */
.adfs-swatch {
  flex: 0 0 auto;
  width: 1.5em;
  height: 1.5em;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background-color: var(--adfs-track);
}

.adfs-row--color .adfs-check {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.adfs-row--color {
  position: relative;
  margin-bottom: 0.3em;
}

.adfs-row--color.active .adfs-swatch {
  box-shadow: 0 0 0 1px #fff, 0 0 0 2px var(--adfs-pill);
}

.adfs-row--color:focus-within .adfs-swatch {
  outline: 2px solid var(--adfs-primary);
  outline-offset: 3px;
}

.adfs-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.adfs-swatches .adfs-row {
  padding: 0;
}

.adfs-swatches .adfs-value {
  flex: none;
}

.adfs-live,
.adfs-swatches .adfs-name,
.adfs-swatches .adfs-count {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Pills ("buttons") and pictures: the native control stays focusable but invisible. */
.adfs-pills,
.adfs-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.adfs-pills li,
.adfs-images li {
  position: relative;
}

.adfs-pills .adfs-check,
.adfs-images .adfs-check {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.adfs-pills .adfs-row {
  gap: 0.35em;
  min-height: 0;
  padding: 0.35em 0.85em;
  border: 1px solid var(--adfs-track);
  border-radius: 999px;
  font-size: 0.875em;
  line-height: 1.2;
  transition: border-color 0.15s, background-color 0.15s;
}

.adfs-pills .adfs-row:hover {
  border-color: var(--adfs-pill);
}

.adfs-pills .adfs-row.active {
  border-color: var(--adfs-pill);
  background: var(--adfs-pill);
  color: #fff;
}

.adfs-pills .adfs-row.active .adfs-count {
  color: inherit;
  opacity: 0.75;
}

.adfs-pills .adfs-row:focus-within,
.adfs-images .adfs-row:focus-within {
  outline: 2px solid var(--adfs-pill);
  outline-offset: 2px;
}

.adfs-images .adfs-row {
  min-height: 0;
  padding: 0.35em 0.6em;
  border: 1px solid var(--adfs-track);
  border-radius: 6px;
}

.adfs-images .adfs-row.active {
  border-color: var(--adfs-pill);
  box-shadow: 0 0 0 1px var(--adfs-pill);
}

.adfs-images .adfs-value-img {
  width: 40px;
  height: 40px;
  margin: 0;
}

.adfs-images li.adfs-has-image .adfs-name,
.adfs-images li.adfs-has-image .adfs-count {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Icon of a value (picture or Material icon). */
.adfs-value-img {
  width: 20px;
  height: 20px;
  margin-right: 0.35em;
  object-fit: contain;
  vertical-align: middle;
}

.adfs-value-icon {
  margin-right: 0.25em;
  font-size: 1.15em;
  vertical-align: middle;
}

/* Levels of the categories filter. */
.adfs-level-2 { padding-left: 1em; }
.adfs-level-3 { padding-left: 2em; }
.adfs-level-4 { padding-left: 3em; }
.adfs-level-5 { padding-left: 4em; }

.adfs-pills .adfs-level-2,
.adfs-pills .adfs-level-3,
.adfs-pills .adfs-level-4,
.adfs-pills .adfs-level-5 {
  padding-left: 0;
}

/* ---- Price slider: two native range inputs stacked on a common track ---- */
.adfs-slider-label {
  margin: 0 0 0.25em;
}

.adfs-slider-inputs {
  position: relative;
  height: calc(var(--adfs-thumb-size) + 6px);
  margin: 0.5em 0.25em;
}

.adfs-slider-inputs::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: var(--adfs-track);
  content: '';
}

.adfs-range {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.adfs-range::-webkit-slider-runnable-track {
  background: transparent;
  -webkit-appearance: none;
}

.adfs-range::-moz-range-track {
  background: transparent;
}

.adfs-range::-webkit-slider-thumb {
  width: var(--adfs-thumb-size);
  height: var(--adfs-thumb-size);
  border: 0;
  border-radius: 50%;
  background: var(--adfs-slider);
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
}

.adfs-range::-moz-range-thumb {
  width: var(--adfs-thumb-size);
  height: var(--adfs-thumb-size);
  border: 0;
  border-radius: 50%;
  background: var(--adfs-slider);
  cursor: pointer;
  pointer-events: auto;
}

.adfs-range:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--adfs-slider);
  outline-offset: 2px;
}

.adfs-range:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--adfs-slider);
  outline-offset: 2px;
}

/* Price ranges ("up to 15", "from 15 to 25", "70 and up"). */
.adfs-ranges {
  margin-top: 0.5em;
}

.adfs-range-link {
  display: inline-block;
  padding: 0.3em 0;
  color: inherit;
  text-decoration: none;
}

.adfs-range-link:hover {
  color: inherit;
  text-decoration: underline;
}

.adfs-range-link.active {
  font-weight: 700;
}

/* ---- Switch ---- */
.adfs-switch {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin: 0;
  cursor: pointer;
  font-weight: 400;
}

.adfs-switch.adfs-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.adfs-switch-input {
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  opacity: 0;
}

.adfs-switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 2.1em;
  height: 1.2em;
  border-radius: 1.2em;
  background: #bfc4ca;
  transition: background-color 0.15s;
}

.adfs-switch-track::after {
  position: absolute;
  top: 0.15em;
  left: 0.15em;
  width: 0.9em;
  height: 0.9em;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  content: '';
  transition: transform 0.15s;
}

.adfs-switch-input:checked + .adfs-switch-track {
  background: var(--adfs-primary);
}

.adfs-switch-input:checked + .adfs-switch-track::after {
  transform: translateX(0.9em);
}

.adfs-switch-input:focus-visible + .adfs-switch-track {
  outline: 2px solid var(--adfs-primary);
  outline-offset: 2px;
}

/* ---- Rating: five stars (N filled) followed by "and up", the whole row is the control ---- */
.adfs-stars-row {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0;
  padding: 0.15em 0;
  cursor: pointer;
}

.adfs-stars-row.adfs-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.adfs-stars-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  overflow: hidden;
}

.adfs-stars {
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.25em;
  letter-spacing: 0.05em;
  line-height: 1;
}

.adfs-star {
  color: var(--adfs-track);
}

.adfs-star.on {
  color: var(--adfs-star);
}

.adfs-stars-row.active .adfs-stars-text {
  font-weight: 700;
}

.adfs-stars-row:focus-within {
  outline: 2px solid var(--adfs-primary);
  outline-offset: 2px;
}

/* ---- Drop-down list (Tom Select, loaded on demand) ---- */
.adfs-select {
  display: block;
  width: 100%;
  padding: 0.4em 0.75em;
  border: 1px solid var(--adfs-field-border);
  border-radius: var(--adfs-radius);
  background: var(--adfs-bg);
  color: inherit;
  font: inherit;
}

.adfs-select-wrap {
  margin-bottom: 0.25em;
}

.adfs-filters .ts-control {
  min-height: 2.4em;
  padding: 0.35em 0.75em;
  border: 1px solid var(--adfs-field-border);
  border-radius: var(--adfs-radius);
  background-color: var(--adfs-bg);
  box-shadow: none;
  color: inherit;
  font-size: 1em;
  gap: 0.25em;
  line-height: 1.5;
}

.adfs-filters .ts-wrapper.multi.has-items .ts-control {
  padding: 0.3em 0.5em;
}

.adfs-filters .ts-wrapper.focus .ts-control {
  border-color: var(--adfs-primary);
  box-shadow: 0 0 0 0.2em var(--adfs-focus-ring);
}

.adfs-filters .ts-control input {
  color: inherit;
  font-size: inherit;
}

.adfs-filters .ts-wrapper.multi .ts-control > div,
.adfs-filters .ts-wrapper.multi .ts-control > div.active {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.2em 0.65em 0.2em 0.75em;
  border: 0;
  border-radius: 999px;
  background: var(--adfs-pill);
  color: #fff;
  font-size: 0.875em;
  line-height: 1.4;
}

.adfs-filters .ts-wrapper.plugin-remove_button .item .remove,
.adfs-filters .ts-wrapper.plugin-remove_button .item.active .remove,
.adfs-filters .ts-wrapper.plugin-remove_button .item .remove:focus,
.adfs-filters .ts-wrapper.plugin-remove_button .item .remove:hover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  margin-left: 0.1em;
  padding: 0 0 0.1em;
  border: 0;
  border-left: 0 !important;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #fff;
  font-size: 1.25em;
  line-height: 1;
  outline: 0;
  text-decoration: none;
}

.adfs-filters .ts-wrapper.plugin-remove_button .item .remove:hover {
  opacity: 0.65;
}

.adfs-filters .ts-dropdown {
  z-index: 1000;
  margin-top: 0.25em;
  border: 1px solid var(--adfs-field-border);
  border-radius: var(--adfs-radius);
  box-shadow: 0 0.25em 0.75em rgba(0, 0, 0, 0.1);
  font-size: 1em;
  overflow: hidden;
}

.adfs-filters .ts-dropdown .option {
  padding: 0.4em 0.75em;
}

.adfs-filters .ts-dropdown .active {
  background: #f0f0f0;
  color: inherit;
}

/* ---- Scroll bars (scrolling lists, drawer, drop-down lists of the horizontal bar): thin, rounded, no track ---- */
.adfs-list-scroll,
.adfs-drawer-body,
.adfs-layout-horizontal .adfs-facet-body {
  scrollbar-color: var(--adfs-scrollbar) transparent;
  scrollbar-width: thin;
}

.adfs-list-scroll::-webkit-scrollbar,
.adfs-drawer-body::-webkit-scrollbar,
.adfs-layout-horizontal .adfs-facet-body::-webkit-scrollbar {
  width: 8px;
}

.adfs-list-scroll::-webkit-scrollbar-track,
.adfs-drawer-body::-webkit-scrollbar-track,
.adfs-layout-horizontal .adfs-facet-body::-webkit-scrollbar-track {
  background: transparent;
}

.adfs-list-scroll::-webkit-scrollbar-thumb,
.adfs-drawer-body::-webkit-scrollbar-thumb,
.adfs-layout-horizontal .adfs-facet-body::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--adfs-scrollbar) padding-box;
}

.adfs-list-scroll::-webkit-scrollbar-thumb:hover,
.adfs-drawer-body::-webkit-scrollbar-thumb:hover,
.adfs-layout-horizontal .adfs-facet-body::-webkit-scrollbar-thumb:hover {
  background: var(--adfs-scrollbar-hover) padding-box;
}

/* ---- Active filters ---- */
.adfs-active {
  margin: 0;
  padding: 0;
  font-size: calc(var(--adfs-font-size) * 0.875);
}

.adfs-active ul.adfs-active-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
  margin: 0.5em 0 1em;
}

.adfs-active-title {
  margin-right: 0.25em;
  font-weight: 400;
}

.adfs-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25em 0.75em;
  border: 1px solid var(--adfs-field-border);
  border-radius: 999px;
  background: var(--adfs-bg);
  color: inherit;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.adfs-chip:hover {
  border-color: #adb5bd;
  background: #f8f9fa;
  color: inherit;
  text-decoration: none;
}

/* ---- Panel: in place on a wide screen, side drawer on a narrow one (or on every screen with the button) ---- */
.adfs-panel {
  position: relative;
}

.adfs-toggle,
.adfs-backdrop,
.adfs-drawer-head,
.adfs-drawer-footer {
  display: none;
}

.adfs-drawer-body {
  min-width: 0;
}

.adfs-drawer-clear[hidden] {
  display: none;
}

html.adfs-drawer-open {
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .adfs-panel[data-adfs-panel] .adfs-toggle {
    display: inline-flex;
  }
}

.adfs-panel--always .adfs-toggle {
  display: inline-flex;
}

/* The theme has its own "Filter" button: the script hides ours and opens the drawer from the theme's one. */
html.adfs-themed-toggler .adfs-toggle {
  display: none !important;
}

/* Drawer mode. */
@media (max-width: 767.98px) {
  .adfs-panel .adfs-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: calc(var(--adfs-z) + 1);
    display: flex;
    flex-direction: column;
    width: min(var(--adfs-drawer-width), 92vw);
    max-width: 100%;
    background: var(--adfs-bg);
    box-shadow: 0 0 2em rgba(0, 0, 0, 0.25);
    outline: 0;
    transform: translateX(-105%);
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
    visibility: hidden;
  }

  .adfs-panel.adfs-open .adfs-drawer {
    transform: none;
    transition: transform 0.25s ease;
    visibility: visible;
  }

  .adfs-panel .adfs-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--adfs-z);
    display: block;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }

  .adfs-panel.adfs-open .adfs-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .adfs-panel .adfs-drawer-head {
    display: flex;
  }

  .adfs-panel .adfs-drawer-footer {
    display: flex;
  }

  .adfs-panel .adfs-drawer-body {
    flex: 1 1 auto;
    padding: 0 1em 1em;
    overflow-y: auto;
  }

  .adfs-drawer .adfs-title,
  .adfs-drawer .adfs-clear {
    display: none;
  }
}

@media (min-width: 768px) {
  .adfs-panel--always .adfs-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: calc(var(--adfs-z) + 1);
    display: flex;
    flex-direction: column;
    width: min(var(--adfs-drawer-width), 92vw);
    background: var(--adfs-bg);
    box-shadow: 0 0 2em rgba(0, 0, 0, 0.25);
    outline: 0;
    transform: translateX(-105%);
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
    visibility: hidden;
  }

  .adfs-panel--always.adfs-open .adfs-drawer {
    transform: none;
    transition: transform 0.25s ease;
    visibility: visible;
  }

  .adfs-panel--always .adfs-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--adfs-z);
    display: block;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }

  .adfs-panel--always.adfs-open .adfs-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .adfs-panel--always .adfs-drawer-head,
  .adfs-panel--always .adfs-drawer-footer {
    display: flex;
  }

  .adfs-panel--always .adfs-drawer-body {
    flex: 1 1 auto;
    padding: 0 1em 1em;
    overflow-y: auto;
  }

  .adfs-panel--always .adfs-drawer .adfs-title,
  .adfs-panel--always .adfs-drawer .adfs-clear {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .adfs-panel .adfs-drawer,
  .adfs-panel .adfs-backdrop {
    transition: none;
  }
}

.adfs-drawer-head {
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: 1em;
  border-bottom: 1px solid var(--adfs-border);
}

.adfs-drawer-title {
  margin: 0;
  font-size: 1em;
  font-weight: 400;
  line-height: 1.2;
}

.adfs-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.25em;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
}

.adfs-drawer-close:hover {
  opacity: 1;
}

.adfs-drawer-footer {
  flex: 0 0 auto;
  gap: 0.5em;
  padding: 0.75em 1em;
  border-top: 1px solid var(--adfs-border);
  background: var(--adfs-bg);
}

.adfs-drawer-footer .adfs-btn {
  flex: 1 1 0;
}

/* ---- Horizontal layout (wide screens): one button per filter, its values in a drop-down list ---- */
@media (min-width: 768px) {
  .adfs-panel--horizontal:not(.adfs-panel--always) .adfs-filters,
  .adfs-layout-horizontal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
  }

  .adfs-layout-horizontal {
    margin-bottom: 1em;
  }

  .adfs-layout-horizontal .adfs-title {
    display: none;
  }

  .adfs-layout-horizontal .adfs-clear {
    margin: 0;
  }

  .adfs-layout-horizontal .adfs-facets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
  }

  .adfs-layout-horizontal .adfs-facet {
    position: relative;
    width: auto;
    border: 0;
  }

  .adfs-layout-horizontal .adfs-facet-head {
    width: auto;
    padding: 8px 16px;
    border: 1px solid var(--adfs-field-border);
    border-radius: 999px;
    background: var(--adfs-bg);
    color: inherit;
    font-size: 0.9375em;
    font-weight: 400;
    gap: 8px;
  }

  .adfs-layout-horizontal .adfs-facet--active > .adfs-facet-head,
  .adfs-layout-horizontal .adfs-facet:not(.adfs-collapsed) > .adfs-facet-head {
    border-color: #111;
  }

  .adfs-layout-horizontal .adfs-facet-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
  }

  /* Before the script has run (front.js is deferred) every list would show open: they stay closed until it is ready. */
  .adfs-layout-horizontal:not([data-adfs-ready]) .adfs-facet-body {
    display: none;
  }

  .adfs-layout-horizontal:not([data-adfs-ready]) .adfs-chevron {
    margin-bottom: 0.2em;
    transform: rotate(45deg);
  }

  .adfs-layout-horizontal:not([data-adfs-ready]) .adfs-facet:not(.adfs-facet--active) > .adfs-facet-head {
    border-color: var(--adfs-field-border);
  }

  @keyframes adfs-pop {
    0% {
      opacity: 0;
      transform: translateY(-6px);
    }

    100% {
      opacity: 1;
      transform: none;
    }
  }

  .adfs-layout-horizontal .adfs-facet > .adfs-facet-body {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 260px;
    max-width: 340px;
    max-height: 360px;
    padding: 12px 16px;
    border: 1px solid #111;
    border-radius: 12px;
    background: var(--adfs-bg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    overflow: auto;
  }

  .adfs-layout-horizontal .adfs-facet:not(.adfs-collapsed) > .adfs-facet-body {
    animation: adfs-pop 0.16s ease-out;
  }

  .adfs-layout-horizontal .adfs-facet:not(.adfs-collapsed) > .adfs-facet-body.adfs-quiet {
    animation: none;
  }

  /* No scroll bar until the opening animation is over (it would flash otherwise), and only on hover. */
  .adfs-layout-horizontal .adfs-facet > .adfs-facet-body.adfs-opening {
    overflow: hidden;
  }

  .adfs-layout-horizontal .adfs-facet-body {
    scrollbar-color: transparent transparent;
  }

  .adfs-layout-horizontal .adfs-facet-body:hover {
    scrollbar-color: var(--adfs-scrollbar) transparent;
  }

  .adfs-layout-horizontal .adfs-facet-body::-webkit-scrollbar-thumb {
    background: transparent padding-box;
  }

  .adfs-layout-horizontal .adfs-facet-body:hover::-webkit-scrollbar-thumb {
    background: var(--adfs-scrollbar) padding-box;
  }

  .adfs-layout-horizontal .adfs-apply {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
  }

  @media (prefers-reduced-motion: reduce) {
    .adfs-layout-horizontal .adfs-facet:not(.adfs-collapsed) > .adfs-facet-body {
      animation: none;
    }
  }
}

/* Filters in a drawer on every screen: the "Filter" button of the theme, hidden on desktop, shows up. */
html.adfs-panel-always .js-search-toggler {
  display: inline-flex !important;
}

/* Classic sets "label { text-align: right }"; #search_filters is Classic's root id only. */
#search_filters .adfs-row,
#search_filters .adfs-stars-row,
#search_filters .adfs-switch {
  text-align: left;
}

/* Classic only: no focus outline on the facet title buttons. */
#search_filters .adfs-facet-head:focus,
#search_filters .adfs-facet-head:focus-visible {
  outline: 0;
}

/* Classic only: its "label" rule sets font-size/color on the label itself, which beats inheritance. */
#search_filters .adfs-row,
#search_filters .adfs-stars-row,
#search_filters .adfs-switch {
  font-size: 1em;
  color: inherit;
}

#search_filters .adfs-pills .adfs-row {
  font-size: 0.875em;
}

#search_filters .adfs-pills .adfs-row.active {
  color: #fff;
}

/* Classic only: no focus outline on swatches, pills and images. */
#search_filters .adfs-row--color:focus-within .adfs-swatch,
#search_filters .adfs-pills .adfs-row:focus-within,
#search_filters .adfs-images .adfs-row:focus-within {
  outline: 0;
}

/* Classic only: its "Filter" button sits in a ".hidden-md-up" wrapper, hidden on desktop. */
html.adfs-panel-always .filter-button.hidden-md-up {
  display: block !important;
}
