:root {
  --ff-primary-h: 174;
  --ff-primary-s: 80%;
  --ff-primary-l: 40%;
  --ff-accent-h: 222;
  --ff-accent-s: 47%;
  --ff-accent-l: 11%;
  --ff-base-h: 205;
  --ff-base-s: 24%;
  --ff-text-main-l: 12%;
  --ff-text-muted-l: 40%;
  --ff-border-l: 85%;
  --ff-text-xs: clamp(0.78rem, 0.76rem + 0.11vw, 0.84rem);
  --ff-text-s: clamp(0.94rem, 0.92rem + 0.11vw, 1rem);
  --ff-text-m: clamp(1.13rem, 1.08rem + 0.22vw, 1.25rem);
  --ff-text-l: clamp(1.35rem, 1.28rem + 0.37vw, 1.56rem);
  --ff-text-xl: clamp(1.62rem, 1.5rem + 0.58vw, 1.95rem);
  --ff-text-xxl: clamp(1.94rem, 1.77rem + 0.87vw, 2.44rem);
  --ff-space-xs: clamp(0.75rem, 0.69rem + 0.29vw, 0.94rem);
  --ff-space-s: clamp(1.13rem, 1.03rem + 0.43vw, 1.4rem);
  --ff-space-m: clamp(1.69rem, 1.55rem + 0.65vw, 2.1rem);
  --ff-space-l: clamp(2.53rem, 2.33rem + 0.97vw, 3.15rem);
  --ff-action-padding-y: 4px;
  --ff-action-padding-x: 10px;
  --ff-action-font-size: var(--ff-text-xs);
  --ff-action-letter-spacing: 0;
  --ff-filter-title-scale: 0.625;
  --ff-filter-title-transform: uppercase;
  --ff-filter-title-tracking: 0.06em;
  --ff-filter-sidebar-min: 260px;
  --ff-filter-sticky-top: 24px;
  /* Height of the soft edge that marks a pinned filter column as scrollable.
     Lives on :root because the SureCart sidebar that does the scrolling is an
     ancestor of .ivasure-wrap, where the --ff-* palette is declared. */
  --ff-filter-scroll-cue: 16px;
  /* Tint of that column's scrollbar thumb. A token, not currentColor: in the
     SureCart/Etch bridge the scroller is the sidebar itself, which sits
     OUTSIDE .ivasure-wrap and inherits whatever colour the theme happens to
     set - the exact assumption the --ff-text-main note below records as
     having stranded dark ink on a dark page. Overridden for both dark
     conventions this file already knows about, so the affordance survives
     the surface it is drawn on. */
  --ff-filter-scroll-thumb: hsl(var(--ff-base-h) var(--ff-base-s) var(--ff-text-muted-l) / 0.34);
  --ff-filter-motion: 150ms;
}

/* The thumb is consumed on the SureCart sidebar, an ANCESTOR of .ivasure-wrap,
   so its dark step has to be published above the panel rather than inside it -
   both of the dark conventions this file already recognises. */
html[data-ks-theme="dark"],
body.surecart-theme-dark {
  --ff-filter-scroll-thumb: hsl(var(--ff-base-h) var(--ff-base-s) 82% / 0.38);
}

.ivasure-wrap {
  /* --ks-brand* are printed once by core from the merchant design token,
     with the accessible step measured rather than guessed so white-on-brand
     clears WCAG AA for any colour they choose. The literals below are the
     standalone fallback and match the shipped default. */
  --ff-primary: var(--ks-brand, hsl(var(--ff-primary-h) var(--ff-primary-s) var(--ff-primary-l)));
  --ff-primary-light: hsl(var(--ff-primary-h) var(--ff-primary-s) calc(var(--ff-primary-l) + 15%));
  --ff-primary-dark: var(--ks-brand-accessible, hsl(var(--ff-primary-h) var(--ff-primary-s) calc(var(--ff-primary-l) - 15%)));
  /* Brand as INK. --ff-primary is chosen to look right as a fill; at 11px on white the
     shipped teal measures 2.49:1, under both the 4.5:1 small text needs and the 3:1 a
     graphic needs. --ff-primary-dark is the accessible step core already measures
     (--ks-brand-accessible), so this follows the merchant's brand rather than overriding
     it. Use it wherever the brand colour carries meaning as text or as a glyph. */
  --ff-primary-ink: var(--ff-primary-dark, var(--ks-color-primary, var(--ff-primary)));
  --ff-primary-trans-10: hsl(var(--ff-primary-h) var(--ff-primary-s) var(--ff-primary-l) / 0.1);
  --ff-primary-trans-20: hsl(var(--ff-primary-h) var(--ff-primary-s) var(--ff-primary-l) / 0.2);
  --ff-accent: hsl(var(--ff-accent-h) var(--ff-accent-s) var(--ff-accent-l));
  --ff-bg-main: hsl(var(--ff-base-h) var(--ff-base-s) 98%);
  --ff-bg-surface: hsl(var(--ff-base-h) var(--ff-base-s) 100%);
  --ff-text-main: hsl(var(--ff-base-h) var(--ff-base-s) var(--ff-text-main-l));
  --ff-text-muted: hsl(var(--ff-base-h) var(--ff-base-s) var(--ff-text-muted-l));
  --ff-border: hsl(var(--ff-base-h) var(--ff-base-s) var(--ff-border-l));
  --ff-muted: var(--ff-text-muted);
  --ff-surface: var(--ff-bg-surface);
  --ff-soft: hsl(var(--ff-base-h) var(--ff-base-s) 96%);
  --ff-line: hsl(var(--ff-base-h) var(--ff-base-s) 92%);
  --ff-radius: 8px;
  --ff-toggle-size: 20px;
  --ff-indent: 8px;
  --ff-filter-card-padding: 16px;
  --ff-filter-card-radius: 14px;
  --ff-filter-wrapper-gap: 14px;
  --ff-filter-section-gap: 18px;
  --ff-filter-section-inner-gap: 12px;
  --ff-filter-title-search-gap: 9px;
  --ff-filter-search-list-gap: 12px;
  --ff-filter-row-gap: 2px;
  --ff-filter-show-more-top: 6px;
  --ff-filter-show-more-bottom: 8px;
  --ff-filter-swatch-row-gap: 10px;
  --ff-filter-swatch-size: 20px;
  --ff-filter-swatch-border-width: 1px;
  --ff-filter-swatch-border-color: var(--ks-border-1, var(--ff-border));
  --ff-filter-compact-section-gap: 12px;

  /* Rail geometry + motion. Additive only: the --ff-* names are a stable
     public contract (merchant custom CSS may reference them), so new knobs
     get new names and nothing existing is ever renamed. */
  --ff-filter-row-height: 30px;
  /* Row gutter. At 0 the hover surface spans the full content width and
     labels line up with their section title. Dialling it up insets the row
     and bleeds the hover past it by the same amount; keep it at 0 while the
     rail can become a scroll container, which would clip the bleed. */
  /*
   * Breathing room at both ends of a term row. At 0 the count badge sat
   * flush against the row edge with literally zero gap, so a long facet
   * list read as a wall of numbers jammed against the panel wall. The
   * hook existed for this; it just had no value.
   */
  --ff-filter-row-inset: 10px;
  --ff-filter-row-radius: 6px;

  /* Frontend token subset (Phase 09). */
  --ks-color-primary: var(--ff-primary);
  --ks-color-secondary: var(--ff-primary-light);
  --ks-color-bg: var(--ff-bg-main);
  --ks-color-text: var(--ff-text-main);
  --ks-surface-1: var(--ff-bg-surface);
  --ks-surface-2: var(--ff-soft);
  --ks-border-1: var(--ff-border);
  --ks-text-1: var(--ff-text-main);
  --ks-text-2: var(--ff-text-muted);
  --ks-radius-1: 4px;
  --ks-radius-2: 6px;
  --ks-radius-3: 8px;
  display: grid;
  gap: var(--ff-filter-wrapper-gap);
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 760px;
  border: 1px solid var(--ks-border-1, var(--ff-border));
  border-radius: var(--ff-filter-card-radius, 14px);
  padding: var(--ff-filter-card-padding);
  background: var(--ks-surface-1, var(--ff-bg-surface));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ff-accent) 7%, transparent);
  font-family: var(--sc-input-font-family, var(--sc-font-sans, inherit)) !important;
  font-size: calc(var(--sc-input-font-size-medium, 1rem) * var(--ff-font-factor, 1)) !important;
  line-height: 1.35;
  color: var(--ff-text-main);
}

/*
 * Dark scheme for the merchant's own neutral ramp.
 *
 * The Surface & Text controls on the Design tab emit --ff-text-main-l, --ff-text-muted-l
 * and --ff-border-l as lightness percentages on :root, and those percentages are chosen for
 * a light panel. Nothing flipped them, so with the site in dark mode the panel took its
 * background from --ks-surface-1 (which does flip) while the labels kept the light-mode
 * ink: dark text on a dark panel, and every facet label vanished, leaving a column of
 * counts with nothing beside them.
 *
 * Derived from --ks-ink / --ks-surface-* rather than from a second hardcoded ramp, so a
 * merchant who restyles the site moves the filter with it. The hsl() fallbacks reuse the
 * merchant's own base hue and saturation, so a site without those tokens still gets a
 * neutral that belongs to their palette instead of a generic grey.
 */
html[data-ks-theme="dark"] .ivasure-wrap {
  --ff-text-main: var(--ks-ink, hsl(var(--ff-base-h) var(--ff-base-s) 92%));
  --ff-text-muted: color-mix(in srgb, var(--ff-text-main) 68%, transparent);
  --ff-border: color-mix(in srgb, var(--ff-text-main) 20%, transparent);
  --ff-line: color-mix(in srgb, var(--ff-text-main) 14%, transparent);
  --ff-soft: color-mix(in srgb, var(--ff-text-main) 7%, transparent);
  --ff-bg-surface: var(--ks-surface-1, hsl(var(--ff-base-h) var(--ff-base-s) 15%));
  --ff-bg-main: var(--ks-bg, hsl(var(--ff-base-h) var(--ff-base-s) 11%));
  --ff-surface: var(--ff-bg-surface);
}

.ivasure-wrap--surface-transparent {
  border-color: transparent;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.ivasure-wrap--surface-theme {
  --ff-primary: var(--sc-color-primary-500, var(--sc-color-primary, currentColor));
  --ff-primary-light: color-mix(in srgb, var(--ff-primary) 72%, white 28%);
  --ff-primary-dark: color-mix(in srgb, var(--ff-primary) 78%, black 22%);
  --ff-primary-ink: var(--ff-primary-dark, var(--ff-primary));
  --ff-primary-trans-10: color-mix(in srgb, var(--ff-primary) 10%, transparent);
  --ff-primary-trans-20: color-mix(in srgb, var(--ff-primary) 20%, transparent);
  --ff-bg-surface: transparent;
  /* --ks-ink first, currentColor only as the fallback. Plain currentColor inherits
     whatever the surrounding SureCart sidebar happens to set, and that colour does not
     flip with the colour scheme - it was readable only because the IvaSure panel used
     to supply a light card underneath it. With the panel gone the same dark text landed
     on a dark page and every facet label disappeared, leaving a column of counts. */
  --ff-text-main: var(--ks-ink, currentColor);
  --ff-text-muted: color-mix(in srgb, currentColor 62%, transparent);
  --ff-border: color-mix(in srgb, currentColor 18%, transparent);
  --ff-surface: transparent;
  --ff-soft: color-mix(in srgb, currentColor 6%, transparent);
  --ff-line: color-mix(in srgb, currentColor 12%, transparent);
  --ks-color-primary: var(--ff-primary);
  --ks-color-secondary: var(--ff-primary-light);
  --ks-color-bg: transparent;
  --ks-color-text: currentColor;
  --ks-surface-1: transparent;
  --ks-surface-2: var(--ff-soft);
  --ks-border-1: var(--ff-border);
  --ks-text-1: currentColor;
  --ks-text-2: var(--ff-text-muted);
  /* No IvaSure panel in this mode. The rule used to clear the fill and the shadow but
     keep a 1px outline recoloured to 18% of currentColor, which left a box belonging to
     no design system: an outlined card with nothing in it, drawn around a filter the
     merchant had asked to inherit the surrounding surface. The three modes are now
     distinct and each one means something - `card` draws the IvaSure panel, `transparent`
     draws no panel and keeps the IvaSure palette, `theme` draws no panel and inherits the
     theme/SureCart colour context. Inner dividers still use --ff-border, so sections are
     still separated; it is only the outer chrome that goes. */
  border-color: transparent;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ks-ink, inherit);
}

.ivasure[hidden] {
  /* Conditionally-gated sections render hidden until their parent section
     is active; display:grid below would defeat the hidden attribute. */
  display: none !important;
}

.ivasure {
  display: grid;
  gap: var(--ff-filter-section-inner-gap);
  min-width: 0;
  min-inline-size: 0;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ivasure-wrap fieldset.ivasure {
  margin: 0;
}

.ivasure-wrap fieldset.ivasure > .ivasure-title {
  width: 100%;
  padding: 0;
}

.ivasure + .ivasure {
  margin-top: var(--ff-filter-section-gap);
  padding-top: var(--ff-filter-section-gap);
  border-top: 1px solid var(--ks-border-1, var(--ff-border));
}

.ivasure-wrap fieldset.ivasure + fieldset.ivasure {
  margin-top: var(--ff-filter-section-gap);
}

.ivasure-wrap *,
.ivasure-wrap *::before,
.ivasure-wrap *::after {
  box-sizing: border-box;
}

.ivasure-wrap--compact {
  --ff-filter-card-padding: 12px;
  --ff-filter-wrapper-gap: 8px;
  --ff-filter-section-gap: var(--ff-filter-compact-section-gap);
  --ff-filter-section-inner-gap: 8px;
  --ff-filter-title-search-gap: 7px;
  --ff-filter-search-list-gap: 8px;
  /* The option rows are most of a filter's height, so compact has to reach them. This set
     --ff-filter-row-gap to 4px against a base of 2px, which pushed the rows two pixels further
     apart than standard and cancelled nearly everything the other tokens saved: measured
     side by side, compact came out 646px against standard's 656px - a 1.5% difference a
     merchant cannot see. Below the mobile breakpoint the 42px touch row wins over both, so
     tightening here does not shrink targets on a phone. */
  --ff-filter-row-gap: 0px;
  --ff-filter-row-height: 28px;
  --ff-filter-show-more-top: 6px;
  --ff-filter-show-more-bottom: 6px;
  --ff-filter-swatch-size: 20px;
  gap: var(--ff-filter-wrapper-gap);
}

.ivasure-wrap--compact .ivasure {
  gap: var(--ff-filter-section-inner-gap);
  padding-top: var(--ff-filter-section-gap);
  border-top: 1px solid var(--ks-border-1, var(--ff-border));
}

.ivasure-wrap--compact .ivasure:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.ivasure-wrap--compact .ivasure-header {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.ivasure-wrap--compact .ivasure-title {
  font-size: calc(var(--sc-input-font-size-medium, 1rem) * var(--ff-font-factor, 1) * 1.05 * var(--ff-filter-title-scale, 0.625)) !important;
}

.ivasure-wrap--compact .ivasure-toolbar {
  justify-content: space-between;
}

.ivasure-wrap .ivasure-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
  font-size: calc(var(--sc-input-font-size-medium, 1rem) * var(--ff-font-factor, 1) * var(--ff-title-factor, 1.25) * var(--ff-filter-title-scale, 0.625)) !important;
  font-weight: 600;
  letter-spacing: var(--ff-filter-title-tracking, 0.06em);
  text-transform: var(--ff-filter-title-transform, uppercase);
  color: var(--ks-text-2, var(--ff-text-muted));
  overflow-wrap: break-word;
}

.ivasure-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  min-height: 17px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--ff-primary-trans-10);
  color: var(--ff-primary-ink, var(--ks-color-primary, var(--ff-primary)));
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ivasure-section-count[hidden] {
  display: none !important;
}

.ivasure--collapsible > .ivasure-title {
  position: relative;
  padding: 4px 20px 4px 0;
  border-radius: var(--ff-filter-row-radius, 6px);
  transition: background-color var(--ff-filter-motion, 150ms) ease;
}

/* The hover surface belongs to the legend, not to the disclosure button.
   That button is absolutely positioned over the legend, so painting its own
   background covered the very title it belongs to - the group name vanished
   on hover. :hover propagates to ancestors, so pointing at the button still
   lights the legend, and the text stays on top where it belongs. */
.ivasure--collapsible > .ivasure-title:hover {
  background: var(--ks-surface-2, var(--ff-soft));
}

.ivasure-section-toggle {
  position: absolute;
  /* No bottom overhang. The 5px it used to extend downward clipped the top of the actions row
     beneath it, leaving the Clear button 23px of unobscured height against the 24px WCAG 2.2
     asks for - a control that measured 58x28 and still failed. */
  inset: -5px -6px 0;
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--ff-filter-row-radius, 6px);
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--ff-filter-motion, 150ms) ease;
}

.ivasure-section-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 7px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform var(--ff-filter-motion, 150ms) ease;
}

.ivasure-section-toggle[aria-expanded="true"]::after {
  transform: translateY(-20%) rotate(-135deg);
}

.ivasure-section-toggle:focus-visible {
  outline: 2px solid var(--ks-color-primary, var(--ff-primary, #0f766e));
  outline-offset: 2px;
}

.ivasure-section__body {
  display: grid;
  gap: var(--ff-filter-section-inner-gap);
  min-width: 0;
}

/* Author display beats the [hidden] UA default - restate it. */
.ivasure-section__body[hidden] {
  display: none !important;
}

.ivasure-wrap .ivasure-empty {
  margin: 0;
  padding: 8px 0;
  color: var(--ks-text-2, var(--ff-muted));
  font-size: var(--ff-text-s);
}

.ivasure-empty__title {
  margin: 0;
  color: var(--ks-text-1, var(--ff-text-main));
  font-size: 1rem;
  line-height: 1.25;
}

.ivasure-empty__link {
  color: var(--ff-primary-ink, var(--ks-color-primary, var(--ff-primary)));
  font-size: var(--ff-text-s);
  font-weight: 700;
  text-decoration: none;
}

.ivasure-header {
  display: grid;
  gap: var(--ff-filter-title-search-gap);
  margin-bottom: calc(var(--ff-filter-search-list-gap) - var(--ff-filter-section-inner-gap));
  padding-bottom: 0;
  border-bottom: 0;
}

.ivasure-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.ivasure-wrap .ivasure-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 2px 0 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--ks-border-1, var(--ff-border)) 70%, transparent);
}

.ivasure-apply-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--ks-border-1, var(--ff-border)) 72%, transparent);
}

.ivasure-wrap .ivasure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.ivasure-wrap .ivasure-action-bar[hidden],
.ivasure-wrap .ivasure-actions[hidden],
.ivasure-wrap .ivasure-action[hidden] {
  display: none !important;
}

.ivasure-wrap .ivasure-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ks-border-1, var(--ff-border));
  background: transparent;
  border-radius: 999px;
  min-height: 28px;
  padding: var(--ff-action-padding-y) var(--ff-action-padding-x);
  font-size: calc(var(--sc-input-font-size-medium, 1rem) * var(--ff-font-factor, 1) * var(--ff-action-font-factor, 0.95)) !important;
  font-weight: 600;
  letter-spacing: var(--ff-action-letter-spacing);
  color: var(--ks-text-1, var(--ff-text-main));
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.ivasure-wrap .ivasure-action:hover {
  background: var(--ks-surface-2, var(--ff-soft));
  border-color: var(--ks-border-1, var(--ff-border));
  color: var(--ks-text-1, var(--ff-text-main));
}

.ivasure-wrap .ivasure-action:focus-visible {
  outline: 2px solid var(--ks-color-primary, var(--ff-primary, #0f766e));
  outline-offset: 2px;
}

/* Expand all / Collapse all sit at ~11px, and the raw brand primary is chosen to look good as
   a fill, not to be read at that size: the shipped teal measured 2.49:1 on white, well under
   the 4.5:1 small text needs. --ff-primary-dark is the accessible step core already publishes
   (--ks-brand-accessible), so this follows the merchant's brand instead of overriding it. The
   border moves with the text to keep the control's boundary above 3:1 as well. */
.ivasure-wrap .ivasure-action--toggle {
  border-color: var(--ff-primary-dark, var(--ks-color-primary, var(--ff-primary)));
  background: transparent;
  color: var(--ff-primary-dark, var(--ks-color-primary, var(--ff-primary)));
}

.ivasure-wrap .ivasure-action--toggle:hover {
  background: var(--ff-primary-trans-10);
  border-color: var(--ff-primary-dark, var(--ff-primary));
  color: var(--ff-primary-dark, var(--ff-primary));
}

.ivasure-wrap .ivasure-action--toggle[aria-pressed="true"] {
  background: var(--ff-primary-trans-20);
  border-color: var(--ff-primary-dark, var(--ff-primary));
  color: var(--ff-primary-dark, var(--ff-primary));
}

.ivasure-wrap .ivasure-action--clear,
.ivasure-wrap .ivasure-action--clear-all {
  border-color: var(--ks-border-1, var(--ff-border));
  color: var(--ks-text-2, var(--ff-muted));
}

.ivasure-wrap .ivasure-action--apply {
  justify-self: start;
  min-height: 32px;
  padding-inline: 14px;
  border-color: var(--ff-primary-dark, var(--ff-primary));
  background: var(--ff-primary-dark, var(--ff-primary));
  color: #fff;
}

.ivasure-wrap .ivasure-action--apply:hover {
  border-color: color-mix(in srgb, var(--ff-primary-dark, var(--ff-primary)) 82%, var(--ff-accent, #0f172a));
  background: color-mix(in srgb, var(--ff-primary-dark, var(--ff-primary)) 82%, var(--ff-accent, #0f172a));
  color: #fff;
}

/* Apply mode's real commit. This pair used to sit ABOVE the .ivasure-action
   base rule; at equal specificity the base won on source order, so the one
   button that actually applies the staged filters painted as a plain ghost
   pill while the form's native-submit fallback below was the only thing
   wearing the primary fill. Order matters here - keep it after the base. */
.ivasure-wrap .ivasure-action--apply-filters {
  border-color: var(--ff-primary-dark, var(--ff-primary));
  background: var(--ff-primary-dark, var(--ff-primary));
  color: #fff;
}

.ivasure-wrap .ivasure-action--apply-filters:hover {
  border-color: color-mix(in srgb, var(--ff-primary-dark, var(--ff-primary)) 82%, var(--ff-accent, #0f172a));
  background: color-mix(in srgb, var(--ff-primary-dark, var(--ff-primary)) 82%, var(--ff-accent, #0f172a));
  color: #fff;
}

/* Dark scheme. The accessible brand step core publishes for a dark page is a
   LIGHT tint - measured to clear 4.5:1 against the dark ground - so the white
   label the light scheme paints on it fell to 1.7:1 on the dark shop
   (2026-09-05 shopper audit). The page ground is the label ink here: it clears
   the same ratio by construction for any brand the merchant picks, the way the
   Etch layer's buy pair flips to a light fill with dark ink. Keyed on both dark
   signals this file already answers to. */
html[data-ks-theme="dark"] .ivasure-wrap .ivasure-action--apply,
html[data-ks-theme="dark"] .ivasure-wrap .ivasure-action--apply:hover,
html[data-ks-theme="dark"] .ivasure-wrap .ivasure-action--apply-filters,
html[data-ks-theme="dark"] .ivasure-wrap .ivasure-action--apply-filters:hover,
body.surecart-theme-dark .ivasure-wrap .ivasure-action--apply,
body.surecart-theme-dark .ivasure-wrap .ivasure-action--apply:hover,
body.surecart-theme-dark .ivasure-wrap .ivasure-action--apply-filters,
body.surecart-theme-dark .ivasure-wrap .ivasure-action--apply-filters:hover {
  color: var(--ks-sc-etch-buy-ink, var(--ks-bg, #0b1220));
}

/* Two primary "Apply" pills in one viewport: the global-controls form ends
   in a native <button type="submit"> so search, sort, price, availability,
   sale and rating still commit without JavaScript, and apply mode adds its
   own "Apply filters". Once ivasure.js has hydrated the panel the native
   submit is dead weight in apply mode - the apply bar (and, on phones, the
   drawer footer) commits everything - so it stands down and leaves exactly
   one primary action on screen. It stays in the markup, and stays visible,
   for every shopper whose JavaScript never arrives. */
.ivasure-wrap--hydrated.ivasure-wrap--interaction-apply .ivasure-action--apply {
  display: none;
}

.ivasure-wrap .ivasure-action--clear:hover,
.ivasure-wrap .ivasure-action--clear-all:hover {
  border-color: var(--ff-primary, #0f766e);
  color: var(--ff-primary, #0f766e);
}

.ivasure-wrap .ivasure-more-toggle {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin-top: var(--ff-filter-show-more-top);
  margin-bottom: var(--ff-filter-show-more-bottom);
  padding-left: 0;
  padding-right: 0;
  border-color: transparent;
  background: transparent;
  color: var(--ff-primary-ink, var(--ks-color-primary, var(--ff-primary))) !important;
  font-weight: 600;
  text-decoration: none;
}

.ivasure-wrap .ivasure-more-toggle::after {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--ff-filter-motion, 150ms) ease;
}

.ivasure--show-all .ivasure-more-toggle::after {
  transform: translateY(1px) rotate(-135deg);
}

.ivasure-wrap .ivasure-more-toggle:hover {
  border-color: transparent;
  background: transparent;
  color: var(--ff-primary-dark, var(--ff-primary));
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ivasure-tree,
.ivasure-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ivasure-tree {
  display: grid;
  gap: var(--ff-filter-row-gap);
  margin-inline: calc(var(--ff-filter-row-inset, 0px) * -1);
}

.ivasure-term {
  margin: 0;
}

.ivasure-row {
  display: grid;
  grid-template-columns: var(--ff-toggle-size) 1fr;
  align-items: center;
  column-gap: 10px;
  min-width: 0;
  position: relative;
  padding: 0;
}

.ivasure-spacer {
  display: inline-block;
  width: var(--ff-toggle-size);
  height: var(--ff-toggle-size);
}

@supports selector(:has(*)) {
  .ivasure:not(:has(.ivasure-children)) .ivasure-row {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }

  .ivasure:not(:has(.ivasure-children)) .ivasure-spacer {
    display: none;
  }
}

/* Disclosure control for a parent term.
 *
 * Was a bordered circle containing a "▸" text glyph. Three problems: the glyph renders at a
 * different weight and baseline in every font stack a merchant might ship, the ring gave a
 * secondary control more visual weight than the checkbox beside it, and the 20px box was under
 * the 24x24 minimum WCAG 2.2 sets for pointer targets.
 *
 * Now a chevron drawn from borders - identical everywhere, no font dependency - inside a
 * transparent 24px target. The visual stays small; the hit area does not. */
.ivasure-toggle {
  all: unset;
  box-sizing: border-box;
  width: var(--ff-toggle-size);
  height: var(--ff-toggle-size);
  min-width: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 5;
  border-radius: 6px;
  color: var(--ks-text-2, var(--ff-muted));
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Two borders on a rotated square. Sized in em so it tracks the control rather than needing a
 * breakpoint of its own. */
.ivasure-toggle::before {
  content: "";
  display: block;
  width: 0.4em;
  height: 0.4em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
  /* Nudged left because a chevron's optical centre is not its box centre. */
  transform: translateX(-0.08em) rotate(-45deg);
  transition: transform 0.18s ease;
}

.ivasure-toggle[aria-expanded="true"] {
  color: var(--ks-text-1, var(--ff-text-main, currentColor));
}

.ivasure-toggle:hover {
  background: var(--ks-surface-2, var(--ff-soft));
  color: var(--ks-text-1, var(--ff-text-main, currentColor));
}

/* The rotation IS the affordance, so it must still happen when animation is reduced - only the
 * tween is dropped. */
@media (prefers-reduced-motion: reduce) {
  .ivasure-toggle,
  .ivasure-toggle::before {
    transition: none;
  }
}

.ivasure-toggle:focus-visible,
.ivasure-search-clear:focus-visible {
  outline: 2px solid var(--ks-color-primary, var(--ff-primary, #0f766e));
  outline-offset: 2px;
}

.ivasure-toggle[aria-expanded="true"]::before {
  transform: translateX(-0.04em) translateY(-0.1em) rotate(45deg);
}

/* A hairline guide down the children.
 *
 * Indentation alone stops carrying the relationship once a list is long enough that the parent
 * has scrolled out of view, which is exactly when a shopper is deepest in the tree and most
 * needs to know where they are. */
.ivasure-children {
  position: relative;
}

.ivasure-children::before {
  content: "";
  position: absolute;
  inset-block: 0.15rem;
  inset-inline-start: 0;
  width: 1px;
  background: var(--ks-border-1, var(--ff-border));
  opacity: 0.75;
}

.ivasure-wrap.is-loading {
  opacity: 0.76;
}

.ivasure-active[hidden],
.ivasure-loading[hidden] {
  display: none !important;
}

.ivasure-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--ff-primary-trans-10);
  color: var(--ks-text-2, var(--ff-muted));
  font-size: var(--ff-text-s);
  font-weight: 700;
}

.ivasure-loading::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ks-color-primary, var(--ff-primary));
  animation: ivasure-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes ivasure-pulse {
  from {
    opacity: 0.35;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.ivasure-active {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.ivasure-active[hidden] {
  display: none !important;
}

.ivasure-active__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  font-size: 0.85em;
  color: var(--ks-text-2, var(--ff-muted));
}

/* Deliberately a quiet text control: the action bar below carries its own
   Clear all as a pill, and two identical pills read as a duplicate. */
.ivasure-wrap .ivasure-active__clear {
  flex: 0 0 auto;
  color: var(--ff-primary-ink, var(--ks-color-primary, var(--ff-primary)));
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.ivasure-wrap .ivasure-active__clear:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ivasure-active__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.ivasure-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 9px;
  transition: border-color var(--ff-filter-motion, 150ms) ease, background-color var(--ff-filter-motion, 150ms) ease;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--ff-primary-trans-10);
  /* Mix the accessible brand step, not the raw fill colour. On a page that supplies its own
     dark --ks-text-1 the old mix landed dark enough by luck; on a plain page it resolved to
     #159689 on the chip tint, 3.33:1. */
  color: color-mix(in srgb, var(--ff-primary-ink, var(--ks-color-primary, var(--ff-primary))) 78%, var(--ks-text-1, var(--ff-text-main)));
  font-size: 0.8em;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.ivasure-chip:hover {
  border-color: color-mix(in srgb, var(--ks-color-primary, var(--ff-primary)) 34%, transparent);
  background: var(--ff-primary-trans-20);
}

.ivasure-chip:focus-visible,
.ivasure-active__clear:focus-visible,
.ivasure-pagination__link:focus-visible,
.ivasure-mobile-toggle:focus-visible,
.ivasure-drawer__close:focus-visible,
.ivasure-drawer__clear:focus-visible,
.ivasure-drawer__apply:focus-visible {
  outline: 2px solid var(--ks-color-primary, var(--ff-primary, #0f766e));
  outline-offset: 2px;
}

.ivasure-chip__label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ivasure-chip__remove {
  line-height: 1;
  opacity: 0.72;
}

.ivasure-result-status {
  justify-self: start;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--ks-text-2, var(--ff-muted));
  font-size: 0.85em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ivasure-result-status[hidden] {
  display: none !important;
}

/*
 * The dead end, redesigned.
 *
 * The first version was a bordered box holding a muted sentence and a row of
 * pills. It read as a debug notice: the pills wrapped mid-phrase ("Remove
 * Materials (11" / "products)"), nothing was emphasised, and the single most
 * useful fact - that eleven products come back if you drop one filter - was
 * buried in parentheses at the end of a wrapping link.
 *
 * Now it states the problem once, then offers each way out as a full-width
 * row: the action on the left, the reward as a count badge on the right. That
 * is deliberately the same shape as a facet row, so the way out of a dead end
 * looks like the controls that caused it.
 */
.ivasure-zero-results {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--ks-color-primary, var(--ff-primary)) 22%, var(--ks-border-1, var(--ff-border)));
  border-radius: var(--ks-radius-2, 10px);
  background: color-mix(in srgb, var(--ks-surface-2, var(--ff-soft)) 92%, var(--ks-color-primary, var(--ff-primary)) 8%);
}

/* Author display beats the [hidden] UA default - restate it. */
.ivasure-zero-results[hidden] {
  display: none;
}

.ivasure-zero-results__copy {
  margin: 0;
  color: var(--ks-text-1, var(--ff-text));
  font-size: var(--ff-text-s);
  font-weight: 600;
  line-height: 1.35;
}

.ivasure-zero-results__suggestions {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ivasure-zero-results__suggestions[hidden] {
  display: none;
}

.ivasure-zero-results__suggestion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  /*
   * row-gap is what makes a narrow sidebar work. In a 254px panel the label
   * needs two lines and the badge no longer fits beside it, so it wraps to its
   * own line rather than crowding the text. column-gap keeps them apart when
   * they do share a line.
   */
  gap: 4px 12px;
  width: 100%;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--ks-border-1, var(--ff-border));
  border-radius: var(--ks-radius-1, 8px);
  background: var(--ks-surface-1, var(--ff-bg-surface));
  color: var(--ks-text-1, var(--ff-text));
  font-size: var(--ff-text-s);
  line-height: 1.3;
  text-decoration: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}

/*
 * The label never wraps mid-phrase; the count keeps its own column. Without
 * this the reward ("11 products") broke onto its own line and stopped reading
 * as the reason to click.
 */
.ivasure-zero-results__suggestion-label {
  /*
   * Allowed to wrap, but never to drag the count with it. Ellipsizing was
   * worse than a second line: in a 317px sidebar it truncated the action
   * itself to "Remove Materi...". The count is a separate flex item with
   * flex:none, so the original defect - the reward breaking mid-parenthesis
   * onto its own orphaned line - cannot come back either way.
   */
  min-width: 0;
}

.ivasure-zero-results__suggestion-count {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ks-color-primary, var(--ff-primary)) 12%, transparent);
  color: var(--ks-color-primary-dark, var(--ks-color-primary, var(--ff-primary)));
  font-size: var(--ff-text-xs);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.ivasure-zero-results__suggestion:hover,
.ivasure-zero-results__suggestion:focus-visible {
  border-color: var(--ks-color-primary, var(--ff-primary));
  background: color-mix(in srgb, var(--ks-color-primary, var(--ff-primary)) 6%, var(--ks-surface-1, var(--ff-bg-surface)));
}

.ivasure-zero-results__undo {
  justify-self: start;
}

@media (prefers-reduced-motion: reduce) {
  .ivasure-zero-results__suggestion { transition: none; }
}

.ivasure-zero-results--drawer {
  margin-block-end: 8px;
  width: 100%;
}

.ivasure-popular-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-block: 6px;
}

.ivasure-popular-filters__title {
  color: var(--ks-text-2, var(--ff-muted));
  font-size: var(--ff-text-s);
}

.ivasure-popular-filters__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ivasure-popular-filters__chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--ks-border-1, var(--ff-border));
  border-radius: 999px;
  background: var(--ks-surface-1, var(--ff-bg-surface));
  color: var(--ks-text-1, var(--ff-text));
  font-size: var(--ff-text-s);
  text-decoration: none;
}

.ivasure-popular-filters__chip:hover,
.ivasure-popular-filters__chip:focus-visible {
  border-color: var(--ks-color-primary, var(--ff-primary));
  color: var(--ks-color-primary, var(--ff-primary));
}

.ivasure-global-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  /* `end` bottom-aligned the one-line fields against whatever tall fieldset
     shared their row, which read as the short controls sinking and the tall
     ones floating. Rows start together instead. */
  align-items: start;
  gap: var(--ff-filter-section-gap, 16px);
  border: 0;
  /* The action bar sits between these controls and the first facet group and
     is present-but-hidden whenever nothing is applied, so an adjacent-sibling
     rule never reached the group. The controls own their own bottom seam. */
  border-bottom: 1px solid var(--ks-border-1, var(--ff-border));
  border-radius: 0;
  padding: 0 0 var(--ff-filter-section-gap);
  margin-bottom: var(--ff-filter-section-gap);
  background: transparent;
}

/* Multi-row controls own a row. Auto-fit happily parks the price fieldset
   (legend + slider + two number inputs) or the five-row rating list in a
   ~168px cell beside a single-line Search, which pushed the tall ones up
   out of line and left the form's submit stranded in the cell next to
   "1 star & up". Spanning the track keeps every group whole and gives the
   slider and the rating labels the width they need - the same lever the
   horizontal layout already pulls a few rules below. */
.ivasure-global-controls > .ivasure-control-group--price,
.ivasure-global-controls > .ivasure-control-group--rating,
.ivasure-global-controls > .ivasure-action--apply {
  grid-column: 1 / -1;
}

/* The sale group's legend is screen-reader-only, so top-aligning it leaves
   its checkbox hovering above the labelled controls beside it. With the two
   tall groups on their own rows this can only share a row with single-line
   fields, so it hangs from the same bottom edge they do. */
.ivasure-global-controls > .ivasure-control-group--sale {
  align-self: end;
}

.ivasure-wrap--layout-horizontal {
  max-width: none;
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.ivasure-wrap--layout-horizontal .ivasure-global-controls {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.ivasure-wrap--layout-horizontal > .ivasure,
.ivasure-wrap--layout-horizontal .ivasure-drawer__body > .ivasure {
  min-width: min(100%, 220px);
}

.ivasure-wrap--layout-horizontal .ivasure-drawer__body {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.ivasure-wrap--layout-horizontal .ivasure-active,
.ivasure-wrap--layout-horizontal .ivasure-result-status,
.ivasure-wrap--layout-horizontal .ivasure-loading,
.ivasure-wrap--layout-horizontal .ivasure-global-controls,
.ivasure-wrap--layout-horizontal .ivasure-action-bar,
.ivasure-wrap--layout-horizontal .ivasure-apply-bar,
.ivasure-wrap--layout-horizontal > .ivasure-drawer {
  grid-column: 1 / -1;
}

.ivasure-wrap--layout-horizontal .ivasure + .ivasure,
.ivasure-wrap--layout-horizontal fieldset.ivasure + fieldset.ivasure {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.ivasure-wrap--layout-horizontal .ivasure-tree {
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

.ivasure-wrap--layout-horizontal .ivasure-more-toggle {
  margin-bottom: 0;
}

.ivasure-control-field {
  display: grid;
  gap: 5px;
  color: var(--ks-text-1, var(--ff-text-main));
  font-size: inherit;
  font-weight: 400;
}

.ivasure-control-group__legend,
.ivasure-control-field:not(.ivasure-control-field--checkbox) > span {
  font-size: calc(var(--sc-input-font-size-medium, 1rem) * var(--ff-font-factor, 1) * var(--ff-title-factor, 1.25) * var(--ff-filter-title-scale, 0.625));
  font-weight: 600;
  letter-spacing: var(--ff-filter-title-tracking, 0.06em);
  text-transform: var(--ff-filter-title-transform, uppercase);
  color: var(--ks-text-2, var(--ff-text-muted));
}

.ivasure-control-group {
  /* Matches .ivasure-global-controls' align-items: rows of controls start
     together instead of hanging from the tallest group's baseline. */
  align-self: start;
  display: grid;
  gap: 4px;
  min-width: 0;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ivasure-control-group__legend {
  margin: 0;
  padding: 0;
  line-height: 1.3;
}

.ivasure-control-field input,
.ivasure-control-field select,
.ivasure-term-search {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--ks-border-1, var(--ff-border));
  border-radius: var(--ks-radius-3, 8px);
  background: var(--ks-surface-1, var(--ff-surface));
  color: var(--ks-text-1, var(--ff-text-main));
  padding: 6px 10px;
  font: inherit;
  transition: border-color var(--ff-filter-motion, 150ms) ease, box-shadow var(--ff-filter-motion, 150ms) ease;
}

.ivasure-control-field input:focus-visible,
.ivasure-control-field select:focus-visible,
.ivasure-term-search:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 0;
  border-color: var(--ks-color-primary, var(--ff-primary));
  box-shadow: 0 0 0 3px var(--ff-primary-trans-20);
}

.ivasure-control-field input::placeholder,
.ivasure-term-search::placeholder {
  color: var(--ks-text-2, var(--ff-muted));
  opacity: 1;
}

.ivasure-control-field--checkbox {
  align-self: center;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
}

.ivasure-control-field--checkbox input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.ivasure-search-wrap {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 190px;
  overflow: hidden;
}

.ivasure-search-wrap .ivasure-term-search {
  min-width: 0;
  padding-right: 34px;
  text-overflow: ellipsis;
}

.ivasure-search-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ks-text-2, var(--ff-muted));
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.ivasure-search-clear:hover,
.ivasure-search-clear:focus-visible {
  background: var(--ff-primary-trans-10);
  color: var(--ks-color-primary, var(--ff-primary, #0f766e));
}

.ivasure-search-clear[hidden] {
  display: none !important;
}

.ivasure-search-status {
  align-self: center;
  color: var(--ks-text-2, var(--ff-muted));
  font-size: var(--ff-text-xs);
  font-weight: 700;
  white-space: nowrap;
}

.ivasure-search-status[hidden] {
  display: none !important;
}

.ivasure-wrap .ivasure-copy-status {
  align-self: center;
  color: var(--ks-text-2, var(--ff-muted));
  font-size: var(--ff-text-xs);
  font-weight: 700;
  white-space: nowrap;
}

.ivasure-wrap .ivasure-copy-status:empty {
  display: none;
}

.ivasure-wrap .ivasure-saved-sets {
  position: relative;
  min-width: 0;
}

.ivasure-wrap .ivasure-saved-sets[hidden] {
  display: none !important;
}

.ivasure-wrap .ivasure-saved-sets > summary {
  list-style: none;
  cursor: pointer;
}

.ivasure-wrap .ivasure-saved-sets > summary::-webkit-details-marker {
  display: none;
}

.ivasure-wrap .ivasure-saved-sets__count {
  margin-left: 6px;
  font-size: var(--ff-text-xs);
  font-weight: 700;
  color: var(--ks-text-2, var(--ff-muted));
}

.ivasure-wrap .ivasure-saved-sets__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 240px;
  max-width: 320px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--ks-border-1, var(--ff-border)) 90%, transparent);
  border-radius: 10px;
  background: var(--ks-surface-1, #fff);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.ivasure-wrap .ivasure-saved-sets__save {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.ivasure-wrap .ivasure-saved-sets__save[hidden] {
  display: none !important;
}

.ivasure-wrap .ivasure-saved-sets__name {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid var(--ks-border-1, var(--ff-border));
  border-radius: 6px;
  font-size: var(--ff-text-sm);
}

.ivasure-wrap .ivasure-saved-sets__list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
}

.ivasure-wrap .ivasure-saved-sets__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.ivasure-wrap .ivasure-saved-sets__apply {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--ff-text-sm);
  text-decoration: none;
  color: var(--ff-primary-ink, var(--ks-color-primary, var(--ff-primary)));
}

.ivasure-wrap .ivasure-saved-sets__apply:hover {
  text-decoration: underline;
}

.ivasure-wrap .ivasure-saved-sets__delete {
  flex: 0 0 auto;
  border: 0;
  padding: 0 6px;
  background: transparent;
  color: var(--ks-text-2, var(--ff-muted));
  font-size: var(--ff-text-sm);
  line-height: 1.4;
  cursor: pointer;
}

.ivasure-wrap .ivasure-saved-sets__delete:hover {
  color: var(--ks-color-danger, #b91c1c);
}

.ivasure-wrap .ivasure-saved-sets__empty {
  margin: 0;
  font-size: var(--ff-text-xs);
  color: var(--ks-text-2, var(--ff-muted));
}

.ivasure-wrap .ivasure-saved-sets__empty[hidden] {
  display: none !important;
}

.ivasure-drawer__copy {
  border: 0;
  padding: 0 8px;
  background: transparent;
  color: var(--ff-primary-ink, var(--ks-color-primary, var(--ff-primary)));
  font-size: var(--ff-text-sm);
  font-weight: 600;
  cursor: pointer;
}

.ivasure-drawer__copy[hidden] {
  display: none !important;
}

.ivasure-price-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ivasure-control-field--price > input {
  text-align: start;
  font-variant-numeric: tabular-nums;
}

/* Dual-thumb price range slider (JS progressive enhancement; the min/max
   number inputs stay the accessible fallback and submission source). */
/* Rating star links (server-rendered anchors; radio semantics). */
.ivasure--rating .ivasure-tree {
  display: grid;
  gap: 2px;
}

.ivasure-rating-stars {
  color: var(--ff-primary-ink, var(--ks-color-primary, var(--ff-primary)));
  font-size: 15px;
  letter-spacing: 2px;
  line-height: 1;
  white-space: nowrap;
}

.ivasure--rating .ivasure-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ivasure--rating .ivasure-item--selected .ivasure-label {
  font-weight: 700;
}

.ivasure--rating[hidden] {
  display: none !important;
}

.ivasure-price-slider {
  position: relative;
  height: 54px; /* value row on top, then a 32px thumb hitbox over the rail */
  margin: 4px 0 8px;
}

.ivasure-price-slider[hidden] {
  display: none !important;
}

.ivasure-price-slider__track,
.ivasure-price-slider__fill {
  position: absolute;
  top: 36px;
  height: 4px;
  border-radius: 999px;
  pointer-events: none;
}

.ivasure-price-slider__track {
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--ks-border-1, var(--ff-border)) 88%, var(--ks-text-2, var(--ff-muted)) 12%);
}

.ivasure-price-slider__fill {
  background: var(--ks-color-primary, var(--ff-accent));
}

.ivasure-price-slider__thumb {
  position: absolute;
  top: 22px;
  left: 0;
  width: 100%;
  height: 32px; /* >= 24px pointer target (WCAG 2.5.8); knob centers on the track */
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none; /* the track is inert; only the thumbs take input */
}

.ivasure-price-slider__thumb::-webkit-slider-runnable-track {
  background: transparent;
  border: 0;
}

.ivasure-price-slider__thumb::-moz-range-track {
  background: transparent;
  border: 0;
}

.ivasure-price-slider__thumb::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--ks-surface-1, #fff);
  background: var(--ks-color-primary, var(--ff-accent));
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
  cursor: grab;
  pointer-events: auto;
}

.ivasure-price-slider__thumb::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--ks-surface-1, #fff);
  background: var(--ks-color-primary, var(--ff-accent));
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
  cursor: grab;
  pointer-events: auto;
}

.ivasure-price-slider__thumb:active::-webkit-slider-thumb {
  cursor: grabbing;
}

.ivasure-price-slider__thumb:active::-moz-range-thumb {
  cursor: grabbing;
}

.ivasure-price-slider__thumb:focus-visible {
  outline: none;
}

.ivasure-price-slider__thumb:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--ks-color-primary, var(--ff-accent));
  outline-offset: 2px;
}

.ivasure-price-slider__thumb:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--ks-color-primary, var(--ff-accent));
  outline-offset: 2px;
}

.ivasure-price-slider__labels {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: block;
  color: var(--ks-text-1, var(--ff-text-main));
  font-size: 1.02em;
  font-weight: 600;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  text-align: left;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .ivasure-price-slider__fill {
    transition: left 80ms linear, right 80ms linear, width 80ms linear;
  }
}

.ivasure-term-search {
  max-width: 100%;
  font-size: var(--ff-text-xs);
}

.ivasure-term[hidden] {
  display: none;
}

.ivasure-term--overflow-hidden {
  display: none !important;
}

.ivasure-wrap--empty-terms-hide .ivasure-term--dynamic-empty:not(.ivasure-term--selected):not(.ivasure-term--has-selected) {
  display: none !important;
}

.ivasure-wrap--empty-terms-fade .ivasure-term--dynamic-empty:not(.ivasure-term--selected):not(.ivasure-term--has-selected) {
  opacity: 0.46;
}

.ivasure-wrap--empty-terms-disable .ivasure-term--dynamic-empty:not(.ivasure-term--selected):not(.ivasure-term--has-selected) > .ivasure-row > .ivasure-item {
  cursor: not-allowed;
  opacity: 0.56;
  pointer-events: none;
}

/* The disabled class is already the final decision (a site rule keeps it on an ancestor of a
   selected term; no count rule sets it on one): no selected guard here. */
.ivasure-term--disabled > .ivasure-row > .ivasure-item {
  cursor: not-allowed;
  opacity: 0.56;
  pointer-events: none;
}

.ivasure-term-empty {
  margin: 2px 0 0;
  padding: 8px 10px;
  border: 1px dashed color-mix(in srgb, var(--ks-border-1, var(--ff-border)) 84%, var(--ks-text-2, var(--ff-muted)) 16%);
  border-radius: 6px;
  background: color-mix(in srgb, var(--ks-surface-2, var(--ff-soft)) 82%, transparent);
  color: var(--ks-text-2, var(--ff-muted));
  font-size: var(--ff-text-xs);
}

.ivasure-term-empty[hidden] {
  display: none !important;
}

.ivasure-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--ks-color-primary, var(--ff-primary)) 30%, var(--ks-border-1, var(--ff-border)));
  border-radius: 8px;
  background: color-mix(in srgb, var(--ks-color-primary, var(--ff-primary)) 6%, var(--ks-surface-1, var(--ff-surface)));
  color: var(--ks-text-1, var(--ff-text-main));
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.08);
}

.ivasure-mobile-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--ks-color-primary, var(--ff-primary));
  color: #fff;
  font-size: var(--ff-text-xs);
}

.ivasure-mobile-count[hidden] {
  display: none !important;
}

.ivasure-drawer__header,
.ivasure-drawer__footer {
  display: none;
}

html.ivasure-drawer-lock,
html.ivasure-drawer-lock body,
.ivasure-drawer-lock {
  overflow: hidden;
}

.ivasure-children {
  margin: 4px 0 4px var(--ff-indent);
  padding-left: var(--ff-indent);
  border-left: none;
}

.ivasure-wrap .ivasure-item {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-family: var(--sc-input-font-family, var(--sc-font-sans, inherit));
  font-size: inherit !important;
  text-decoration: none;
  color: var(--ks-text-1, inherit);
  padding: 0;
  border-radius: var(--ff-filter-row-radius, 6px);
  transition: background-color var(--ff-filter-motion, 150ms) ease, color var(--ff-filter-motion, 150ms) ease;
}

.ivasure--style-list .ivasure-item,
.ivasure--style-checkbox .ivasure-item,
.ivasure--style-radio .ivasure-item,
.ivasure--style-radio_multi .ivasure-item,
.ivasure--style-swatch:not(.ivasure--swatch-compact) .ivasure-item--swatch {
  width: 100%;
  min-height: var(--ff-filter-row-height, 30px);
  padding-inline: var(--ff-filter-row-inset, 0px);
}

.ivasure--style-list .ivasure-item,
.ivasure--style-checkbox .ivasure-item,
.ivasure--style-radio .ivasure-item,
.ivasure--style-radio_multi .ivasure-item,
.ivasure--style-swatch:not(.ivasure--swatch-compact) .ivasure-item--swatch {
  border-radius: var(--ks-radius-1, 7px);
  transition: background-color 120ms ease;
}

.ivasure--style-list .ivasure-item:hover,
.ivasure--style-checkbox .ivasure-item:hover,
.ivasure--style-radio .ivasure-item:hover,
.ivasure--style-radio_multi .ivasure-item:hover,
.ivasure--style-swatch:not(.ivasure--swatch-compact) .ivasure-item--swatch:hover {
  background-color: color-mix(in srgb, var(--ks-surface-2, var(--ff-soft)) 62%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .ivasure .ivasure-item { transition: none; }
}

.ivasure--style-swatch:not(.ivasure--swatch-compact) .ivasure-label {
  font-size: 0.94em !important;
  line-height: 1.3;
}

.ivasure .ivasure-item,
.ivasure .ivasure-item:hover,
.ivasure .ivasure-item:focus,
.ivasure .ivasure-item:active,
.ivasure .ivasure-item:visited {
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}

.ivasure .ivasure-item .ivasure-label,
.ivasure .ivasure-item:hover .ivasure-label,
.ivasure .ivasure-item:focus .ivasure-label,
.ivasure .ivasure-item:active .ivasure-label,
.ivasure .ivasure-item:visited .ivasure-label {
  text-decoration: none !important;
  text-decoration-line: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}

.ivasure-wrap .ivasure-item:hover {
  background: var(--ks-surface-2, var(--ff-soft));
}

.ivasure-wrap .ivasure-item[aria-checked="true"] {
  background: var(--ff-primary-trans-10);
}

.ivasure-wrap .ivasure-item[aria-checked="true"]:hover {
  background: var(--ff-primary-trans-20);
}

.ivasure-control {
  display: inline-block;
  flex: 0 0 auto;
  pointer-events: none;
  margin: 0;
}

.ivasure-control--checkbox,
.ivasure-control--radio {
  width: 1em;
  height: 1em;
}

.ivasure-item--list input[type="checkbox"],
.ivasure-item--list input[type="radio"],
.ivasure-item--pill input[type="checkbox"],
.ivasure-item--pill input[type="radio"] {
  display: none;
}

.ivasure-wrap .ivasure-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: inherit !important;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
  text-wrap: pretty;
}

.ivasure-search-highlight {
  border-radius: 3px;
  background: color-mix(in srgb, var(--ks-color-primary, var(--ff-primary, #0f766e)) 18%, transparent);
  color: inherit;
  padding: 0 1px;
}

.ivasure-wrap .ivasure-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 0;
  height: auto;
  font-size: 0.8em;
  font-weight: 500;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  color: var(--ks-text-2, var(--ff-muted));
  padding: 0 0 0 8px;
  border-radius: 0;
  border: 0;
  background: transparent;
  transition: color var(--ff-filter-motion, 150ms) ease;
}

.ivasure-item--selected {
  color: var(--ks-color-primary, var(--ff-primary, #0f766e));
}

.ivasure-item--selected .ivasure-label {
  font-weight: 500;
}

.ivasure-item--selected .ivasure-count {
  background: transparent;
  border-color: transparent;
  color: var(--ks-color-primary, var(--ff-primary, #0f766e));
  font-weight: 600;
}

.ivasure-term--has-selected > .ivasure-row::before {
  content: none;
}

/* The pill style, actually looking like a pill.
 *
 * These rules previously stripped every affordance - border: none, background: transparent,
 * box-shadow: none, all forced - which left a style called "Pill" rendering as plain text,
 * visually identical to "List". A merchant choosing between six styles was really choosing
 * between five.
 *
 * The layout half was always there (.ivasure[data-style="pill"] .ivasure-tree flows the options
 * horizontally); only the chip was missing. */
/* Filter chips, built to the Material 3 filter-chip pattern.
 *
 * Unselected is an outline on a plain surface; selected is a filled chip that also grows a
 * leading checkmark. The checkmark matters: the guidance is explicit that a filter chip should
 * "strengthen the selected state with an icon", because fill-versus-outline is a colour
 * difference and colour alone is not a state indicator for everyone.
 *
 * Sizing follows the touch guidance rather than the text: 34px minimum height with 8px between
 * chips, so the target stays comfortable even when a label is one short word. */
/* padding, display and width carry !important for the same reason almost every rule in this
 * file does: a base .ivasure-item rule and the theme layer both reset them, and without it the
 * chip rendered with ZERO horizontal padding - the count sat flush against the right border
 * while the border, colour and background (which did carry !important) applied correctly. That
 * mixture is the tell: when only some declarations in a rule take effect, the ones that failed
 * are the ones that were not shouted. */
.ivasure-item--pill {
  display: inline-flex !important;
  align-items: center;
  align-self: flex-start;
  gap: 0;
  width: auto !important;
  min-height: 30px;
  padding: 0.24rem 0.75rem !important;
  border-radius: 999px;
  border: 1px solid var(--ks-border-1, var(--ff-border)) !important;
  color: var(--ks-text-1, var(--ff-text-main, currentColor)) !important;
  background: var(--ks-surface-1, var(--ff-surface)) !important;
  box-shadow: none !important;
  font-size: 0.94em;
  line-height: 1.25;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* The checkmark: two borders on a rotated rectangle, so it renders identically everywhere with
 * no icon font.
 *
 * It must be TALLER than it is wide. A square gives a chevron pointing down-right, which reads
 * as "expand", not "chosen" - the first version of this made exactly that mistake. The 0.32 x
 * 0.58em ratio is what turns the corner into a tick.
 *
 * Width animates from zero so nothing shifts as chips are selected and cleared. */
.ivasure-item--pill::before {
  content: "";
  flex: none;
  width: 0;
  height: 0.58em;
  margin-inline-end: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
  transform: translateY(-0.1em) rotate(45deg) scale(0);
  opacity: 0;
  transition: width 0.15s ease, margin 0.15s ease, opacity 0.12s ease, transform 0.15s ease;
}

.ivasure-item--pill[aria-checked="true"]::before {
  width: 0.32em;
  margin-inline-end: 0.55em;
  transform: translateY(-0.1em) rotate(45deg) scale(1);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .ivasure-item--pill,
  .ivasure-item--pill::before {
    transition: none;
  }
}

.ivasure-item--pill:hover {
  border-color: var(--ks-color-primary, var(--ff-primary, #0f766e)) !important;
  color: var(--ks-text-1, var(--ff-text-main, currentColor)) !important;
  background: var(--ks-surface-2, var(--ff-soft)) !important;
}

/* Selected: a TINTED fill with dark text, not a saturated fill with white text.
 *
 * The shipped primary is #14b8a6, and white on it measures 2.51:1 - failing WCAG AA and even
 * the 3:1 the chip guidance asks for. A light tint of the same hue with the normal ink colour
 * measures around 7:1, stays legible whatever primary a merchant sets, and is the pattern
 * Material 3 uses for filter chips (a container tint, not the accent itself). */
.ivasure-item--pill[aria-checked="true"] {
  background: color-mix(in srgb, var(--ks-color-primary, var(--ff-primary, #0f766e)) 16%, var(--ks-surface-1, #ffffff)) !important;
  border-color: var(--ks-color-primary, var(--ff-primary, #0f766e)) !important;
  color: var(--ks-text-1, var(--ff-text-main, currentColor)) !important;
  box-shadow: inset 0 0 0 1px var(--ks-color-primary, var(--ff-primary, #0f766e)) !important;
  font-weight: 600;
}

/* Browsers without color-mix get the plain surface and keep the border and checkmark, which is
 * still a clear selected state rather than a broken one. */
@supports not (background: color-mix(in srgb, red 50%, white)) {
  .ivasure-item--pill[aria-checked="true"] {
    background: var(--ks-surface-2, var(--ff-soft)) !important;
  }
}

/* The count is reference, not label: smaller and set back, with real space between the two so
 * "Living Room 11" does not read as one string. */
.ivasure-item--pill .ivasure-count {
  background: transparent !important;
  border: none !important;
  color: var(--ks-text-2, var(--ff-muted)) !important;
  opacity: 1 !important;
  font-size: 0.85em;
  font-weight: 400;
  padding: 0 0 0 0.5em !important;
}

.ivasure-item--pill[aria-checked="true"] .ivasure-count {
  background: transparent !important;
  color: inherit !important;
  border-color: transparent !important;
}

.ivasure-item--checkbox,
.ivasure-item--radio,
.ivasure-item--radio_multi,
.ivasure-item--swatch {
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.ivasure-item--checkbox {
  align-items: center;
}

/* Keep checkbox controls visually consistent across browsers/themes. */
.ivasure-item--checkbox .ivasure-control--checkbox {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 0;
  border: 1.5px solid var(--ks-border-1, var(--ff-border));
  border-radius: 4px;
  background-color: var(--ks-surface-1, var(--ff-bg-surface));
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.ivasure-item--checkbox:hover .ivasure-control--checkbox {
  border-color: var(--ks-color-primary, var(--ff-primary, #0f766e));
}

.ivasure-item--checkbox .ivasure-control--checkbox:checked,
.ivasure-item--checkbox[aria-checked="true"] .ivasure-control--checkbox {
  border-color: var(--ks-color-primary, var(--ff-primary, #0f766e));
  background-color: var(--ks-color-primary, var(--ff-primary, #0f766e));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23fff' d='M7.5 14.3 3.8 10.6l1.4-1.4 2.3 2.3 7.3-7.3 1.4 1.4z'/%3E%3C/svg%3E");
}

.ivasure-item--radio .ivasure-control--radio,
.ivasure-item--radio_multi .ivasure-control--radio {
  flex: 0 0 1em;
  border: 1px solid var(--ks-border-1, var(--ff-border));
  border-radius: 999px;
  background: var(--ks-surface-1, var(--ff-bg-surface));
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.ivasure-item--radio:hover .ivasure-control--radio,
.ivasure-item--radio_multi:hover .ivasure-control--radio {
  border-color: var(--ks-color-primary, var(--ff-primary, #0f766e));
}

.ivasure-item--radio[aria-checked="true"] .ivasure-control--radio,
.ivasure-item--radio_multi[aria-checked="true"] .ivasure-control--radio {
  border-color: var(--ks-color-primary, var(--ff-primary, #0f766e));
  background:
    radial-gradient(circle at center, var(--ks-color-primary, var(--ff-primary, #0f766e)) 0 38%, transparent 42%),
    var(--ks-surface-1, var(--ff-bg-surface));
}

.ivasure-item--swatch {
  align-items: center;
  gap: var(--ff-filter-swatch-row-gap);
  min-height: calc(var(--ff-filter-swatch-size) + 10px);
  padding: 5px 0;
}

.ivasure-swatch {
  flex: 0 0 var(--ff-filter-swatch-size);
  width: var(--ff-filter-swatch-size);
  height: var(--ff-filter-swatch-size);
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: var(--ff-filter-swatch-border-width, 1px) solid var(--ff-filter-swatch-border-color, var(--ks-border-1, var(--ff-border)));
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ff-primary-trans-10), var(--ff-primary-trans-20));
  box-shadow: inset 0 0 0 2px var(--ks-surface-1, var(--ff-surface));
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.ivasure-swatch--image {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.ivasure-wrap--swatch-fit-contain .ivasure-swatch--image {
  background-size: contain;
  background-color: var(--ks-surface-2, var(--ff-soft));
}

.ivasure-wrap--swatch-shape-square .ivasure-swatch,
.ivasure--swatch-shape-square .ivasure-swatch {
  border-radius: 2px;
}

.ivasure-wrap--swatch-shape-rounded .ivasure-swatch,
.ivasure--swatch-shape-rounded .ivasure-swatch {
  border-radius: 7px;
}

.ivasure-wrap--swatch-shape-pill .ivasure-swatch,
.ivasure--swatch-shape-pill .ivasure-swatch {
  border-radius: 999px;
  width: calc(var(--ff-filter-swatch-size) * 1.75);
  flex-basis: calc(var(--ff-filter-swatch-size) * 1.75);
}

.ivasure-swatch__icon {
  font-size: 0.68em;
  font-weight: 700;
  line-height: 1;
  color: var(--ks-text-1, var(--ff-text-main));
  text-transform: uppercase;
}

.ivasure-swatch--texture-pattern {
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in srgb, var(--ks-text-2, var(--ff-muted)) 18%, transparent) 0 4px,
      transparent 4px 8px
    ),
    var(--ks-surface-2, var(--ff-soft));
}

.ivasure-swatch--empty {
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in srgb, var(--ks-text-2, var(--ff-muted)) 16%, transparent) 0 3px,
      transparent 3px 6px
    ),
    var(--ks-surface-2, var(--ff-soft));
}

.ivasure-item--swatch[aria-checked="true"] .ivasure-swatch {
  border-color: var(--ks-color-primary, var(--ff-primary));
  box-shadow:
    inset 0 0 0 2px var(--ks-surface-1, var(--ff-surface)),
    0 0 0 2px var(--ks-color-primary, var(--ff-primary));
}

.ivasure-wrap--swatch-selected-checkmark .ivasure-item--swatch[aria-checked="true"] .ivasure-swatch::after,
.ivasure--swatch-selected-checkmark .ivasure-item--swatch[aria-checked="true"] .ivasure-swatch::after {
  content: "";
  width: 44%;
  height: 26%;
  border-left: 2px solid var(--ks-surface-1, var(--ff-surface));
  border-bottom: 2px solid var(--ks-surface-1, var(--ff-surface));
  filter: drop-shadow(0 1px 1px rgb(15 23 42 / 0.32));
  transform: translateY(-1px) rotate(-45deg);
}

.ivasure-wrap--swatch-selected-filled .ivasure-item--swatch[aria-checked="true"],
.ivasure--swatch-selected-filled .ivasure-item--swatch[aria-checked="true"] {
  padding-inline: 8px;
  border-radius: 8px;
  background: var(--ff-primary-trans-10);
}

.ivasure-wrap--swatch-selected-underline .ivasure-item--swatch[aria-checked="true"]::after,
.ivasure--swatch-selected-underline .ivasure-item--swatch[aria-checked="true"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: calc(var(--ff-filter-swatch-size) + var(--ff-filter-swatch-row-gap));
  height: 2px;
  border-radius: 999px;
  background: var(--ks-color-primary, var(--ff-primary));
}

.ivasure-item--swatch:hover .ivasure-swatch,
.ivasure-item--swatch:focus-visible .ivasure-swatch {
  border-color: var(--ks-color-primary, var(--ff-primary));
  transform: scale(1.03);
}

/* Hairline so near-white swatches stay visible on light surfaces. */
.ivasure-swatch {
  outline: 1px solid color-mix(in srgb, var(--ks-text-1, var(--ff-text-main)) 12%, transparent);
  outline-offset: -1px;
}

.ivasure-wrap--swatch-count-hidden .ivasure--style-swatch .ivasure-count,
.ivasure .ivasure-count.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ivasure-wrap--swatch-count-badge .ivasure--style-swatch .ivasure-count,
.ivasure--style-swatch .ivasure-count--badge {
  margin-left: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  border-color: transparent;
  background: var(--ff-primary-trans-10);
  color: var(--ks-color-primary, var(--ff-primary));
}

.ivasure--style-swatch.ivasure--swatch-layout-grid .ivasure-tree,
.ivasure-wrap--swatch-layout-grid .ivasure--style-swatch .ivasure-tree {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr));
  gap: var(--ff-filter-swatch-row-gap);
}

.ivasure--style-swatch.ivasure--swatch-layout-grid .ivasure-row,
.ivasure-wrap--swatch-layout-grid .ivasure--style-swatch .ivasure-row {
  height: 100%;
}

.ivasure--style-swatch.ivasure--swatch-layout-grid .ivasure-item--swatch,
.ivasure-wrap--swatch-layout-grid .ivasure--style-swatch .ivasure-item--swatch {
  align-items: center;
  min-height: calc(var(--ff-filter-swatch-size) + 18px);
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--ks-border-1, var(--ff-border)) 72%, transparent);
  border-radius: 8px;
}

.ivasure-wrap--swatch-unavailable-hide .ivasure--style-swatch:not([data-swatch-unavailable-behavior]) .ivasure-term--empty:not(.ivasure-term--selected):not(.ivasure-term--has-selected),
.ivasure--style-swatch[data-swatch-unavailable-behavior="hide"] .ivasure-term--empty:not(.ivasure-term--selected):not(.ivasure-term--has-selected) {
  display: none !important;
}

.ivasure-wrap--swatch-unavailable-fade .ivasure--style-swatch:not([data-swatch-unavailable-behavior]) .ivasure-term--empty:not(.ivasure-term--selected):not(.ivasure-term--has-selected),
.ivasure--style-swatch[data-swatch-unavailable-behavior="fade"] .ivasure-term--empty:not(.ivasure-term--selected):not(.ivasure-term--has-selected) {
  opacity: 0.46;
}

.ivasure-wrap--swatch-unavailable-disable .ivasure--style-swatch:not([data-swatch-unavailable-behavior]) .ivasure-term--disabled:not(.ivasure-term--selected):not(.ivasure-term--has-selected) > .ivasure-row > .ivasure-item--swatch,
.ivasure--style-swatch[data-swatch-unavailable-behavior="disable"] .ivasure-term--disabled:not(.ivasure-term--selected):not(.ivasure-term--has-selected) > .ivasure-row > .ivasure-item--swatch {
  cursor: not-allowed;
  opacity: 0.56;
  pointer-events: none;
}

.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-tree {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-term {
  margin: 0;
}

.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-row {
  display: block;
  padding: 0;
}

.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-spacer,
.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-toggle {
  display: none;
}

.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-item--swatch {
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border: 1px solid transparent !important;
  border-radius: 999px;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-item--swatch:hover,
.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-item--swatch:focus-visible {
  border-color: var(--ks-border-1, var(--ff-border)) !important;
  background: var(--ks-surface-2, var(--ff-soft)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ks-color-primary, var(--ff-primary, #0f766e)) 10%, transparent);
}

.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-item--swatch[aria-checked="true"] {
  border-color: var(--ks-color-primary, var(--ff-primary)) !important;
  background: var(--ff-primary-trans-10) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ks-color-primary, var(--ff-primary, #0f766e)) 16%, transparent);
}

.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-swatch {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-item--swatch:hover .ivasure-swatch,
.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-item--swatch:focus-visible .ivasure-swatch {
  transform: scale(1.04);
}

.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-item--swatch[aria-checked="true"] .ivasure-swatch {
  box-shadow:
    inset 0 0 0 2px var(--ks-surface-1, var(--ff-surface)),
    0 0 0 2px var(--ks-color-primary, var(--ff-primary, #0f766e));
}

.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-label,
.ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-count {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ivasure-item--checkbox .ivasure-count,
.ivasure-item--radio .ivasure-count,
.ivasure-item--radio_multi .ivasure-count,
.ivasure-item--swatch .ivasure-count {
  margin-left: auto;
}

.ivasure--no-toggles .ivasure-row {
  grid-template-columns: 1fr;
  column-gap: 0;
}

.ivasure--no-toggles .ivasure-children {
  margin-left: 4px;
  padding-left: 6px;
}

.ivasure--no-toggles .ivasure-term--has-selected > .ivasure-row::before {
  left: 0;
}

.ivasure-item:focus-visible {
  outline: 2px solid var(--ks-color-primary, var(--ff-primary, #0f766e));
  outline-offset: 2px;
}

.ivasure[data-style="pill"] .ivasure-tree {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ivasure[data-style="pill"] .ivasure-term {
  margin: 0;
}

@media (max-width: 720px) {
  .ivasure-wrap {
    --ff-filter-card-padding: 12px;
    --ff-filter-section-gap: 18px;
    --ff-filter-section-inner-gap: 10px;
    --ff-filter-title-search-gap: 8px;
    --ff-filter-search-list-gap: 10px;
    --ff-filter-row-gap: 2px;
    --ff-filter-row-height: 42px;
    --ff-filter-show-more-top: 7px;
    --ff-filter-show-more-bottom: 8px;
    --ff-filter-swatch-size: 22px;
  }

  .ivasure-wrap .ivasure-more-toggle,
  .ivasure-wrap .ivasure-action {
    min-height: 36px;
  }

  .ivasure--collapsible > .ivasure-title {
    padding-right: 26px;
  }

  .ivasure-section-toggle {
    inset: -11px -8px;
  }

  .ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-tree {
    gap: 10px;
    row-gap: 12px;
  }

  .ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-item--swatch {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    min-width: 46px;
  }

  .ivasure-wrap--swatch-labels-compact .ivasure--style-swatch .ivasure-swatch {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
  }

  .ivasure[data-style="pill"] .ivasure-tree {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .ivasure[data-style="pill"] .ivasure-term {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .ivasure-mobile--drawer .ivasure-mobile-toggle {
    display: inline-flex;
  }

  .ivasure-mobile--drawer .ivasure-drawer {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: none;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    background: rgb(15 23 42 / 0.44);
    backdrop-filter: blur(2px);
  }

  .ivasure-mobile--drawer .ivasure-drawer.is-open {
    display: grid;
    align-items: end;
  }

  .ivasure-mobile--drawer .ivasure-drawer__panel {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(100%, 520px);
    max-height: min(86vh, 720px);
    margin: 0 auto;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: var(--ks-surface-1, var(--ff-surface));
    color: var(--ks-text-1, var(--ff-text-main));
    box-shadow: 0 -12px 40px rgb(0 0 0 / 0.18);
  }

  .ivasure-mobile--drawer .ivasure-drawer__panel::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    z-index: 1;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ks-text-2, var(--ff-muted)) 38%, transparent);
    transform: translateX(-50%);
  }

  .ivasure-mobile--drawer .ivasure-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--ks-border-1, var(--ff-border));
    background: var(--ks-surface-1, var(--ff-surface));
  }

  .ivasure-mobile--drawer .ivasure-drawer__body {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 14px;
  }

  .ivasure-mobile--drawer .ivasure-drawer__footer {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--ks-border-1, var(--ff-border));
    background: var(--ks-surface-1, var(--ff-surface));
    box-shadow: 0 -10px 22px rgb(15 23 42 / 0.06);
  }

  .ivasure-drawer__summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-width: 0;
    color: var(--ks-text-2, var(--ff-muted));
    font-size: var(--ff-text-xs);
    font-weight: 700;
  }

  .ivasure-drawer__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--ks-border-1, var(--ff-border));
    border-radius: 999px;
    background: var(--ks-surface-1, var(--ff-surface));
    color: var(--ks-text-2, var(--ff-muted));
    font: inherit;
    font-size: var(--ff-text-xs);
    font-weight: 700;
    cursor: pointer;
  }

  .ivasure-drawer__clear:hover {
    border-color: var(--ks-color-primary, var(--ff-primary, #0f766e));
    color: var(--ks-color-primary, var(--ff-primary, #0f766e));
  }

  .ivasure-drawer__clear[hidden] {
    display: none !important;
  }

  .ivasure-drawer__close {
    border: 1px solid var(--ks-border-1, var(--ff-border));
    border-radius: 999px;
    background: var(--ks-surface-2, var(--ff-soft));
    color: var(--ks-text-1, var(--ff-text-main));
    width: 32px;
    height: 32px;
    cursor: pointer;
  }

  .ivasure-drawer__apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--ks-color-primary, var(--ff-primary));
    border-radius: 8px;
    background: var(--ks-color-primary, var(--ff-primary));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
  }

  @media (max-width: 420px) {
    .ivasure-mobile--drawer .ivasure-drawer__footer {
      grid-template-columns: 1fr;
    }

    .ivasure-drawer__apply {
      width: 100%;
    }
  }

  .sc-sidebar-drawer .ivasure-mobile--drawer .ivasure-mobile-toggle,
  .sc-sidebar-drawer .ivasure-mobile--drawer .ivasure-drawer__header,
  .sc-sidebar-drawer .ivasure-mobile--drawer .ivasure-drawer__footer {
    display: none;
  }

  .sc-sidebar-drawer .ivasure-mobile--drawer .ivasure-drawer {
    position: static;
    inset: auto;
    z-index: auto;
    display: block;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .sc-sidebar-drawer .ivasure-mobile--drawer .ivasure-drawer__panel {
    display: block;
    width: 100%;
    max-height: none;
    margin: 0;
    overflow: visible;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .sc-sidebar-drawer .ivasure-mobile--drawer .ivasure-drawer__body {
    overflow: visible;
    padding: 0;
  }

  .ivasure-price-filter {
    grid-template-columns: 1fr;
  }

  .ivasure-global-controls {
    grid-template-columns: 1fr;
  }
}

.ivasure-results-target--loading {
  opacity: 0.58;
  pointer-events: none;
}

.ivasure-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}

.ivasure-results--empty {
  max-width: 720px;
  border: 1px dashed hsl(var(--ff-primary-h) var(--ff-primary-s) var(--ff-primary-l) / 0.42);
  border-radius: 8px;
  padding: 14px 16px;
  background:
    radial-gradient(circle at 1px 1px, hsl(var(--ff-primary-h) var(--ff-primary-s) var(--ff-primary-l) / 0.12) 1px, transparent 1.5px) 0 0 / 16px 16px,
    hsl(var(--ff-base-h) var(--ff-base-s) 99%);
  color: hsl(var(--ff-base-h) var(--ff-base-s) var(--ff-text-main-l));
}

.ivasure-result-card {
  display: grid;
  gap: 8px;
}

.ivasure-result-card__media {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ks-surface-2, #f6f7f7);
}

.ivasure-result-card__media img {
  display: block;
  width: 100%;
  height: auto;
}

.ivasure-result-card__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.ivasure-result-card__title a {
  color: inherit;
  text-decoration: none;
}

.ivasure-result-card__excerpt,
.ivasure-results--empty p {
  margin: 0;
  color: var(--ks-text-2, #646970);
  font-size: 0.92rem;
}

.ivasure-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  max-width: 100%;
}

.ivasure-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--ks-border-1, var(--ff-border));
  border-radius: 6px;
  color: var(--ks-text-1, hsl(var(--ff-base-h, 205) var(--ff-base-s, 24%) var(--ff-text-main-l, 12%)));
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.ivasure-pagination__link:hover,
.ivasure-pagination__link.is-current {
  border-color: var(--ks-color-primary, var(--ff-primary, #0f766e));
  background: var(--ff-primary-trans-10);
  color: var(--ks-color-primary, var(--ff-primary, #0f766e));
}

/* Modern accessible hiding (WP core pattern): the old left:-10000px
   technique creates a ~10,000px leftward scroll canvas under RTL locales
   (NX24 finding - the scroll direction flips, so the parked offset becomes
   reachable overflow). Clip-based hiding has no physical offset. */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  border: 0;
  word-wrap: normal !important;
}

/* Keep SureCart product list search light when the global dark theme is enabled. */
body.surecart-theme-dark .wp-block-surecart-product-list-search {
  --sc-input-background-color: var(--sc-color-white);
  --sc-input-background-color-hover: var(--sc-color-white);
  --sc-input-background-color-focus: var(--sc-color-white);
  --sc-input-border-color: var(--sc-color-gray-300);
  --sc-input-border-color-hover: var(--sc-color-gray-400);
  --sc-input-border-color-focus: var(--sc-color-primary-500);
  --sc-input-color: var(--sc-color-gray-700);
  --sc-input-color-hover: var(--sc-color-gray-700);
  --sc-input-color-focus: var(--sc-color-gray-700);
  --sc-input-placeholder-color: var(--sc-color-gray-400);
  --sc-input-icon-color: var(--sc-color-gray-400);
}

body.surecart-theme-dark .wp-block-surecart-product-list-search .sc-input-group-text,
body.surecart-theme-dark .wp-block-surecart-product-list-search .sc-form-control {
  color: var(--sc-input-color);
}

/* Tablet tier: let the filter card use its container's full width between the
   phone drawer breakpoint and desktop sidebars. */
@media (min-width: 1025px) {
  .sc-sidebar-desktop > .wp-block-ivasure-filter {
    min-width: 0;
  }

  /* The layout preset records the shape the merchant designed for - it
     cannot know where the shortcode actually landed. Keyed on the option
     alone this clamp turned a [ivasure] in ordinary page content into a
     ~745px sticky inner scroller with the page's own room going unused, so
     it now waits for ivasure.js to confirm the panel's own column really is
     sidebar-narrow (it sets .ivasure-wrap--pinned). The merchant's choice
     still decides WHETHER to pin; context decides whether pinning is
     physically sensible. Without JavaScript the panel simply flows: never
     pinned, and never clipped either. */
  .ivasure-wrap--layout-sidebar.ivasure-wrap--pinned {
    position: sticky;
    top: var(--ff-filter-sticky-top, 24px);
    max-height: calc(100vh - var(--ff-filter-sticky-top, 24px) - 24px);
    overflow: hidden auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ff-filter-scroll-thumb, color-mix(in srgb, currentColor 34%, transparent)) transparent;
    scroll-padding-block-end: var(--ff-filter-scroll-cue, 16px);
  }

  /* A mask fades everything the element PAINTS - border, radius, shadow - and
     it does that whether or not the box scrolls. Keyed on the preset alone it
     dissolved the bottom edge of a pinned column that fits, while telling the
     shopper there was more below a list entirely on screen. ivasure.js
     measures scrollHeight > clientHeight on the element that really scrolls
     and marks it; only then is the cue earned. The scrollbar tint and the
     scroll padding stay unconditional - both are inert when nothing scrolls. */
  .ivasure-wrap--layout-sidebar.ivasure-wrap--pinned.ivasure-is-overflowing {
    mask-image: linear-gradient(to bottom, #000 calc(100% - var(--ff-filter-scroll-cue, 16px)), transparent 100%);
  }

  .ivasure-wrap--layout-sidebar.ivasure-wrap--pinned::-webkit-scrollbar {
    width: 10px;
  }

  .ivasure-wrap--layout-sidebar.ivasure-wrap--pinned::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: var(--ff-filter-scroll-thumb, color-mix(in srgb, currentColor 34%, transparent));
    background-clip: content-box;
  }
}

@supports selector(:has(*)) {
  @media (min-width: 1025px) {
    /* A themed sidebar column narrower than ~260px cannot hold a swatch, a
       label and a count without breaking words, so the column gets a floor
       whenever it is ours to fill. */
    .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) {
      flex-basis: var(--ff-filter-sidebar-min, 260px);
      min-width: var(--ff-filter-sidebar-min, 260px);
    }
  }

  /* The IvaSure SureCart/Etch bridge already paints the sidebar itself as a
     card - border, radius, blur, its own padding. Drawing a second card
     inside it is what produced the box-in-a-box look, so ours stands down
     and the bridge card becomes the one panel holding sort and filters
     together. The specificity here has to clear the bridge rule, which
     carries a body element selector. */
  body.ivasure-sc-etch-compat .sc-sidebar-desktop > .wp-block-ivasure-filter > .ivasure-wrap--surface-card {
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  @media (min-width: 1025px) {
    body.ivasure-sc-etch-compat .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) {
      flex-basis: var(--ff-filter-sidebar-min, 260px);
      min-width: var(--ff-filter-sidebar-min, 260px);
      position: sticky;
      top: var(--ff-filter-sticky-top, 24px);
      align-self: flex-start;
      max-height: calc(100vh - var(--ff-filter-sticky-top, 24px) - 24px);
      overflow: hidden auto;
      /* This is a pinned column, not a modal: bottoming the filters out
         should hand the wheel back to the page. `contain` trapped it. */
      scrollbar-width: thin;
      /* Measured on /shop/ at 1440x900: 1136px of filters inside a 742px
         box, with the platform's overlay scrollbar painting only while the
         wheel moves - at rest nothing said three of the four sections were
         below the cut. A tinted thumb makes the bar persistent wherever the
         platform honours it, and the soft bottom edge shows the list
         continuing past the fold. The cue is shorter than the card's own
         bottom padding, so at scroll end it lands on blank space instead of
         half-erasing the last row. */
      scrollbar-color: var(--ff-filter-scroll-thumb, color-mix(in srgb, currentColor 34%, transparent)) transparent;
      scroll-padding-block-end: var(--ff-filter-scroll-cue, 16px);
    }

    /* Same gate as the pinned wrap above: the fade is a statement that content
       continues past the fold, so it may only paint while it is true. On a tall
       viewport this card does not scroll, and an unconditional mask ate its 1px
       border and 14px corner for a list that was entirely visible. */
    body.ivasure-sc-etch-compat .sc-sidebar-desktop:has(> .wp-block-ivasure-filter).ivasure-is-overflowing {
      mask-image: linear-gradient(to bottom, #000 calc(100% - var(--ff-filter-scroll-cue, 16px)), transparent 100%);
    }

    body.ivasure-sc-etch-compat .sc-sidebar-desktop:has(> .wp-block-ivasure-filter)::-webkit-scrollbar {
      width: 10px;
    }

    body.ivasure-sc-etch-compat .sc-sidebar-desktop:has(> .wp-block-ivasure-filter)::-webkit-scrollbar-thumb {
      border: 3px solid transparent;
      border-radius: 999px;
      background: var(--ff-filter-scroll-thumb, color-mix(in srgb, currentColor 34%, transparent));
      background-clip: content-box;
    }

    /* One scroll container, not two: the bridge card is now the thing that
       pins and scrolls, so the panel inside it goes back to static flow -
       and hands back the scroll cue with it. A panel that does not clip
       must not wear a fade, or its last row looks trimmed for nothing. */
    body.ivasure-sc-etch-compat .sc-sidebar-desktop .ivasure-wrap--layout-sidebar {
      position: static;
      max-height: none;
      overflow: visible;
      mask-image: none;
      scroll-padding-block-end: auto;
    }
  }
}

/* SureCart renders its own sort block as a sibling of ours inside the same
   sidebar. Left alone it reads as unstyled radios stacked on top of a
   designed panel, so it is adopted into the same vocabulary - but only when
   our block is actually there, and only where :has() is supported. */
@supports selector(:has(*)) {
  .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) .wp-block-surecart-product-list-sort-radio-group-label {
    display: block;
    margin-bottom: 6px;
    font-size: calc(var(--sc-input-font-size-medium, 1rem) * var(--ff-font-factor, 1) * var(--ff-title-factor, 1.25) * var(--ff-filter-title-scale, 0.625));
    font-weight: 600;
    letter-spacing: var(--ff-filter-title-tracking, 0.06em);
    text-transform: var(--ff-filter-title-transform, uppercase);
    color: hsl(var(--ff-base-h, 205) var(--ff-base-s, 24%) var(--ff-text-muted-l, 40%));
  }

  /* Dark scheme. The muted lightness above is chosen for a light panel; on the
     dark shop sidebar it measured 2.8:1, and this rule outranks the Etch
     layer's ink rule for the same label (2026-09-05 shopper audit). Follow the
     Etch layer's muted ink where it is present (it flips with the scheme), else
     the site ink, else a light step of the merchant's own neutral. The hover
     row below took the same light-only fill. */
  html[data-ks-theme="dark"] .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) .wp-block-surecart-product-list-sort-radio-group-label,
  body.surecart-theme-dark .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) .wp-block-surecart-product-list-sort-radio-group-label {
    color: var(--ks-sc-etch-muted, var(--ks-ink, hsl(var(--ff-base-h, 205) var(--ff-base-s, 24%) 82%)));
  }

  html[data-ks-theme="dark"] .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) .sc-form-check.wp-block-surecart-product-list-sort-radio:hover,
  body.surecart-theme-dark .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) .sc-form-check.wp-block-surecart-product-list-sort-radio:hover {
    background: color-mix(in srgb, currentColor 10%, transparent);
  }

  .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) .sc-form-check.wp-block-surecart-product-list-sort-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--ff-filter-row-height, 30px);
    border-radius: var(--ff-filter-row-radius, 6px);
    text-decoration: none;
    transition: background-color var(--ff-filter-motion, 150ms) ease;
  }

  .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) .sc-form-check.wp-block-surecart-product-list-sort-radio:hover {
    background: hsl(var(--ff-base-h, 205) var(--ff-base-s, 24%) 96%);
  }

  .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) .sc-form-check.wp-block-surecart-product-list-sort-radio .sc-check-input {
    flex: 0 0 auto;
    margin: 0;
    accent-color: hsl(var(--ff-primary-h, 174) var(--ff-primary-s, 80%) var(--ff-primary-l, 40%));
  }

  .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) .sc-form-check.wp-block-surecart-product-list-sort-radio label {
    margin: 0;
    cursor: pointer;
    line-height: 1.3;
    font-size: calc(var(--sc-input-font-size-medium, 1rem) * var(--ff-font-factor, 1));
  }

  .sc-sidebar-desktop:has(> .wp-block-ivasure-filter) .wp-block-surecart-product-list-sort-radio-group {
    margin-bottom: 4px;
  }
}

@media (min-width: 721px) and (max-width: 1024px) {
  .ivasure-wrap {
    max-width: none;
  }

  .ivasure-global-controls {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* The drawer grabber only makes sense on the floating bottom sheet. */
.sc-sidebar-drawer .ivasure-mobile--drawer .ivasure-drawer__panel::before {
  content: none;
}

@media (prefers-reduced-motion: reduce) {
  .ivasure-wrap *,
  .ivasure-wrap *::before,
  .ivasure-wrap *::after,
  .ivasure-drawer,
  .ivasure-drawer *,
  .ivasure-drawer *::before,
  .sc-sidebar-desktop .wp-block-surecart-product-list-sort-radio {
    animation: none !important;
    transition: none !important;
  }
}

/* No JavaScript.
   Scripting-off is a media feature, so a shopper whose script is running never
   sees any of this (no flash of the open drawer before hydration), and nothing
   below changes the enhanced experience. Without scripting every control that
   needs a script to open is shown inline and every dead control is dropped:
   the drawer panel is laid out in the page (as .sc-sidebar-drawer already
   does), collapsed sections and tree branches are open, and the term links,
   chips, pagination and the global GET form (which carries the rest of the
   state in hidden inputs) do the work. The [hidden] overrides below are
   deliberate: they beat the attribute only while scripting is off. */
.ivasure-nojs-clear {
  display: none;
}

@media (scripting: none) {
  .ivasure-wrap .ivasure-mobile-toggle,
  .ivasure-wrap .ivasure-drawer .ivasure-drawer__header,
  .ivasure-wrap .ivasure-drawer .ivasure-drawer__footer,
  .ivasure-wrap .ivasure-section-toggle,
  .ivasure-wrap .ivasure-more-toggle,
  .ivasure-wrap .ivasure-search-wrap,
  .ivasure-wrap .ivasure-apply-bar,
  .ivasure-wrap .ivasure-action:not(.ivasure-action--apply) {
    display: none;
  }

  .ivasure-wrap .ivasure-drawer[data-ivasure-drawer] {
    position: static;
    inset: auto;
    z-index: auto;
    display: block;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .ivasure-wrap .ivasure-drawer[data-ivasure-drawer] .ivasure-drawer__panel {
    position: static;
    display: block;
    width: 100%;
    max-height: none;
    margin: 0;
    overflow: visible;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .ivasure-wrap .ivasure-drawer[data-ivasure-drawer] .ivasure-drawer__panel::before {
    content: none;
  }

  .ivasure-wrap .ivasure-drawer .ivasure-drawer__body {
    overflow: visible;
    padding: 0;
  }

  /* The branch toggle keeps its grid column (display: none would let the
     link slide into the 20px toggle column of its row). */
  .ivasure-wrap .ivasure-toggle {
    visibility: hidden;
  }

  /* Beats `.ivasure-section__body[hidden] { display: none !important }`:
     later in the file, higher specificity, !important, and the body's own
     display type (grid). */
  .ivasure-wrap .ivasure-section__body[hidden] {
    display: grid !important;
  }

  .ivasure-wrap .ivasure-children[hidden] {
    display: block;
  }

  .ivasure-wrap .ivasure-nojs-clear {
    display: inline-block;
  }
}
