/*
 * Aderlo Facets — wygląd filtrów katalogu (wspólny dla motywów).
 * Kolory i kroje bierze ze zmiennych `--afx-*`; motyw ustawia je na `.afx-wrap`,
 * `.afx-active` i `.afx-open` we własnym arkuszu i nie nadpisuje reguł poniżej.
 */

.afx-wrap, .afx-active, .afx-open, .afx-empty {
  --afx-ink: #1a1418;
  --afx-muted: #6e6169;
  --afx-line: #e8dce2;
  --afx-bg: #fff;
  --afx-soft: #f5eaef;
  --afx-accent: #5d2447;
  --afx-accent-ink: #fff;
  --afx-radius: 12px;
  --afx-font: inherit;
  --afx-shadow: 0 18px 50px rgba(0, 0, 0, .12);
  font-family: var(--afx-font);
}

.afx-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- PANEL --- */

.afx { color: var(--afx-ink); margin: 0; }
.afx__head { display: flex; align-items: center; gap: 10px; padding: 0 0 10px; }
.afx__title { margin: 0; font-weight: 700; font-size: 17px; flex: 1; display: flex; align-items: center; gap: 8px; }
.afx__title em, .afx-g__badge, .afx-open em {
  font-style: normal; font-size: 11.5px; font-weight: 700; line-height: 1;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--afx-accent); color: var(--afx-accent-ink);
}
.afx__clear { font-size: 13.5px; color: var(--afx-muted); text-decoration: underline; text-underline-offset: 3px; }
.afx__clear:hover { color: var(--afx-accent); }
.afx__x { display: none; }
.afx__foot { display: none; }
.afx-backdrop { display: none; }

/* --------------------------------------------------------------- GRUPY --- */

.afx-g { border-top: 1px solid var(--afx-line); }
.afx-g__sum {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 13px 2px; font-weight: 650; font-size: 15px; user-select: none;
}
.afx-g__sum::-webkit-details-marker { display: none; }
.afx-g__name { flex: 1; min-width: 0; }
.afx-g__chev { flex: 0 0 auto; opacity: .55; transition: transform .18s ease; }
.afx-g[open] > .afx-g__sum .afx-g__chev { transform: rotate(180deg); }
.afx-g__sum:focus-visible { outline: 2px solid var(--afx-accent); outline-offset: 2px; border-radius: 6px; }
.afx-g__body { padding: 0 0 14px; }

/* ------------------------------------------------------------- OPCJE --- */

.afx-list { list-style: none; margin: 0; padding: 0; }
.afx-li--extra, .afx-li.is-miss { display: none; }
.afx-g.is-all .afx-li--extra { display: block; }
.afx-g.is-finding .afx-li--extra:not(.is-miss) { display: block; }
.afx-g.is-finding .afx-more { display: none; }

.afx-opt {
  display: flex; align-items: center; gap: 10px; padding: 6px 4px; margin: 0;
  border-radius: 8px; cursor: pointer; font-size: 14.5px; line-height: 1.3;
}
.afx-opt:hover { background: var(--afx-soft); }
.afx-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.afx-box {
  flex: 0 0 18px; width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--afx-muted); background: var(--afx-bg);
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s;
}
.afx-opt input:checked + .afx-box { background: var(--afx-accent); border-color: var(--afx-accent); }
.afx-opt input:checked + .afx-box::after {
  content: ""; width: 9px; height: 5px; margin-top: -2px;
  border-left: 2px solid var(--afx-accent-ink); border-bottom: 2px solid var(--afx-accent-ink); transform: rotate(-45deg);
}
.afx-opt input:focus-visible + .afx-box,
.afx-opt input:focus-visible + .afx-switch { outline: 2px solid var(--afx-accent); outline-offset: 2px; }
.afx-opt__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.afx-opt__n { font-style: normal; font-size: 12.5px; color: var(--afx-muted); font-variant-numeric: tabular-nums; }
.afx-opt.is-empty { opacity: .55; }
.afx-opt input:checked ~ .afx-opt__name { font-weight: 650; }

.afx-sw {
  flex: 0 0 16px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--afx-sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}
.afx-sw[style*="transparent"] {
  background: linear-gradient(135deg, #fff 45%, #d33 45%, #d33 55%, #fff 55%);
}

.afx-switch {
  flex: 0 0 34px; width: 34px; height: 20px; border-radius: 999px; position: relative;
  background: var(--afx-line); transition: background .15s;
}
.afx-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s;
}
.afx-opt input:checked + .afx-switch { background: var(--afx-accent); }
.afx-opt input:checked + .afx-switch::after { transform: translateX(14px); }

.afx-more {
  margin: 6px 0 0; padding: 4px 4px; border: 0; background: none; cursor: pointer;
  color: var(--afx-accent); font: inherit; font-size: 13.5px; font-weight: 650;
  text-decoration: underline; text-underline-offset: 3px;
}
.afx-more__off, .afx-g.is-all .afx-more__on { display: none; }
.afx-g.is-all .afx-more__off { display: inline; }
.afx-none { margin: 6px 4px; font-size: 13.5px; color: var(--afx-muted); }

.afx-find {
  width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 8px 11px; min-height: 38px;
  border: 1px solid var(--afx-line); border-radius: 9px; background: var(--afx-bg); color: var(--afx-ink);
  font: inherit; font-size: 14px;
}
.afx-find:focus { outline: none; border-color: var(--afx-accent); }

/* --------------------------------------------------------------- CENA --- */

.afx-price { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto auto; align-items: end; gap: 6px; }
.afx-price__f { min-width: 0; display: flex; flex-direction: column; gap: 3px; margin: 0; font-size: 12px; color: var(--afx-muted); }
.afx-price__f input {
  width: 100%; box-sizing: border-box; padding: 8px 9px; min-height: 38px; margin: 0;
  border: 1px solid var(--afx-line); border-radius: 9px; background: var(--afx-bg); color: var(--afx-ink);
  font: inherit; font-size: 14px; -moz-appearance: textfield;
}
.afx-price__f input::-webkit-outer-spin-button,
.afx-price__f input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.afx-price__f input:focus { outline: none; border-color: var(--afx-accent); }
.afx-price__sep, .afx-price__cur { padding-bottom: 10px; color: var(--afx-muted); font-size: 13px; }
.afx-price__go {
  min-height: 38px; padding: 0 12px; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--afx-accent); color: var(--afx-accent-ink); font: inherit; font-size: 13.5px; font-weight: 700;
}
.afx-presets { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.afx-preset {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; cursor: pointer;
  border: 1px solid var(--afx-line); border-radius: 999px; background: var(--afx-bg); color: var(--afx-ink);
  font: inherit; font-size: 13px;
}
.afx-preset em { font-style: normal; color: var(--afx-muted); font-size: 12px; }
.afx-preset:hover { border-color: var(--afx-accent); }
.afx-preset.is-on { background: var(--afx-accent); border-color: var(--afx-accent); color: var(--afx-accent-ink); }
.afx-preset.is-on em { color: inherit; opacity: .8; }

/* ------------------------------------------------- WYBRANE FILTRY --- */

.afx-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.afx-active__t { font-size: 13.5px; color: var(--afx-muted); margin-right: 2px; }
.afx-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px 6px 12px;
  border-radius: 999px; background: var(--afx-soft); color: var(--afx-ink);
  border: 1px solid transparent; font-size: 13.5px; line-height: 1.2; text-decoration: none;
}
.afx-chip:hover { border-color: var(--afx-accent); }
.afx-chip__k { color: var(--afx-muted); }
.afx-chip__v { font-weight: 650; }
.afx-chip__x { font-size: 17px; line-height: 1; width: 18px; text-align: center; opacity: .7; }
.afx-chip--clear { background: none; text-decoration: underline; text-underline-offset: 3px; padding-left: 4px; color: var(--afx-muted); }

/* ------------------------------------------------------ STANY --- */

.afx-busy { opacity: .5; pointer-events: none; transition: opacity .15s; }
.afx-loading .afx::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--afx-accent), transparent);
  background-size: 50% 100%; animation: afx-bar 0.9s linear infinite;
}
.afx { position: relative; }
@keyframes afx-bar { from { background-position: -50% 0; } to { background-position: 150% 0; } }

.afx-empty { padding: 28px 0 8px; }
.afx-empty__t { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: var(--afx-ink); }
.afx-empty__d { margin: 0 0 16px; color: var(--afx-muted); }

.afx-open {
  display: none; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; cursor: pointer;
  border: 1px solid var(--afx-line); border-radius: 999px; background: var(--afx-bg); color: var(--afx-ink);
  font: inherit; font-size: 14.5px; font-weight: 650;
}

/* ================================================ UKŁAD „BAR" (pasek) === */

@media (min-width: 769px) {
  .afx--bar .afx { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
  .afx--bar .afx__head { display: contents; }
  .afx--bar .afx__title { flex: 0 0 auto; font-size: 15px; margin-right: 4px; }
  .afx--bar .afx__clear { order: 99; margin-left: 4px; }
  .afx--bar .afx__body { display: flex; flex-wrap: wrap; gap: 8px; }
  .afx--bar .afx-g { border: 0; position: relative; }
  .afx--bar .afx-g__sum {
    padding: 8px 12px 8px 14px; min-height: 40px; box-sizing: border-box;
    border: 1px solid var(--afx-line); border-radius: 999px; background: var(--afx-bg); font-size: 14px;
  }
  .afx--bar .afx-g.is-on > .afx-g__sum { border-color: var(--afx-accent); }
  .afx--bar .afx-g[open] > .afx-g__sum { border-color: var(--afx-accent); }
  .afx--bar .afx-g__body {
    position: absolute; z-index: 40; top: calc(100% + 8px); left: 0;
    width: 300px; max-height: min(62vh, 520px); overflow: auto; box-sizing: border-box;
    padding: 12px; border: 1px solid var(--afx-line); border-radius: var(--afx-radius);
    background: var(--afx-bg); box-shadow: var(--afx-shadow);
  }
  .afx--bar .afx-g--price > .afx-g__body { width: 340px; }
}

/* =========================================== TELEFON: SZUFLADA === */

@media (max-width: 900px) {
  .afx-open--side { display: inline-flex; }
  .afx--side .afx {
    display: none; position: fixed; z-index: 100000; top: 0; right: 0; bottom: 0;
    width: min(420px, 100vw); flex-direction: column; gap: 0;
    background: var(--afx-bg); box-shadow: var(--afx-shadow);
    animation: afx-in .22s ease;
  }
  .afx--side.is-open .afx { display: flex; }
  .afx--side.afx-instant .afx { animation: none; }
  .afx--side.is-open .afx-backdrop {
    display: block; position: fixed; inset: 0; z-index: 99999; background: rgba(10, 6, 9, .45);
  }
  .afx--side .afx__head {
    display: flex; flex: 0 0 auto; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--afx-line);
  }
  .afx--side .afx__title { font-size: 18px; }
  .afx--side .afx__x {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: 50%; background: var(--afx-soft); color: var(--afx-ink); cursor: pointer;
  }
  .afx--side .afx__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 16px; display: block; }
  .afx--side .afx-g { border-top: 1px solid var(--afx-line); position: static; }
  .afx--side .afx-g:first-of-type { border-top: 0; }
  .afx--side .afx-g__sum { border: 0; border-radius: 0; padding: 15px 2px; min-height: 0; background: none; font-size: 16px; }
  .afx--side .afx-g__body { position: static; width: auto; max-height: none; box-shadow: none; border: 0; padding: 0 0 14px; }
  .afx--side .afx-opt { padding: 9px 4px; font-size: 15.5px; }
  .afx--side .afx__foot {
    display: flex; flex: 0 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--afx-line); background: var(--afx-bg);
  }
  .afx--side .afx__apply {
    flex: 1; min-height: 50px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--afx-accent); color: var(--afx-accent-ink); font: inherit; font-size: 16px; font-weight: 700;
  }
}

@media (max-width: 768px) {
  .afx-open--bar { display: inline-flex; }
  .afx--bar .afx {
    display: none; position: fixed; z-index: 100000; top: 0; right: 0; bottom: 0;
    width: min(420px, 100vw); flex-direction: column; gap: 0;
    background: var(--afx-bg); box-shadow: var(--afx-shadow);
    animation: afx-in .22s ease;
  }
  .afx--bar.is-open .afx { display: flex; }
  .afx--bar.afx-instant .afx { animation: none; }
  .afx--bar.is-open .afx-backdrop {
    display: block; position: fixed; inset: 0; z-index: 99999; background: rgba(10, 6, 9, .45);
  }
  .afx--bar .afx__head {
    display: flex; flex: 0 0 auto; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--afx-line);
  }
  .afx--bar .afx__title { font-size: 18px; }
  .afx--bar .afx__x {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: 50%; background: var(--afx-soft); color: var(--afx-ink); cursor: pointer;
  }
  .afx--bar .afx__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 16px; display: block; }
  .afx--bar .afx-g { border-top: 1px solid var(--afx-line); position: static; }
  .afx--bar .afx-g:first-of-type { border-top: 0; }
  .afx--bar .afx-g__sum { border: 0; border-radius: 0; padding: 15px 2px; min-height: 0; background: none; font-size: 16px; }
  .afx--bar .afx-g__body { position: static; width: auto; max-height: none; box-shadow: none; border: 0; padding: 0 0 14px; }
  .afx--bar .afx-opt { padding: 9px 4px; font-size: 15.5px; }
  .afx--bar .afx__foot {
    display: flex; flex: 0 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--afx-line); background: var(--afx-bg);
  }
  .afx--bar .afx__apply {
    flex: 1; min-height: 50px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--afx-accent); color: var(--afx-accent-ink); font: inherit; font-size: 16px; font-weight: 700;
  }
}

html.afx-lock, html.afx-lock body { overflow: hidden; }
@keyframes afx-in { from { transform: translateX(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .afx-wrap .afx, .afx-g__chev, .afx-switch::after { animation: none !important; transition: none !important; }
}
