/* Woo Fast Filters 3.2.0 — scoped under .wff */

:root {
  --wff-text:   #111;
  --wff-muted:  #666;
  --wff-border: #e7e7e7;
  --wff-active: #111;
  --wff-radius: 10px;
}

/* ── Base panel ─────────────────────────────────────────────────────────── */
.wff.wff-panel {
  margin: 0 0 12px 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.wff.wff-panel hr,
.wff.wff-panel .wp-block-separator { display: none; }

.wff .wff-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--wff-text);
  line-height: 1.25;
}

/* ── Brand ──────────────────────────────────────────────────────────────── */
.wff.wff-panel--brand .wff-title { display: none; }

.wff.wff-panel--brand .wff-brand-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}
@media (max-width: 420px) {
  .wff.wff-panel--brand .wff-brand-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.wff.wff-panel--brand .wff-brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
}

.wff.wff-panel--brand .wff-brand img {
  display: block;
  max-width: 100%;
  max-height: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Aktiv brand: fremhæv med en tydelig ring og let baggrund */
.wff.wff-panel--brand .wff-brand.is-active {
  outline: 2px solid var(--wff-active);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Ikke-aktive brands: dæmp let så det aktive træder frem — men ingen hop i layout */
.wff.wff-panel--brand.wff-has-selection .wff-brand:not(.is-active) {
  opacity: .35;
  filter: grayscale(80%);
  transition: opacity 0.2s, filter 0.2s;
}
.wff.wff-panel--brand.wff-has-selection .wff-brand:not(.is-active):hover {
  opacity: .75;
  filter: grayscale(0%);
}


.wff .wff-x { display: none; }
.wff .wff-brand.is-active .wff-x {
  display: flex;
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: #111;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}

.wff.wff-panel--cat-filter.wff-has-selection .wff-cat-pill:not(.is-active) {
  opacity: .4;
  transition: opacity 0.2s;
}
.wff.wff-panel--cat-filter.wff-has-selection .wff-cat-pill:not(.is-active):hover {
  opacity: 1;
}
.wff .wff-pill-x {
  margin-left: 4px;
  font-size: 12px;
  opacity: .7;
}

.wff .wff-fallback-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--wff-text);
  text-align: center;
}

/* ── Categories ─────────────────────────────────────────────────────────── */
/*
 * FIX: Vandrette linjer.
 * Mange temaer (Flatsome, Storefront, Astra m.fl.) sætter border-bottom på <li>
 * eller <a> inde i sidebar-widgets. Vi nulstiller disse eksplicit.
 */
.wff.wff-panel--cats .wff-catlist {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.wff.wff-panel--cats .wff-cat {
  margin: 0;
  padding: 0;
  border: 0;          /* fjerner tema-border på <li> */
  border-top: 0;
  border-bottom: 0;
  box-shadow: none;
  background: transparent;
}

.wff.wff-panel--cats .wff-cat[hidden] { display: none; }

.wff.wff-panel--cats .wff-cat a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0;
  margin: 0;
  border: 0;          /* fjerner tema-border på <a> */
  border-top: 0;
  border-bottom: 0;
  box-shadow: none;
  background: transparent;
  color: var(--wff-text);
  text-decoration: none;
  line-height: 1.35;
}
.wff.wff-panel--cats .wff-cat a:hover { text-decoration: underline; }

.wff.wff-panel--cats .wff-cat.is-current-cat > a,
.wff.wff-panel--cats .wff-cat.is-parent-cat  > a { font-weight: 700; }

.wff.wff-panel--cats .wff-cat-toggle {
  display: block;
  width: 100%;
  text-align: right;
  margin-top: 4px;
  padding: 0;
  background: transparent;
  border: 0;
  text-decoration: none;
  cursor: pointer;
}
.wff.wff-panel--cats .wff-cat-toggle:hover { text-decoration: underline; }

/* ── Attribute: pills (forsiden) ────────────────────────────────────────── */
.wff .wff-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wff .wff-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--wff-border);
  border-radius: 999px;
  background: #fff;
  color: var(--wff-text);
  text-decoration: none;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}
.wff .wff-pill:hover    { border-color: var(--wff-active); }
.wff .wff-pill.is-active {
  border: 2px solid var(--wff-active);
  font-weight: 600;
}

/* ── Attribute: checkboxes (kategori/taksonomisider) ─────────────────────
 * Vises kun når man IKKE er på forsiden af shoppen.
 * Rendres som klikkbare <a>-elementer med et CSS-checkbox-ikon.
 */
.wff.wff-panel--attr-cb .wff-cb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wff.wff-panel--attr-cb .wff-cb-item {
  margin: 0;
  padding: 0;
}

.wff.wff-panel--attr-cb .wff-cb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 4px 0;
  text-decoration: none;
  color: var(--wff-text);
  cursor: pointer;
  user-select: none;
}
.wff.wff-panel--attr-cb .wff-cb-link:hover .wff-cb-label { text-decoration: underline; }

/* Checkbox-boks */
.wff.wff-panel--attr-cb .wff-cb {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--wff-border);
  border-radius: 3px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}

/* Checked state */
.wff.wff-panel--attr-cb .wff-cb-link.is-active .wff-cb {
  background: var(--wff-active);
  border-color: var(--wff-active);
}

/* Flueben */
.wff.wff-panel--attr-cb .wff-cb-link.is-active .wff-cb::after {
  content: "";
  display: block;
  width: 10px;
  height: 6px;
  border-left:   2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.wff.wff-panel--attr-cb .wff-cb-label {
  font-size: 14px;
  line-height: 1.3;
  flex: 1;
}

.wff.wff-panel--attr-cb .wff-cb-count {
  font-size: 12px;
  color: var(--wff-muted);
  margin-left: 2px;
}

/* ── Price slider (div-based) ───────────────────────────────────────────── */
.wff.wff-panel--price { padding-top: 4px; }

.wff .wff-ps {
  position: relative;
  height: 36px;
  margin: 6px 0 8px 0;
  touch-action: none;
}

.wff .wff-ps-track {
  position: absolute;
  left: 0; right: 0;
  top: 14px;
  height: 8px;
  border-radius: 999px;
  background: #ececec;
  overflow: hidden;
}

.wff .wff-ps-fill {
  position: absolute;
  top: 0; bottom: 0;
  left: 0; right: 0;
  background: var(--wff-active);
}

.wff .wff-ps-handle {
  position: absolute;
  top: 9px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--wff-active);
  transform: translateX(-50%);
  cursor: pointer;
  touch-action: none;
}
.wff .wff-ps-handle:focus-visible {
  outline: 2px solid var(--wff-active);
  outline-offset: 2px;
}

.wff .wff-price-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.wff .wff-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wff .wff-field-label {
  font-size: 12px;
  color: var(--wff-muted);
}

.wff .wff-price-input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--wff-border);
  border-radius: var(--wff-radius);
  width: 100%;
  background: #fff;
  color: var(--wff-text);
  font-size: 14px;
}

/* ── Brugertilpassede rettelser (integreret fra manuelle overrides) ─────── */

/* Ingen border-bottom på widget i sidebar */
.woocommerce-page.archive .sidebar-content aside.widget {
  border-bottom: none;
  padding: 5px 0;
}

/* Fjern borders på kategori-list-items (tema-override) */
li.wff-cat {
  border: 0 !important;
}

/* Lidt mere kompakt kategoriliste */
.wff.wff-panel--cats .wff-cat a {
  min-height: 32px;
}

/* Fjern borders på checkbox-list-items */
li.wff-cb-item {
  border: none !important;
}

/* Tættere brand-grid */
.wff.wff-panel--brand .wff-brand-row {
  gap: 4px;
}

/* ── Collapsible attribute panels ───────────────────────────────────────── */
.wff.wff-panel--collapsible .wff-cb-list,
.wff.wff-panel--collapsible .wff-pill-group {
  display: none;
  margin-top: 4px;
}
.wff.wff-panel--collapsible[data-open="true"] .wff-cb-list {
  display: block;
}
.wff.wff-panel--collapsible[data-open="true"] .wff-pill-group {
  display: flex;
}

.wff .wff-panel-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  padding: 0;
  margin: 0 0 2px 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: var(--wff-text);
}
.wff .wff-panel-toggle:hover .wff-panel-toggle-label {
  text-decoration: underline;
}
.wff .wff-panel-toggle-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

/* +/- ikon via ren CSS */
.wff .wff-panel-toggle-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  position: relative;
  margin-left: 8px;
}
.wff .wff-panel-toggle-icon::before,
.wff .wff-panel-toggle-icon::after {
  content: "";
  position: absolute;
  background: var(--wff-text);
  border-radius: 2px;
  transition: transform 0.18s ease;
}
.wff .wff-panel-toggle-icon::before {
  width: 10px; height: 2px;
  top: 7px; left: 3px;
}
.wff .wff-panel-toggle-icon::after {
  width: 2px; height: 10px;
  top: 3px; left: 7px;
}
/* Open state: collapse the vertical bar to show a minus */
.wff.wff-panel--collapsible[data-open="true"] .wff-panel-toggle-icon::after {
  transform: scaleY(0);
}

/* Fjern borders på ul.wff-cb-list (tema-override) */
ul.wff-cb-list {
  border: none !important;
}

/* Disabled (no matching products) attribute terms */
.wff .wff-cb-link.is-disabled,
.wff .wff-pill.is-disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Disabled brand — same size, greyed out */
.wff .wff-brand.is-disabled { opacity:.2; filter:grayscale(100%); cursor:not-allowed; pointer-events:none; }
