/*!
 * Spark Power Filters - preset "Spark" (default look)
 * Light, fresh SaaS-blue look: white panel cards, kingsblue accent, crisp pill
 * choice language and a solid-accent selected-row moment.
 *
 * Specificity policy: every selector below is a single class (or a single data-attribute),
 * so anything a site builder sets in the Breakdance/Divi tree still wins. No IDs, no
 * priority overrides anywhere in this file.
 */

/* -----------------------------------------------------------------------
   1. Tokens - redefine the Design\Tokens.php custom properties for this look.
   ----------------------------------------------------------------------- */

.spf-facet {
  --spf-text-color: #334155;
  --spf-muted-color: #64748b;
  --spf-gap: 0.5rem;

  --spf-choice-size: 1.125rem;
  --spf-choice-accent: var(--bde-brand-primary-color, #2563eb);
  --spf-choice-border: #cbd5e1;

  --spf-swatch-size: 1.375rem;
  --spf-swatch-radius: 999px;
  --spf-swatch-border: rgba(15, 23, 42, 0.12);

  --spf-range-track: #e2e8f0;
  --spf-range-fill: var(--spf-choice-accent, #2563eb);
  --spf-range-thumb-size: 1.125rem;

  --spf-group-divider: #e5eaf3;
  --spf-group-title-color: #0f172a;

  --spf-utility-bg: #ffffff;

  --spf-focus-color: var(--spf-choice-accent, #2563eb);
  --spf-focus-width: 2px;

  /* Local, Spark-only decoration tokens (not in the frozen Tokens.php list). */
  --spf-card-bg: #ffffff;
  --spf-card-border: #e5eaf3;
  --spf-card-radius: 12px;
  --spf-card-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  --spf-choice-accent-pastel: rgba(37, 99, 235, 0.08);
}

[data-sf-drawer-enabled="1"] {
  --spf-drawer-bg: #ffffff;
  --spf-drawer-width: min(92vw, 26rem);
  --spf-card-radius: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .spf-facet,
  .spf-facet *,
  [data-sf-drawer-enabled="1"],
  [data-sf-drawer-enabled="1"] * {
    transition: none;
  }
}

/* -----------------------------------------------------------------------
   2. Facet card shell (fieldset.spf-facet / div.spf-facet-dropdown).
   ----------------------------------------------------------------------- */

.spf-facet {
  background: var(--spf-card-bg);
  border: 1px solid var(--spf-card-border);
  border-radius: var(--spf-card-radius);
  box-shadow: var(--spf-card-shadow);
  padding: 1.125rem;
  margin: 0 0 0.875rem;
  color: var(--spf-text-color);
}

.spf-facet-dropdown {
  background: var(--spf-card-bg);
  border: 1px solid var(--spf-card-border);
  border-radius: var(--spf-card-radius);
  box-shadow: var(--spf-card-shadow);
  padding: 1.125rem;
  margin: 0 0 0.875rem;
  color: var(--spf-text-color);
}

.spf-facet-legend {
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--spf-group-title-color);
  margin: 0 0 0.75rem;
  padding: 0 1.125rem 0 0;
  display: block;
  float: left;
  width: 100%;
  position: relative;
  cursor: pointer;
}

/* Chevron, drawn with a rotated border-corner instead of an svg. Points down when the
   facet is open, flips to point right when .spf-collapsed is set on the facet. */
.spf-facet-legend::after {
  content: "";
  position: absolute;
  right: 0.125rem;
  top: 0.2em;
  width: 0.5rem;
  height: 0.5rem;
  border: solid var(--spf-muted-color);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.spf-collapsed .spf-facet-legend::after {
  transform: rotate(-45deg);
}

.spf-facet-legend + * {
  clear: both;
}

.spf-facet input,
.spf-facet select {
  max-width: 100%;
  box-sizing: border-box;
}

.spf-options {
  clear: both;
  display: flex;
  flex-direction: column;
  gap: var(--spf-gap);
}

/* Collapsed state: only the legend stays visible, everything else in the facet body
   is hidden. Kept as a list of low-specificity descendant selectors rather than a
   ":not(legend)" catch-all so builder markup can still add its own children safely. */
.spf-collapsed .spf-options,
.spf-collapsed .spf-price-range,
.spf-collapsed .spf-number-range,
.spf-collapsed .spf-swatches,
.spf-collapsed .spf-pills,
.spf-collapsed .spf-show-more,
.spf-collapsed .spf-price-reset {
  display: none;
}

/* -----------------------------------------------------------------------
   3. Choice controls: checkbox and radio option rows.
   ----------------------------------------------------------------------- */

.spf-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  color: var(--spf-text-color);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.spf-option:hover {
  background: #f8fafc;
}

/* appearance:none on the input itself keeps it in the a11y/focus/click tree while
   letting us draw a fully custom shape; the checkmark is painted with ::after.
   display:inline-grid + place-content:center centers that ::after both axes with no
   absolute-position offsets to hand-tune. */
.spf-option input[type="checkbox"],
.spf-option input[type="radio"],
.spf-pill input[type="checkbox"],
.spf-pill input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  width: var(--spf-choice-size);
  height: var(--spf-choice-size);
  flex: none;
  margin: 0;
  border: 1.5px solid var(--spf-choice-border);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.spf-option input[type="checkbox"] {
  border-radius: 5px;
}

.spf-option input[type="radio"] {
  border-radius: 999px;
}

.spf-option input[type="checkbox"]:checked,
.spf-option input[type="radio"]:checked {
  background: var(--spf-choice-accent);
  border-color: var(--spf-choice-accent);
}

.spf-option input[type="checkbox"]::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 0.15s ease;
}

.spf-option input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}

.spf-option input[type="radio"]::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #fff;
  transform: scale(0);
  transition: transform 0.15s ease;
}

.spf-option input[type="radio"]:checked::after {
  transform: scale(1);
}

.spf-option input:focus-visible,
.spf-pill input:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
}

.spf-option input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--spf-choice-border);
}

/* Selected option row: the characteristic Spark moment. The whole row turns a soft
   accent-pastel, the label goes bold accent, and the count pill turns solid accent. */
.spf-option:has(input:checked) {
  background: var(--spf-choice-accent-pastel);
}

.spf-option:has(input:checked) .spf-option-label {
  color: var(--spf-choice-accent);
  font-weight: 700;
}

.spf-option:has(input:checked) .spf-count {
  background: var(--spf-choice-accent);
  color: #fff;
}

.spf-option-label {
  flex: 1 1 auto;
}

.spf-count {
  flex: none;
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.125rem 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.spf-show-more {
  appearance: none;
  background: none;
  border: none;
  padding: 0.5rem 0 0;
  margin-top: 0.125rem;
  color: var(--spf-choice-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: opacity 0.15s ease;
}

.spf-show-more::after {
  content: "";
  width: 0.4em;
  height: 0.4em;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.spf-show-more[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

.spf-show-more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.spf-show-more:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
}

/* Hierarchical mode (Checkbox 'hierarchical' option): a thin connecting guide line traces
   each nested level, in the same soft divider tone the facet legend/group chrome already
   uses elsewhere -- a subtle cue, not a redesign of the option row itself. */
.spf-choice-children {
  border-left: 1.5px solid var(--spf-group-divider);
  padding-left: 1rem;
}

/* -----------------------------------------------------------------------
   4. Color swatches - ring effect on selection.
   ----------------------------------------------------------------------- */

.spf-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.spf-swatch-option {
  cursor: pointer;
  display: inline-flex;
  border-radius: var(--spf-swatch-radius);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.spf-swatch-option:hover {
  transform: translateY(-1px);
}

.spf-swatch-option:has(input:checked) {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--spf-choice-accent);
}

.spf-swatch-option:has(input:focus-visible) {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
}

.spf-swatch {
  width: var(--spf-swatch-size);
  height: var(--spf-swatch-size);
  border-radius: var(--spf-swatch-radius);
  border: 1px solid var(--spf-swatch-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--spf-text-color);
}

/* -----------------------------------------------------------------------
   5. Pills (buttons widget).
   ----------------------------------------------------------------------- */

.spf-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.spf-pill {
  border: 1px solid var(--spf-choice-border);
  border-radius: 999px;
  padding: 0.375rem 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 600;
}

.spf-pill:hover {
  border-color: var(--spf-choice-accent);
}

.spf-pill:has(input:checked) {
  background: var(--spf-choice-accent-pastel);
  border-color: var(--spf-choice-accent);
  color: var(--spf-choice-accent);
}

.spf-pill-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* -----------------------------------------------------------------------
   6. Price range / number range inputs.
   ----------------------------------------------------------------------- */

.spf-price-range,
.spf-number-range {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.spf-price-input,
.spf-number-input {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--spf-muted-color);
  flex: 1 1 6rem;
}

.spf-price-input input,
.spf-number-input input {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--spf-text-color);
  transition: border-color 0.15s ease;
}

.spf-price-input input:hover,
.spf-number-input input:hover {
  border-color: #cbd5e1;
}

.spf-price-input input:focus-visible,
.spf-number-input input:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
  border-color: var(--spf-choice-accent);
}

.spf-price-input input:disabled,
.spf-number-input input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spf-price-tax-note {
  font-size: 0.75rem;
  color: var(--spf-muted-color);
  flex: 1 0 100%;
}

/* Dual-range price slider, built by sf-preset-extras.js on top of the original
   .spf-price-input labels. Those labels stay in the DOM (a screen reader and a
   no-js fallback still need them) but are visually hidden once the slider is live. */
.spf-price-range.has-slider .spf-price-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.spf-slider-bounds {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.75rem;
  color: var(--spf-muted-color);
}

.spf-slider {
  position: relative;
  width: 100%;
  height: 20px;
}

.spf-slider-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  transform: translateY(-50%);
  background: #e2e8f0;
  border-radius: 999px;
}

.spf-slider-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--spf-choice-accent);
}

.spf-slider-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none;
}

.spf-slider-thumb::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--spf-choice-accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  cursor: pointer;
}

.spf-slider-thumb::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--spf-choice-accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  cursor: pointer;
}

/* outline does not render on range-thumb pseudo-elements in most engines, so the focus
   ring is drawn as a box-shadow instead. */
.spf-slider-thumb:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--spf-choice-accent) 30%, transparent);
}

.spf-slider-thumb:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--spf-choice-accent) 30%, transparent);
}

/* Selection readout drawn as a small badge/pill under the slider, matching the
   mockup's price badge. */
.spf-slider-selection {
  margin-top: 0.75rem;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--spf-text-color);
  background: #fff;
  border: 1px solid var(--spf-card-border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

.spf-number-submit {
  appearance: none;
  border: none;
  border-radius: 10px;
  background: var(--spf-choice-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.125rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.spf-number-submit:hover {
  opacity: 0.9;
}

.spf-number-submit:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
}

.spf-number-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* -----------------------------------------------------------------------
   7. Rating widget.
   ----------------------------------------------------------------------- */

.spf-rating-stars {
  color: #f5b942;
  letter-spacing: 0.05em;
}

/* -----------------------------------------------------------------------
   8. Dropdown / select.
   ----------------------------------------------------------------------- */

.spf-facet-dropdown select {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--spf-text-color);
  transition: border-color 0.15s ease;
}

.spf-facet-dropdown select:hover {
  border-color: #cbd5e1;
}

.spf-facet-dropdown select:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
  border-color: var(--spf-choice-accent);
}

/* -----------------------------------------------------------------------
   9. Utility row: search + sort.
   ----------------------------------------------------------------------- */

.spf-search,
.spf-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.spf-search-label,
.spf-sort-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--spf-muted-color);
}

.spf-search input[type="search"],
.spf-sort select {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  color: var(--spf-text-color);
  transition: border-color 0.15s ease;
}

.spf-search input[type="search"]:hover,
.spf-sort select:hover {
  border-color: #cbd5e1;
}

.spf-search input[type="search"]:focus-visible,
.spf-sort select:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
  border-color: var(--spf-choice-accent);
}

/* -----------------------------------------------------------------------
   10. Active filter chips.
   ----------------------------------------------------------------------- */

.spf-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.spf-chip {
  display: inline-flex;
}

.spf-chip-remove {
  appearance: none;
  border: none;
  background: var(--spf-choice-accent-pastel);
  border-radius: 999px;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--spf-choice-accent);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.spf-chip-remove:hover {
  background: var(--spf-choice-accent);
  color: #fff;
}

.spf-chip-remove:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
}

.spf-chips-empty {
  font-size: 0.8125rem;
  color: var(--spf-muted-color);
  list-style: none;
}

/* -----------------------------------------------------------------------
   11. Reset / apply / load more buttons (data-attribute selectors, not classes:
   these elements ship no class of their own in the PHP templates).
   ----------------------------------------------------------------------- */

[data-sf-reset],
[data-sf-apply],
[data-sf-load-more] {
  appearance: none;
  border: 1px solid var(--spf-choice-accent);
  background: #fff;
  border-radius: 10px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--spf-choice-accent);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

[data-sf-apply] {
  background: var(--spf-choice-accent);
  color: #fff;
}

[data-sf-reset]:hover,
[data-sf-load-more]:hover {
  background: var(--spf-choice-accent-pastel);
}

[data-sf-apply]:hover {
  opacity: 0.9;
}

[data-sf-reset]:focus-visible,
[data-sf-apply]:focus-visible,
[data-sf-load-more]:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
}

[data-sf-reset]:disabled,
[data-sf-apply]:disabled,
[data-sf-load-more]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Inline price-facet reset (Price Range 'show_reset' option): the SAME data-sf-reset click
   behaviour as the pill above, styled instead as the compact in-fieldset text action
   .spf-show-more already established, so it does not compete with the two number inputs it
   sits next to for visual weight. */
.spf-price-reset {
  appearance: none;
  background: none;
  border: none;
  padding: 0.5rem 0 0;
  margin-top: 0.125rem;
  color: var(--spf-choice-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.spf-price-reset:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* -----------------------------------------------------------------------
   12. Result count + pagination.
   ----------------------------------------------------------------------- */

[data-sf-result-count] {
  font-size: 0.875rem;
  color: var(--spf-muted-color);
  font-weight: 500;
}

[data-sf-result-count] strong {
  color: #0f172a;
  font-weight: 800;
}

[data-sf-pagination] {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-top: 1.125rem;
}

[data-sf-pagination] a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: var(--spf-text-color);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

[data-sf-pagination] a:hover {
  border-color: var(--spf-choice-accent);
  color: var(--spf-choice-accent);
}

[data-sf-pagination] a:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
}

.spf-page-current {
  background: var(--spf-choice-accent);
  border-color: var(--spf-choice-accent);
  color: #fff;
  font-weight: 700;
}

.spf-page-current:hover {
  background: var(--spf-choice-accent);
  color: #fff;
}

/* -----------------------------------------------------------------------
   13. Results list + empty state.
   ----------------------------------------------------------------------- */

.spf-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.spf-result-item a {
  color: var(--spf-text-color);
  text-decoration: none;
  transition: color 0.15s ease;
}

.spf-result-item a:hover {
  color: var(--spf-choice-accent);
}

.spf-result-item a:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
}

.spf-empty-results {
  color: var(--spf-muted-color);
  background: var(--spf-card-bg);
  border: 1px dashed var(--spf-card-border);
  border-radius: var(--spf-card-radius);
  padding: 2rem 1.5rem;
  text-align: center;
}

/* -----------------------------------------------------------------------
   14. Mobile drawer (assets/sf-drawer.js chrome).
   ----------------------------------------------------------------------- */

.spf-drawer-toggle {
  appearance: none;
  border: 1px solid var(--spf-card-border);
  background: #fff;
  border-radius: 10px;
  padding: 0.5rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--spf-text-color);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.spf-drawer-toggle:hover {
  border-color: var(--spf-choice-accent);
  color: var(--spf-choice-accent);
}

.spf-drawer-toggle:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
}

.spf-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  transition: opacity 0.2s ease;
  /* Stacking is owned by assets/spf-base.css: a preset repeating it here loaded later at
     equal specificity and quietly put the drawer back behind a theme's product grid. */
}

[data-sf-drawer-enabled="1"].spf-drawer-active {
  position: fixed;
  inset: 0 0 0 auto;
  width: var(--spf-drawer-width);
  max-width: 100vw;
  background: var(--spf-drawer-bg);
  border-radius: var(--spf-card-radius) 0 0 var(--spf-card-radius);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  /* Stacking is owned by assets/spf-base.css: a preset repeating it here loaded later at
     equal specificity and quietly put the drawer back behind a theme's product grid. */
  padding: 1.5rem;
  /* Closed drawer stays off-canvas AND unreachable by keyboard. */
  visibility: hidden;
}

[data-sf-drawer-enabled="1"].spf-drawer-active.spf-drawer-open {
  transform: translateX(0);
  visibility: visible;
}

.spf-drawer-header {
  display: flex;
  justify-content: flex-end;
  margin: -0.5rem -0.5rem 1rem auto;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--spf-card-border);
}

.spf-drawer-close {
  appearance: none;
  border: none;
  background: #f1f5f9;
  border-radius: 999px;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--spf-text-color);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.spf-drawer-close:hover {
  background: #e2e8f0;
}

.spf-drawer-close:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
}

.spf-drawer-sticky {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--spf-drawer-bg);
  border-top: 1px solid var(--spf-card-border);
  padding: 1rem 0 0;
  margin-top: 1.5rem;
}

.spf-drawer-apply {
  appearance: none;
  border: none;
  background: var(--spf-choice-accent);
  color: #fff;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.spf-drawer-apply:hover {
  opacity: 0.9;
}

.spf-drawer-apply:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  [data-sf-drawer-enabled="1"] .spf-facet,
  [data-sf-drawer-enabled="1"] .spf-facet-dropdown {
    box-shadow: none;
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 1rem 0;
  }
}

/* Drawer mode is owned by assets/sf-drawer.js: it mirrors the element's configured
   breakpoint into the spf-drawer-active class. CSS must never restate that breakpoint in a
   media query, or the panel goes off-canvas while the toggle stays hidden and the filters
   become unreachable at every width (live-caught on Lachlappen). */
.spf-drawer-toggle {
  display: none;
}

.spf-drawer-toggle.spf-drawer-active {
  display: inline-block;
}

[data-sf-drawer-enabled="1"]:not(.spf-drawer-active) .spf-drawer-header,
[data-sf-drawer-enabled="1"]:not(.spf-drawer-active) .spf-drawer-sticky {
  display: none;
}

/* -----------------------------------------------------------------------
   Product colour swatches (Woo\ProductSwatchShortcode, [spf_product_swatches]).
   Links to the sibling products that are the same item in another colour.
   Reuses .spf-swatch from the colour-swatch facet above, so the circle on a
   product page and the circle in the filter are styled by one rule set as
   well as resolved by one class (Woo\SwatchResolver).
   ----------------------------------------------------------------------- */

.spf-product-swatch-link {
  border-radius: var(--spf-swatch-radius);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.spf-product-swatch-link:hover {
  transform: translateY(-1px);
}

.spf-product-swatch-link:focus-visible {
  outline: 2px solid var(--spf-focus-color);
  outline-offset: 3px;
}

/* The colour being viewed. A ring rather than a colour change: the swatch itself
   already carries a colour, so the active state has to read as a shape. */
.spf-product-swatch.is-current .spf-product-swatch-link {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--spf-choice-accent);
  cursor: default;
}
