/* Filtro Prodotti Smart — colori modificabili qui sotto */
.fps {
  --fps-accento: #e30613;      /* rosso */
  --fps-scuro: #111111;        /* nero */
  --fps-chiaro: #ffffff;
  --fps-bordo: #e6e6e6;
  --fps-testo-2: #6b6b6b;
  --fps-raggio: 14px;
  --fps-pronta: #12a150;
  --fps-slider: #6fb6e0;        /* cursore e istogramma del prezzo */
  --fps-slider-chiaro: #bcdcf0;
  color: var(--fps-scuro);
}
.fps *, .fps *::before, .fps *::after { box-sizing: border-box; }
.fps button { font: inherit; cursor: pointer; }
.fps-titolo { margin: 0 0 18px; }

/* ---------- categorie (colonna a sinistra) ---------- */
.fps-cerca {
  width: 100%; padding: 9px 12px; margin: 0 0 10px; border: 1.5px solid var(--fps-bordo); border-radius: 10px;
  font: inherit; font-size: 14px; background: #fff; color: var(--fps-scuro);
}
.fps-cerca:focus { outline: none; border-color: var(--fps-scuro); }
.fps-tipi {
  display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow-y: auto;
  margin-right: -6px; padding-right: 6px; scrollbar-width: thin;
}
.fps-tipo {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--fps-scuro);
  font-size: 14.5px; text-align: left; line-height: 1.25; transition: background .15s, color .15s;
}
.fps-tipo[hidden] { display: none; }
.fps-tipo:hover { background: #f4f4f4; }
.fps-tipo.is-on { background: var(--fps-scuro); color: var(--fps-chiaro); font-weight: 600; }
.fps-tipo-n { font-size: 12px; color: var(--fps-testo-2); flex: 0 0 auto; }
.fps-tipo.is-on .fps-tipo-n { color: rgba(255,255,255,.7); }
.fps-cat-nome { color: var(--fps-scuro); font-weight: 600; }

/* ---------- layout ---------- */
.fps-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 36px; align-items: start; }
.fps-pannello { position: sticky; top: 24px; }
.fps-pannello-head, .fps-apri, .fps-mostra, .fps-overlay { display: none; }

.fps-gruppo { padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid var(--fps-bordo); }
.fps-gruppo h3 { font-size: 16px; letter-spacing: -.01em; text-transform: none; margin: 0 0 12px; font-weight: 700; line-height: 1.25; }
.fps-sel { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--fps-testo-2); }
.fps-opzioni { min-height: 44px; }
.fps:not(.is-ready) .fps-opzioni { visibility: hidden; }
.fps-nessuno { margin: 0; color: var(--fps-testo-2); font-size: 14px; }

/* tempi di consegna */
.fps-consegna { display: grid; gap: 8px; }
.fps-consegna-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; text-align: left;
  border: 1.5px solid var(--fps-bordo); border-radius: 12px; background: var(--fps-chiaro); color: var(--fps-scuro);
  transition: border-color .2s, background .2s;
}
.fps-consegna-opt:hover:not([disabled]) { border-color: var(--fps-scuro); }
.fps-consegna-opt[disabled] { opacity: .4; cursor: default; }
.fps-check {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #bdbdbd; flex: 0 0 18px; position: relative;
  transition: background .2s, border-color .2s;
}
.fps-consegna-opt.is-on { border-color: var(--fps-scuro); background: #fafafa; }
.fps-consegna-opt.is-on .fps-check { background: var(--fps-scuro); border-color: var(--fps-scuro); }
.fps-consegna-opt.is-on .fps-check::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.fps-cons-nome { flex: 1; font-weight: 600; font-size: 14.5px; }
.fps-c-pronta .fps-cons-nome::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fps-pronta);
  margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--fps-pronta) 18%, transparent);
}
.fps-cons-n { font-size: 12px; color: var(--fps-testo-2); background: #f2f2f2; border-radius: 999px; padding: 2px 8px; }

/* colori */
.fps-colori { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 12px 6px; }
.fps-swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--fps-scuro); }
.fps-dot {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); background: #f0f0f0; color: var(--fps-testo-2);
  outline: 2px solid transparent; outline-offset: 3px; transition: outline-color .2s, transform .15s;
}
.fps-swatch:hover .fps-dot { transform: scale(1.08); }
.fps-swatch.is-on .fps-dot { outline-color: var(--fps-scuro); }
.fps-label { font-size: 11.5px; line-height: 1.2; text-align: center; color: var(--fps-testo-2); word-break: break-word; }
.fps-swatch.is-on .fps-label { color: var(--fps-scuro); font-weight: 600; }

/* taglie */
.fps-taglie { display: flex; flex-direction: column; gap: 14px; }
.fps-taglie-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fps-taglie-titolo { display: block; font-size: 12px; color: var(--fps-testo-2); margin-bottom: 7px; letter-spacing: .02em; }
.fps-chip {
  min-width: 48px; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--fps-bordo);
  background: var(--fps-chiaro); color: var(--fps-scuro); font-weight: 600; font-size: 14px; line-height: 1;
  transition: background .2s, color .2s, border-color .2s;
}
.fps-chip:hover { border-color: var(--fps-scuro); }
.fps-chip.is-on { background: var(--fps-scuro); border-color: var(--fps-scuro); color: var(--fps-chiaro); }

.fps-reset { background: none; border: 0; padding: 0; color: var(--fps-testo-2); text-decoration: underline; font-size: 14px; }
.fps-reset:hover { color: var(--fps-accento); }

/* ---------- risultati ---------- */
.fps-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.fps-conteggio { color: var(--fps-testo-2); font-size: 15px; }
.fps-conteggio strong { color: var(--fps-scuro); }
.fps-ordina { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fps-testo-2); margin: 0; }
.fps-ordina select { padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--fps-bordo); background: #fff; font: inherit; color: var(--fps-scuro); }

.fps-attivi { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; min-height: 0; }
.fps-attivo {
  padding: 6px 12px; border-radius: 999px; border: 0; background: #f2f2f2; color: var(--fps-scuro); font-size: 13px; font-weight: 600;
}
.fps-attivo:hover { background: var(--fps-scuro); color: #fff; }

/* nessuno sfarfallio: la griglia si attenua soltanto, non sparisce */
.fps-griglia { transition: opacity .2s ease; }
.fps.is-loading .fps-griglia { opacity: .45; pointer-events: none; }
.fps-griglia ul.products { margin-top: 0; }

.fps-vuoto { padding: 40px 0; text-align: center; color: var(--fps-testo-2); }
.fps-reset-link { background: none; border: 0; color: var(--fps-accento); text-decoration: underline; padding: 0; }

.fps-altri-wrap { text-align: center; margin-top: 28px; }
.fps-altri {
  padding: 14px 34px; border-radius: 999px; border: 1.5px solid var(--fps-scuro);
  background: var(--fps-chiaro); color: var(--fps-scuro); font-weight: 700;
  transition: background .2s, color .2s;
}
.fps-altri:hover { background: var(--fps-scuro); color: var(--fps-chiaro); }
.fps-altri.is-loading { opacity: .5; }

/* ---------- mobile / tablet ---------- */
@media (max-width: 900px) {
  .fps-layout { grid-template-columns: 1fr; gap: 0; }
  .fps-apri {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; margin-bottom: 14px;
    border-radius: 999px; border: 1.5px solid var(--fps-scuro); background: #fff; color: var(--fps-scuro); font-weight: 700;
  }
  .fps-badge { background: var(--fps-accento); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 7px; }
  .fps-pannello {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(88vw, 380px); z-index: 99999;
    background: #fff; padding: 0 20px 100px; overflow-y: auto;
    transform: translateX(-102%); transition: transform .3s ease; box-shadow: 0 0 40px rgba(0,0,0,.15);
  }
  .fps.is-open .fps-pannello { transform: none; }
  .fps-pannello-head {
    display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 2;
    background: #fff; padding: 18px 0; margin-bottom: 8px; border-bottom: 1px solid var(--fps-bordo); font-size: 18px;
  }
  .fps-chiudi { background: none; border: 0; font-size: 30px; line-height: 1; padding: 0 4px; color: var(--fps-scuro); }
  .fps-mostra {
    display: block; position: fixed; bottom: 16px; left: 20px; width: calc(min(88vw, 380px) - 40px);
    padding: 15px; border: 0; border-radius: 999px; background: var(--fps-scuro); color: #fff; font-weight: 700;
  }
  .fps-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99998; }
  .fps-overlay[hidden] { display: none; }
  .fps-barra { flex-wrap: wrap; }
}
html.fps-no-scroll, html.fps-no-scroll body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .fps *, .fps *::before, .fps *::after { transition: none !important; }
}

/* ---------- prezzo ---------- */
.fps-gruppo[hidden] { display: none; }
.fps-prezzo { margin: 4px 0 16px; }
.fps-hist { display: flex; align-items: flex-end; gap: 2px; height: 64px; padding: 0 9px; }
.fps-hist span { flex: 1; background: var(--fps-slider-chiaro); border-radius: 2px 2px 0 0; transition: background .15s; }
.fps-hist span.is-fuori { background: #eaeaea; }
.fps-slider { position: relative; height: 22px; }
.fps-slider-track { position: absolute; left: 9px; right: 9px; top: 9px; height: 4px; border-radius: 4px; background: #e3e3e3; }
.fps-slider-fill { position: absolute; top: 0; height: 100%; background: var(--fps-slider); border-radius: 4px; }
.fps-range {
  position: absolute; left: 0; top: 0; width: 100%; height: 22px; margin: 0; background: none;
  -webkit-appearance: none; appearance: none; pointer-events: none;
}
.fps-range:focus { outline: none; }
.fps-range::-webkit-slider-runnable-track { background: none; border: 0; }
.fps-range::-moz-range-track { background: none; border: 0; }
.fps-range::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; cursor: grab; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3.5px solid var(--fps-slider); margin-top: 0;
}
.fps-range::-moz-range-thumb {
  pointer-events: auto; cursor: grab; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 3.5px solid var(--fps-slider);
}
.fps-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--fps-slider-chiaro); }
.fps-prezzo-label { display: flex; justify-content: space-between; font-size: 14px; color: var(--fps-testo-2); margin-top: 6px; }

/* righe con spunta / radio (fasce prezzo, genere, vestibilità…) */
.fps-fasce, .fps-righe { display: flex; flex-direction: column; gap: 2px; }
.fps-riga {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 2px; border: 0; background: none;
  color: var(--fps-scuro); font-size: 15px; text-align: left; border-radius: 8px;
}
.fps-riga:hover:not([disabled]) { background: #f6f6f6; }
.fps-riga[disabled] { opacity: .4; cursor: default; }
.fps-riga-nome { flex: 1; }
.fps-riga-n { color: var(--fps-testo-2); font-size: 14px; }
.fps-radio { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #8a8a8a; flex: 0 0 22px; position: relative; }
.fps-riga.is-on .fps-radio { border-color: var(--fps-scuro); }
.fps-riga.is-on .fps-radio::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--fps-scuro); }
.fps-riga .fps-check { width: 22px; height: 22px; flex-basis: 22px; border-radius: 5px; border-color: #8a8a8a; }
.fps-riga.is-on .fps-check { background: var(--fps-scuro); border-color: var(--fps-scuro); }
.fps-riga.is-on .fps-check::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.fps-riga.is-on .fps-riga-nome { font-weight: 600; }

/* grammatura sotto il nome del prodotto */
.fps-card-gsm { display: block; font-size: 13px; color: var(--fps-testo-2); margin: 2px 0 4px; }

/* =========================================================================
   STILE LIQUID GLASS  (WooCommerce → Filtro prodotti → Stile)
   ====================================================================== */
.fps--glass {
  --g-vetro: rgba(255, 255, 255, .42);
  --g-vetro-forte: rgba(255, 255, 255, .62);
  --g-bordo: rgba(255, 255, 255, .7);
  --g-luce: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -1px 0 rgba(255, 255, 255, .25);
  --g-ombra: 0 10px 40px rgba(17, 17, 17, .08), 0 2px 8px rgba(17, 17, 17, .05);
  --g-blur: blur(22px) saturate(180%);
  position: relative;
}
.fps--glass-sfondo {
  padding: 28px;
  border-radius: 36px;
  background:
    radial-gradient(38% 46% at 8% 12%, color-mix(in srgb, var(--fps-accento) 26%, transparent), transparent 70%),
    radial-gradient(42% 50% at 92% 18%, color-mix(in srgb, var(--fps-slider) 45%, transparent), transparent 70%),
    radial-gradient(50% 50% at 70% 92%, rgba(255, 196, 120, .38), transparent 70%),
    radial-gradient(40% 40% at 20% 85%, rgba(186, 160, 255, .30), transparent 70%),
    #f5f5f7;
}
.fps--glass .fps-pannello,
.fps--glass .fps-barra,
.fps--glass .fps-griglia ul.products li.product {
  background: var(--g-vetro);
  -webkit-backdrop-filter: var(--g-blur);
  backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-bordo);
  box-shadow: var(--g-luce), var(--g-ombra);
}
.fps--glass .fps-pannello { border-radius: 28px; padding: 22px 20px; }
.fps--glass .fps-gruppo { border-bottom-color: rgba(17, 17, 17, .08); }
.fps--glass .fps-barra { border-radius: 999px; padding: 8px 10px 8px 20px; margin-bottom: 16px; }
.fps--glass .fps-griglia ul.products li.product { border-radius: 26px; padding: 12px 12px 16px; overflow: hidden; }
.fps--glass .fps-griglia ul.products li.product img { border-radius: 18px; }

/* controlli a pillola di vetro */
.fps--glass .fps-cerca,
.fps--glass .fps-chip,
.fps--glass .fps-ordina select,
.fps--glass .fps-attivo,
.fps--glass .fps-altri,
.fps--glass .fps-apri {
  background: var(--g-vetro-forte);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid var(--g-bordo);
  box-shadow: var(--g-luce), 0 1px 3px rgba(17, 17, 17, .06);
  border-radius: 999px;
}
.fps--glass .fps-chip { padding: 9px 13px; }
.fps--glass .fps-tipo { border-radius: 14px; }
.fps--glass .fps-tipo:hover,
.fps--glass .fps-riga:hover:not([disabled]) { background: rgba(255, 255, 255, .55); }

/* elementi selezionati: vetro scuro con riflesso */
.fps--glass .fps-tipo.is-on,
.fps--glass .fps-chip.is-on,
.fps--glass .fps-mostra,
.fps--glass .fps-altri:hover,
.fps--glass .fps-attivo:hover {
  background: color-mix(in srgb, var(--fps-scuro) 82%, transparent);
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 18px color-mix(in srgb, var(--fps-scuro) 25%, transparent);
}
.fps--glass .fps-riga .fps-check,
.fps--glass .fps-radio { background: rgba(255, 255, 255, .6); border-color: rgba(17, 17, 17, .28); }
.fps--glass .fps-riga.is-on .fps-check { background: var(--fps-scuro); }
.fps--glass .fps-dot { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1), inset 0 2px 3px rgba(255, 255, 255, .55), 0 2px 6px rgba(0, 0, 0, .12); }
.fps--glass .fps-slider-track { background: rgba(17, 17, 17, .1); }
.fps--glass .fps-hist span.is-fuori { background: rgba(17, 17, 17, .08); }
.fps--glass .fps-range::-webkit-slider-thumb { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }

@media (max-width: 900px) {
  .fps--glass-sfondo { padding: 16px; border-radius: 26px; }
  /* nel pannello mobile niente backdrop-filter: romperebbe il pulsante fisso "Mostra prodotti" */
  .fps--glass .fps-pannello { border-radius: 0 28px 28px 0; background: rgba(255, 255, 255, .985); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .fps--glass .fps-pannello-head { background: transparent; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .fps--glass .fps-barra { border-radius: 22px; }
}

/* browser senza effetto vetro: pannelli bianchi quasi pieni */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .fps--glass .fps-pannello,
  .fps--glass .fps-barra,
  .fps--glass .fps-griglia ul.products li.product { background: rgba(255, 255, 255, .92); }
}

/* sezioni non previste dalla squadra di filtri della categoria */
.fps .fps-fuori-squadra { display: none !important; }
.fps:not(.is-ready) .fps-sezioni { visibility: hidden; }

/* ---------- modalità widget (barra laterale dello Shop) ---------- */
.fps--widget .fps-pannello { position: static; }
.fps--widget .fps-attivi { margin-bottom: 14px; }
.fps-w-carica { opacity: .4; pointer-events: none; transition: opacity .18s ease; }
.fps-w-vuoto { padding: 40px 0; text-align: center; color: #6b6b6b; }
.fps-w-vuoto .fps-reset-link { background: none; border: 0; color: #e30613; text-decoration: underline; padding: 0; cursor: pointer; font: inherit; }
.fps-w-altri { text-align: center; margin: 28px 0; }
.fps-w-altri .fps-altri { padding: 14px 34px; border-radius: 999px; border: 1.5px solid #111; background: #fff; color: #111; font-weight: 700; cursor: pointer; font: inherit; font-weight: 700; }
.fps-w-altri .fps-altri:hover { background: #111; color: #fff; }
.fps-w-apri { display: none; }
@media (max-width: 900px) {
  .fps-w-apri-x { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; margin: 0 0 14px; border-radius: 999px; border: 1.5px solid #111; background: #fff; color: #111; font-weight: 700; cursor: pointer; font: inherit; font-weight: 700; }
  .fps-w-apri .fps-badge { background: #e30613; color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 7px; }
}

/* =========================================================================
   PROTEZIONE DAGLI STILI DEL TEMA (maiuscolo, spaziatura lettere, altezze fisse dei pulsanti…)
   ====================================================================== */
.fps button, .fps input, .fps select, .fps label, .fps h3, .fps .fps-tipo span, .fps-w-altri button, .fps-w-vuoto button {
  text-transform: none !important;
  letter-spacing: normal !important;
  font-family: inherit !important;
  box-shadow: none;
  text-shadow: none;
}
.fps button, .fps-w-altri button, .fps-w-vuoto button {
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.3 !important;
  margin: 0;
  width: auto;
  float: none;
}
.fps .fps-tipo, .fps .fps-riga, .fps .fps-consegna-opt { width: 100% !important; }
.fps .fps-gruppo h3 { text-transform: none !important; letter-spacing: -.01em !important; font-size: 16px !important; }
.fps input[type=search], .fps .fps-cerca { height: auto !important; line-height: 1.3 !important; padding: 10px 12px !important; border-radius: 10px !important; margin: 0 0 10px !important; }
.fps input[type=range] { height: 24px !important; padding: 0 !important; border: 0 !important; background: none !important; }
.fps .fps-tipo { padding: 9px 12px !important; font-size: 14.5px !important; font-weight: 500; }
.fps .fps-tipo.is-on { font-weight: 700; }
.fps .fps-riga { padding: 7px 4px !important; font-size: 14.5px !important; }
.fps .fps-chip { padding: 8px 11px !important; font-size: 13.5px !important; }
.fps .fps-label { font-size: 11.5px !important; }

/* "Mostra tutti" per le liste lunghe */
.fps .fps-piu { grid-column: 1 / -1; justify-self: start; margin-top: 8px; padding: 6px 0 !important; border: 0; background: none; color: var(--fps-scuro); font-size: 13.5px !important; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.fps .fps-piu:hover { color: var(--fps-accento); }
.fps .fps-taglie .fps-piu { align-self: flex-start; }

/* widget: la barra laterale la gestisce il tema, il pannello resta sempre visibile */
.fps--widget .fps-apri, .fps--widget .fps-mostra, .fps--widget .fps-pannello-head, .fps--widget .fps-overlay { display: none !important; }
@media (max-width: 900px) {
  .fps--widget .fps-pannello { position: static !important; transform: none !important; width: auto !important; box-shadow: none !important; padding: 0 !important; overflow: visible !important; }
}

/* la lista categorie scorre: le voci non devono restringersi */
.fps .fps-tipo { flex: 0 0 auto !important; }
.fps .fps-gruppo[hidden] { display: none !important; }
