/* Alexeo Filtres Produits — sélecteurs préfixés et réinitialisations ciblées pour résister aux thèmes. */

.afp {
	--afp-accent: #66b266;
	--afp-bg: #fff;
	--afp-text: #333;
	--afp-muted: #808080;
	--afp-border: rgba(0, 0, 0, .14);
	--afp-radius: 6px;
	--afp-head-bg: var(--afp-accent);
	--afp-head-color: #fff;
	--afp-gap: 22px;
	--afp-swatch: 20px;
	--afp-btn-bg: var(--afp-accent);
	--afp-btn-color: #fff;
	position: relative;
	color: var(--afp-text);
	font-size: 15px;
	line-height: 1.4;
	text-align: left;
}
.afp *, .afp *::before, .afp *::after { box-sizing: border-box; }
.afp .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Réinitialisation des boutons (les thèmes les stylent fortement). */
.afp button.afp-group__toggle,
.afp button.afp-close,
.afp button.afp-more {
	-webkit-appearance: none; appearance: none;
	background: none !important; border: 0 !important; box-shadow: none !important;
	padding: 0 !important; margin: 0; min-height: 0; width: auto; height: auto;
	color: inherit !important; font: inherit; line-height: inherit;
	text-transform: none; letter-spacing: normal; text-decoration: none; cursor: pointer;
}

/* ---------- Panneau ---------- */
.afp-panel {
	background: var(--afp-bg);
	border-radius: var(--afp-radius);
	box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
	overflow: hidden;
}
.afp-head {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 14px 18px;
	background: var(--afp-head-bg); color: var(--afp-head-color);
}
.afp-head__title { font-weight: 700; font-size: 1.05em; }
.afp button.afp-close { display: none; place-items: center; width: 36px; height: 36px; border-radius: 50%; }
.elementor-widget-alexeo-filtres-produits:not(.afp-head-yes) .afp:not(.afp--mobile) .afp-head { display: none; }

.afp-body { padding: 20px 18px; }

/* ---------- Groupes ---------- */
.afp-group + .afp-group { margin-top: var(--afp-gap); }
.afp .afp-group__title {
	margin: 0 0 12px; padding: 0; border: 0;
	font-size: 1em; line-height: 1.3; font-weight: inherit; text-transform: none; letter-spacing: normal;
}
.afp button.afp-group__toggle {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	width: 100%; text-align: left; font-weight: 600; font-size: 1.02em;
}
.afp button.afp-group__toggle > span:first-child { overflow-wrap: anywhere; }
.afp-group__chevron {
	flex: 0 0 auto; width: 8px; height: 8px; margin-right: 3px;
	border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px); transition: transform .2s; opacity: .6;
}
.afp-group__toggle[aria-expanded="false"] .afp-group__chevron { transform: rotate(-45deg); }
.afp-group__body[hidden] { display: none !important; }
.afp .afp-group__title:has(+ .afp-group__body[hidden]) { margin-bottom: 0; }

/* ---------- Listes ---------- */
.afp ul.afp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.afp li.afp-item { margin: 0; padding: 0 0 0 calc(var(--afp-depth, 0) * 18px); list-style: none; }
.afp li.afp-item::before, .afp li.afp-item::marker { content: none; }
.afp li.afp-item--more { display: none; }
.afp-group.is-more-open li.afp-item--more { display: block; }
.afp li.afp-item.is-empty { opacity: .5; }

.afp label.afp-option {
	position: relative; display: flex; align-items: center; gap: 10px;
	margin: 0; padding: 0; cursor: pointer;
	font-weight: 400; font-size: 1em; text-transform: none; letter-spacing: normal; color: inherit;
}
.afp .afp-option input {
	position: absolute !important; top: 0; left: 0; width: 1px !important; height: 1px !important;
	margin: 0 !important; padding: 0 !important; opacity: 0 !important; pointer-events: none;
}
.afp-option__label { overflow-wrap: anywhere; }
.afp-count { color: var(--afp-muted); font-size: .9em; white-space: nowrap; }

/* Case à cocher / radio dessinée */
.afp-check {
	flex: 0 0 18px; width: 18px; height: 18px; display: inline-grid; place-items: center;
	border: 1.5px solid rgba(0, 0, 0, .3); border-radius: 4px; background: #fff;
	transition: background .15s, border-color .15s;
}
.afp-option input:checked + .afp-check { background: var(--afp-accent); border-color: var(--afp-accent); }
.afp-option input:checked + .afp-check::after {
	content: ""; width: 5px; height: 9px; margin-top: -2px;
	border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg);
}
.afp-option input[type="radio"] + .afp-check { border-radius: 50%; }
.afp-option input[type="radio"]:checked + .afp-check { background: #fff; }
.afp-option input[type="radio"]:checked + .afp-check::after {
	width: 8px; height: 8px; margin: 0; border: 0; border-radius: 50%; background: var(--afp-accent); transform: none;
}
.afp-option input:focus-visible + .afp-check,
.afp-option input:focus-visible ~ .afp-swatch { outline: 2px solid var(--afp-accent); outline-offset: 2px; }

/* Pastilles */
.afp-swatch {
	flex: 0 0 auto; width: var(--afp-swatch); height: var(--afp-swatch);
	border-radius: 3px; border: 1px solid rgba(0, 0, 0, .15);
}
.afp-swatch--none { background: repeating-linear-gradient(45deg, #f2f2f2 0 4px, #e3e3e3 4px 8px); }
.afp-option input:checked ~ .afp-swatch { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--afp-accent); }
.afp-list--swatches .afp-option input:checked ~ .afp-option__label { font-weight: 600; }

/* Boutons */
.afp ul.afp-list--buttons { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.afp-list--buttons label.afp-option {
	padding: 6px 12px; border: 1px solid var(--afp-border); border-radius: 999px; gap: 6px; background: #fff;
	transition: background .15s, color .15s, border-color .15s;
}
.afp-list--buttons label.afp-option:hover { border-color: var(--afp-accent); }
.afp-list--buttons label.afp-option:has(input:checked),
.afp-list--buttons .afp-item.is-active label.afp-option { background: var(--afp-accent); border-color: var(--afp-accent); color: #fff; }
.afp-list--buttons label.afp-option:has(input:checked) .afp-count { color: inherit; opacity: .85; }
.afp-list--buttons label.afp-option:has(input:focus-visible) { outline: 2px solid var(--afp-accent); outline-offset: 2px; }

/* Liste déroulante */
.afp select.afp-select {
	width: 100%; max-width: 100%; height: auto; padding: 9px 12px; margin: 0;
	border: 1px solid var(--afp-border); border-radius: var(--afp-radius);
	background-color: #fff; color: inherit; font: inherit;
}

/* Étoiles */
.afp-stars { color: #f5a623; letter-spacing: 1px; white-space: nowrap; }
.afp-stars__off { color: #d9d9d9; }

/* Voir plus */
.afp button.afp-more { margin-top: 10px; color: var(--afp-accent) !important; font-weight: 600; font-size: .92em; text-decoration: underline; }

/* ---------- Curseur double ---------- */
.afp-range__values { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; color: var(--afp-muted); }
.afp-range__track { position: relative; height: 26px; margin: 0 9px; }
.afp-range__track::before {
	content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px;
	border-radius: 4px; background: rgba(0, 0, 0, .15);
}
.afp-range__fill {
	position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: var(--afp-accent);
	left: var(--afp-lo, 0%); right: calc(100% - var(--afp-hi, 100%));
}
.afp input.afp-range__input {
	position: absolute; left: -9px; top: 0; width: calc(100% + 18px); height: 26px; margin: 0; padding: 0;
	-webkit-appearance: none; appearance: none; background: transparent; border: 0; box-shadow: none;
	pointer-events: none; outline: none;
}
.afp input.afp-range__input::-webkit-slider-runnable-track { background: transparent; border: 0; height: 26px; }
.afp input.afp-range__input::-moz-range-track { background: transparent; border: 0; }
.afp input.afp-range__input::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none; pointer-events: auto; cursor: pointer;
	width: 18px; height: 18px; margin-top: 4px; border-radius: 50%;
	background: #fff; border: 2px solid var(--afp-accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.afp input.afp-range__input::-moz-range-thumb {
	pointer-events: auto; cursor: pointer; width: 14px; height: 14px; border-radius: 50%;
	background: #fff; border: 2px solid var(--afp-accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.afp input.afp-range__input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--afp-accent); outline-offset: 2px; }
.afp input.afp-range__input:focus-visible::-moz-range-thumb { outline: 2px solid var(--afp-accent); outline-offset: 2px; }
.afp input.afp-range__input.is-top { z-index: 2; }

/* ---------- Filtres actifs ---------- */
.afp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--afp-gap); }
.afp a.afp-chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
	border-radius: 999px; background: rgba(0, 0, 0, .06); color: inherit;
	font-size: .88em; line-height: 1.2; text-decoration: none;
}
.afp a.afp-chip:hover { background: rgba(0, 0, 0, .12); }
.afp-chip__x { font-size: 1.15em; line-height: 1; opacity: .7; }

/* ---------- Actions ---------- */
.afp-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 0 18px 18px; }
.afp-actions:empty { display: none; }
.afp button.afp-submit, .afp button.afp-toggle {
	-webkit-appearance: none; appearance: none;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 18px; margin: 0; min-height: 0; width: auto; height: auto;
	border: 0; border-radius: var(--afp-radius); box-shadow: none;
	background: var(--afp-btn-bg); color: var(--afp-btn-color);
	font: inherit; font-weight: 600; line-height: 1.2; text-transform: none; letter-spacing: normal; cursor: pointer;
}
.afp button.afp-submit:hover, .afp button.afp-toggle:hover { filter: brightness(.94); }
.afp a.afp-reset { color: var(--afp-muted); font-size: .92em; text-decoration: underline; }
.afp--js[data-mode="auto"]:not(.afp--mobile) .afp-submit { display: none; }

/* ---------- Mobile : bouton + tiroir ---------- */
.afp button.afp-toggle { display: none; }
.afp-badge {
	display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
	border-radius: 999px; background: #fff; color: var(--afp-btn-bg); font-size: .8em; font-weight: 700;
}
.afp-backdrop { display: none; }

.afp--mobile button.afp-toggle { display: inline-flex; }
.afp--mobile .afp-panel {
	position: fixed; top: 0; bottom: 0; left: 0; z-index: 100001;
	width: min(400px, 92vw); max-width: 100%;
	display: flex; flex-direction: column;
	border-radius: 0; box-shadow: 0 0 30px rgba(0, 0, 0, .25);
}
.afp--mobile:not(.is-open) .afp-panel { display: none; }
.afp--mobile .afp-head { display: flex; }
.afp--mobile button.afp-close { display: inline-grid; }
.afp--mobile .afp-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.afp--mobile .afp-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.afp--mobile .afp-actions { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--afp-border); background: var(--afp-bg); }
.afp--mobile .afp-submit { flex: 1; }
.afp--mobile.is-open .afp-backdrop { display: block; position: fixed; inset: 0; z-index: 100000; background: rgba(0, 0, 0, .45); }
html.afp-lock, html.afp-lock body { overflow: hidden; }

/* ---------- Chargement ---------- */
.afp-zone-loading { opacity: .45; pointer-events: none; transition: opacity .2s; }
.afp.afp-is-loading .afp-body { opacity: .7; }
@media (prefers-reduced-motion: reduce) {
	.afp *, .afp-zone-loading { transition: none !important; }
}

.afp-empty-config { padding: 12px; border: 1px dashed #c3c4c7; color: #50575e; }
