/**
 * xfaceted front styles.
 * Defaults below; BO (Appearance) overrides via --xf-* on body.xfaceted-active (#xfaceted-design-vars).
 */
body.xfaceted-active #search_filters.xfaceted-filters {
  --xf-accent: #111;
  --xf-border: #e8e8e8;
  --xf-radius: 10px;
  --xf-active-bg: rgba(0, 0, 0, 0.06);
  --xf-panel-bg: #fff;
  --xf-active-text: #fff;
  --xf-transition-duration: 220ms;
  --xf-transition-ease: ease;
}

body.xfaceted-active .xfaceted-filters .facet {
  border: 1px solid var(--xf-border);
  border-radius: var(--xf-radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--xf-panel-bg);
}

body.xfaceted-active .xfaceted-filters .facet-title,
body.xfaceted-active .xfaceted-offcanvas-panel .facet-title {
  color: inherit;
  font-weight: 600;
}

body.xfaceted-active .xfaceted-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

body.xfaceted-active .xfaceted-btn {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--xf-border);
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  font-size: 0.875rem;
  transition:
    background 150ms var(--xf-transition-ease, ease),
    border-color 150ms var(--xf-transition-ease, ease),
    color 150ms var(--xf-transition-ease, ease);
}

body.xfaceted-active .xfaceted-btn.active,
body.xfaceted-active .xfaceted-btn:hover {
  background: var(--xf-accent);
  border-color: var(--xf-accent);
  color: var(--xf-active-text);
}

body.xfaceted-active .xfaceted-filters .facet-label,
body.xfaceted-active .xfaceted-offcanvas-panel .facet-label {
  transition: background 150ms var(--xf-transition-ease, ease);
}

body.xfaceted-active .facet-label.active {
  background: var(--xf-active-bg);
  border-radius: calc(var(--xf-radius) * 0.6);
}

body.xfaceted-active .xfaceted-filters .facet-label.active .custom-checkbox input[type="checkbox"]:checked + span,
body.xfaceted-active .xfaceted-filters .facet-label.active input[type="checkbox"]:checked {
  opacity: 1;
}

body.xfaceted-active .xfaceted-offcanvas-panel .xfaceted-btn.active,
body.xfaceted-active .xfaceted-offcanvas-panel .facet-label.active {
  background: var(--xf-active-bg);
  border-radius: calc(var(--xf-radius) * 0.6);
}

/* jQuery UI price slider */
body.xfaceted-active .faceted-slider .ui-slider {
  border: 1px solid var(--xf-border);
  border-radius: var(--xf-radius);
  background: var(--xf-panel-bg);
}

body.xfaceted-active .faceted-slider .ui-slider-range {
  background: var(--xf-accent);
}

body.xfaceted-active .faceted-slider .ui-slider-handle {
  border-color: var(--xf-accent);
  background: var(--xf-accent);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

body.xfaceted-active .faceted-slider #facet_label_xfaceted-price-0,
body.xfaceted-active .faceted-slider [id^="facet_label_"] {
  margin-bottom: 0.5rem;
}

.xfaceted-offcanvas-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.xfaceted-offcanvas-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.xfaceted-offcanvas-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--xf-panel-bg, #fff);
  z-index: 1050;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 1rem;
  border-right: 1px solid var(--xf-border, #e8e8e8);
}

.xfaceted-offcanvas-panel.is-open {
  transform: translateX(0);
}

a.feds_offcanvas_tri[data-xfaceted-offcanvas] {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--xf-border, #e0e0e0);
  border-radius: var(--xf-radius, 8px);
  text-decoration: none;
}

/* AJAX filter update: dim listing + facets, then fade back in */
.xf-transition-target {
  transition: opacity var(--xf-transition-duration, 220ms) var(--xf-transition-ease, ease);
}

body.xf-faceted-busy .xf-transition-target {
  opacity: 0.35;
  pointer-events: none;
}

.xfaceted-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1035;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--xf-transition-duration, 220ms) var(--xf-transition-ease, ease);
}

body.xf-faceted-busy .xfaceted-loading-overlay {
  opacity: 1;
  pointer-events: auto;
}

.xfaceted-loading-overlay__spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--xf-border, #e8e8e8);
  border-top-color: var(--xf-accent, #111);
  border-radius: 50%;
  animation: xf-spin 0.8s linear infinite;
}

@keyframes xf-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .xf-transition-target,
  .xfaceted-loading-overlay,
  body.xfaceted-active .xfaceted-btn,
  body.xfaceted-active .xfaceted-filters .facet-label,
  body.xfaceted-active .xfaceted-offcanvas-panel .facet-label {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
