/* WRX Filtri Shop — barra e pannello. I colori arrivano dalle variabili stampate dal plugin. */

.wrx-fs, .wrx-fs-pannello {
	--wrx-fs-grigio: #f2f2f3;
	--wrx-fs-muto: #6b6b72;
}
.wrx-fs {
	clear: both;
	width: 100%;
	margin: 0 0 24px;
	color: var(--wrx-fs-testo, #111);
	font-size: 15px;
	line-height: 1.4;
}
.wrx-fs *, .wrx-fs-pannello * { box-sizing: border-box; }
:where(.wrx-fs, .wrx-fs-pannello) button { font: inherit; letter-spacing: normal; text-transform: none; box-shadow: none; }

/* Testo solo per i lettori di schermo, anche se il tema non definisce la classe. */
.wrx-fs .screen-reader-text, .wrx-fs-pannello .screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Barra ------------------------------------------------------------------ */
.wrx-fs-barra {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 5px;
	background: var(--wrx-fs-sfondo, #fff);
	border: 1px solid var(--wrx-fs-bordo, #e4e4e7);
	border-radius: calc(var(--wrx-fs-raggio, 12px) - 4px);
	min-height: 50px;
}
.wrx-fs-apri {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 9px 16px;
	border: 0;
	border-radius: calc(var(--wrx-fs-raggio, 12px) - 6px);
	background: var(--wrx-fs-grigio);
	color: inherit;
	font-weight: 600;
	cursor: pointer;
	line-height: 1.2;
	transition: background-color .15s ease;
}
.wrx-fs-apri:hover { background: #e7e7ea; color: inherit; }
.wrx-fs-apri:focus-visible, .wrx-fs-pannello :focus-visible, .wrx-fs-vista button:focus-visible { outline: 2px solid var(--wrx-fs-accento); outline-offset: 2px; }
.wrx-fs-conteggio { color: var(--wrx-fs-testo); font-size: 14px; white-space: nowrap; }
.wrx-fs-destra { margin-left: auto; display: flex; align-items: center; gap: 20px; }

.wrx-fs-ordina { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; white-space: nowrap; }
.wrx-fs-ordina-et { color: var(--wrx-fs-testo); }
.wrx-fs-ordina select {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 6px 28px 6px 2px;
	min-width: 0;
	height: auto;
	border: 0;
	border-radius: 0;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 4px center;
	box-shadow: none;
	color: var(--wrx-fs-testo);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.wrx-fs-vista { display: inline-flex; gap: 6px; }
.wrx-fs-vista button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: calc(var(--wrx-fs-raggio, 12px) - 6px);
	background: var(--wrx-fs-grigio);
	color: var(--wrx-fs-muto);
	cursor: pointer;
}
.wrx-fs-vista button.is-attiva { color: var(--wrx-fs-accento); background: var(--wrx-fs-grigio); }
.wrx-fs-vista button:hover { color: var(--wrx-fs-accento); background: #e7e7ea; }

/* Etichette dei filtri attivi -------------------------------------------- */
.wrx-fs-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.wrx-fs-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 8px 6px 10px;
	border-radius: 6px;
	background: var(--wrx-fs-grigio);
	color: var(--wrx-fs-testo) !important;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none !important;
	line-height: 1.2;
}
.wrx-fs-chip:hover { background: #e7e7ea; }
.wrx-fs-cancella { color: var(--wrx-fs-testo) !important; font-size: 13px; font-weight: 500; text-decoration: underline !important; text-underline-offset: 3px; }

/* Il conteggio e l'ordinamento del tema li sostituisce la barra. */
.wrx-fs-attivo .woocommerce-result-count,
.wrx-fs-attivo .woocommerce-ordering,
.wrx-fs-attivo .wc-block-catalog-sorting { display: none !important; }

/* Pannello ---------------------------------------------------------------- */
.wrx-fs-pannello[hidden] { display: none !important; }
.wrx-fs-pannello {
	position: fixed;
	inset: 0;
	z-index: 999999;
	color: var(--wrx-fs-testo, #111);
	font-size: 15px;
	line-height: 1.4;
}
.wrx-fs-velo {
	position: absolute;
	inset: 0;
	background: rgba(20, 20, 24, .45);
	opacity: 0;
	transition: opacity .25s ease;
}
.wrx-fs-cassetto {
	position: absolute;
	top: 10px;
	bottom: 10px;
	right: 10px;
	display: flex;
	flex-direction: column;
	width: min(420px, calc(100vw - 20px));
	margin: 0;
	background: #fff;
	border-radius: calc(var(--wrx-fs-raggio, 12px) + 8px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
	overflow: hidden;
	overflow: clip; /* hidden si lascia scorrere da focus() e scrollIntoView: il cassetto slitterebbe */
	transform: translateX(calc(100% + 20px));
	transition: transform .32s cubic-bezier(.32, .72, 0, 1);
}
.wrx-fs-pannello[data-lato="sinistra"] .wrx-fs-cassetto { right: auto; left: 10px; transform: translateX(calc(-100% - 20px)); }
.wrx-fs-pannello.is-aperto .wrx-fs-velo { opacity: 1; }
.wrx-fs-pannello.is-aperto .wrx-fs-cassetto { transform: none; }
@media (prefers-reduced-motion: reduce) {
	.wrx-fs-velo, .wrx-fs-cassetto { transition: none; }
}
html.wrx-fs-bloccato, html.wrx-fs-bloccato body { overflow: hidden !important; }

.wrx-fs-testa { display: flex; align-items: center; justify-content: space-between; padding: 22px 22px 12px 30px; }
.wrx-fs-testa h2 { margin: 0; padding: 0; font-size: 22px; font-weight: 600; line-height: 1.2; color: inherit; letter-spacing: normal; text-transform: none; }
.wrx-fs-chiudi {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #ececee;
	color: #333;
	cursor: pointer;
}
.wrx-fs-chiudi:hover { background: #e0e0e3; color: #000; }

.wrx-fs-corpo { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 30px 24px; }
.wrx-fs-corpo > .wrx-fs-chips { margin: 4px 0 18px; }

.wrx-fs-interruttore { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font-weight: 600; cursor: pointer; }
.wrx-fs-interruttore input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wrx-fs-levetta { position: relative; flex: none; width: 44px; height: 26px; border-radius: 13px; background: #cfcfd4; transition: background-color .2s ease; }
.wrx-fs-levetta::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.wrx-fs-interruttore input:checked + .wrx-fs-levetta { background: var(--wrx-fs-accento); }
.wrx-fs-interruttore input:checked + .wrx-fs-levetta::after { transform: translateX(18px); }
.wrx-fs-interruttore input:focus-visible + .wrx-fs-levetta { outline: 2px solid var(--wrx-fs-accento); outline-offset: 2px; }

/* Sezioni a fisarmonica */
.wrx-fs-sez { margin: 0 0 8px; border: 1px solid var(--wrx-fs-bordo, #e4e4e7); border-radius: calc(var(--wrx-fs-raggio, 12px) - 2px); background: #fff; }
.wrx-fs-sez-testa {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin: 0;
	padding: 16px 16px;
	border: 0;
	border-radius: inherit;
	background: transparent;
	color: inherit;
	font-weight: 600;
	font-size: 15px;
	text-align: left;
	cursor: pointer;
}
.wrx-fs-sez-testa:hover { background: #f6f6f7; color: inherit; }
.wrx-fs-sez-testa svg { flex: none; color: #888; transition: transform .2s ease; }
.wrx-fs-sez.is-aperta > .wrx-fs-sez-testa svg { transform: rotate(180deg); }
.wrx-fs-sez-corpo { display: none; padding: 0 16px 16px; }
.wrx-fs-sez.is-aperta > .wrx-fs-sez-corpo { display: block; }
.wrx-fs-sez-info { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 12px; font-size: 12px; color: var(--wrx-fs-muto); }
.wrx-fs-reimposta { margin: 0; padding: 0; border: 0; background: none; color: var(--wrx-fs-muto); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wrx-fs-reimposta:hover { color: var(--wrx-fs-testo); background: none; }

.wrx-fs-lista-voci, .wrx-fs-figli { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.wrx-fs-voce { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.wrx-fs-voce::before, .wrx-fs-voce::marker { content: none !important; }
.wrx-fs-riga { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wrx-fs-riga label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; margin: 0; padding: 5px 0; font-size: 15px; font-weight: 400; cursor: pointer; }
.wrx-fs-riga input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.wrx-fs-box { flex: none; position: relative; width: 19px; height: 19px; border: 1px solid #cfcfd4; border-radius: 4px; background: #fff; transition: background-color .12s ease, border-color .12s ease; }
.wrx-fs-riga input:checked + .wrx-fs-box { background: var(--wrx-fs-accento); border-color: var(--wrx-fs-accento); }
.wrx-fs-riga input:checked + .wrx-fs-box::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.wrx-fs-riga input:focus-visible + .wrx-fs-box { outline: 2px solid var(--wrx-fs-accento); outline-offset: 2px; }
.wrx-fs-riga label:hover .wrx-fs-box { border-color: #9a9aa2; }
.wrx-fs-nome { overflow-wrap: anywhere; }
.wrx-fs-num { color: inherit; }
.wrx-fs-voce.is-vuota > .wrx-fs-riga label { opacity: .4; cursor: default; }

/* Albero delle categorie: le sottocategorie compaiono sotto la principale */
.wrx-fs-espandi { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #888; cursor: pointer; }
.wrx-fs-espandi:hover { background: #f1f1f2; color: #333; }
.wrx-fs-espandi svg { transition: transform .2s ease; }
.wrx-fs-voce.is-aperta > .wrx-fs-riga .wrx-fs-espandi svg { transform: rotate(180deg); }
.wrx-fs-figli { display: none; margin: 2px 0 6px 10px !important; padding-left: 18px !important; border-left: 1px solid var(--wrx-fs-bordo, #e4e4e7); }
.wrx-fs-voce.is-aperta > .wrx-fs-figli { display: block; }
.wrx-fs-figli .wrx-fs-riga label { font-size: 14px; }

/* Prezzo */
.wrx-fs-prezzo { padding-top: 2px; }
.wrx-fs-cursore { position: relative; height: 26px; margin: 0 8px 14px; }
.wrx-fs-traccia { position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: #dcdce0; }
.wrx-fs-riempi { position: absolute; top: 0; bottom: 0; background: var(--wrx-fs-accento); border-radius: 2px; }
.wrx-fs-cursore input[type="range"] {
	position: absolute;
	left: -8px;
	right: -8px;
	top: 0;
	width: calc(100% + 16px);
	height: 26px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}
.wrx-fs-cursore input[type="range"]::-webkit-slider-runnable-track { background: none; border: 0; height: 26px; }
.wrx-fs-cursore input[type="range"]::-moz-range-track { background: none; border: 0; }
.wrx-fs-cursore input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; margin-top: 4px; border: 0; border-radius: 50%; background: var(--wrx-fs-accento); cursor: grab; box-shadow: 0 0 0 3px #fff, 0 1px 4px rgba(0,0,0,.25); }
.wrx-fs-cursore input[type="range"]::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--wrx-fs-accento); cursor: grab; box-shadow: 0 0 0 3px #fff, 0 1px 4px rgba(0,0,0,.25); }
.wrx-fs-cursore input[type="range"]:focus-visible { outline: none; }
.wrx-fs-cursore input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--wrx-fs-accento); }
.wrx-fs-campi-prezzo { display: flex; align-items: center; gap: 12px; }
.wrx-fs-campi-prezzo label { flex: 1; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 12px; height: 44px; border: 1px solid var(--wrx-fs-bordo, #e4e4e7); border-radius: 6px; color: var(--wrx-fs-muto); background: #fff; }
.wrx-fs-campi-prezzo input { flex: 1; min-width: 0; width: 100%; height: 40px; margin: 0; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: 0; color: var(--wrx-fs-testo); font: inherit; -moz-appearance: textfield; }
.wrx-fs-campi-prezzo input::-webkit-outer-spin-button, .wrx-fs-campi-prezzo input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wrx-fs-campi-prezzo label:focus-within { border-color: var(--wrx-fs-accento); }
.wrx-fs-trattino { color: var(--wrx-fs-muto); }

.wrx-fs-piede { padding: 14px 30px 22px; border-top: 1px solid #f0f0f2; background: #fff; }
.wrx-fs-applica {
	display: block;
	width: 100%;
	margin: 0;
	padding: 13px 20px;
	border: 0;
	border-radius: calc(var(--wrx-fs-raggio, 12px) - 4px);
	background: var(--wrx-fs-accento) !important;
	color: #fff !important;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: filter .15s ease;
}
.wrx-fs-applica:hover { filter: brightness(1.12); }

/* Vista a elenco ------------------------------------------------------------ */
.wrx-fs-lista ul.products,
.wrx-fs-lista .wc-block-product-template { display: flex !important; flex-direction: column; gap: 20px; grid-template-columns: none !important; }
.wrx-fs-lista ul.products::before, .wrx-fs-lista ul.products::after { content: none !important; }
.wrx-fs-lista ul.products li.product,
.wrx-fs-lista .wc-block-product-template > li {
	display: grid !important;
	grid-template-columns: 180px 1fr;
	grid-auto-rows: min-content;
	column-gap: 24px;
	align-items: start;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	float: none !important;
	text-align: left !important;
}
.wrx-fs-lista ul.products li.product > *,
.wrx-fs-lista .wc-block-product-template > li > * { grid-column: 2; }
.wrx-fs-lista ul.products li.product > a:first-child,
.wrx-fs-lista .wc-block-product-template > li > :first-child { grid-column: 1; grid-row: 1 / span 6; }
.wrx-fs-lista ul.products li.product > a:first-child { display: contents; }
.wrx-fs-lista ul.products li.product > a:first-child img { grid-column: 1; grid-row: 1 / span 6; width: 100%; margin: 0 !important; }
.wrx-fs-lista ul.products li.product > a:first-child > :not(img) { grid-column: 2; }
.wrx-fs-lista ul.products li.product > .button,
.wrx-fs-lista .wc-block-product-template > li .wp-block-button { justify-self: start; width: auto !important; }

/* Mobile ------------------------------------------------------------------ */
@media (max-width: 640px) {
	.wrx-fs-barra { gap: 10px; flex-wrap: wrap; }
	.wrx-fs-ordina-et, .wrx-fs-vista { display: none; }
	.wrx-fs-destra { gap: 8px; }
	.wrx-fs-cassetto { top: 0; bottom: 0; right: 0; width: 100vw; border-radius: 0; }
	.wrx-fs-pannello[data-lato="sinistra"] .wrx-fs-cassetto { left: 0; }
	.wrx-fs-testa { padding: 16px 16px 10px 20px; }
	.wrx-fs-corpo { padding: 4px 20px 20px; }
	.wrx-fs-piede { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); }
	.wrx-fs-lista ul.products li.product, .wrx-fs-lista .wc-block-product-template > li { grid-template-columns: 110px 1fr; column-gap: 14px; }
}
@media (max-width: 400px) {
	.wrx-fs-conteggio { display: none; }
}
