/* LDF Filtres — v1.1.0
 * Feuille écrite en « mobile d'abord » : la disposition en colonne est le
 * comportement par défaut, la barre horizontale n'apparaît qu'à partir de
 * 768 px. Aucune requête de conteneur : elles ne sont pas supportées par
 * les Safari antérieurs à la version 16, encore courants sur iPhone.
 */

.ldf-filtres {
	--ldf-filtres-accent: #142a41;
	--ldf-filtres-survol: #68a3dd;
	--ldf-filtres-bord: rgba(20, 42, 65, .18);
	--ldf-filtres-doux: rgba(104, 163, 221, .12);

	/* Le thème fait flotter la barre de tri : sans clear, notre bloc
	   vient s'enrouler autour et décale toute la grille. */
	clear: both;
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0 0 2em;
	font-size: 15px;
	line-height: 1.4;
	color: var(--ldf-filtres-accent);
}

.ldf-filtres::after {
	content: "";
	display: table;
	clear: both;
}

.ldf-filtres * {
	box-sizing: border-box;
	max-width: 100%;
}

/* ---------- disposition : colonne par défaut ---------- */

.ldf-filtres__groupes {
	display: flex;
	flex-direction: column;
	gap: 1.4em;
	align-items: stretch;
	margin: 0;
	padding: 0 0 1.1em;
	border-bottom: 1px solid var(--ldf-filtres-bord);
}

.ldf-filtres__groupe {
	width: 100%;
	min-width: 0;
}

@media (min-width: 768px) {
	.ldf-filtres[data-disposition="auto"] .ldf-filtres__groupes,
	.ldf-filtres[data-disposition="barre"] .ldf-filtres__groupes {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 1.5em 2.2em;
	}

	.ldf-filtres[data-disposition="auto"] .ldf-filtres__groupe,
	.ldf-filtres[data-disposition="barre"] .ldf-filtres__groupe {
		width: auto;
		flex: 0 1 auto;
	}

	.ldf-filtres[data-disposition="auto"] .ldf-filtres__groupe--prix,
	.ldf-filtres[data-disposition="barre"] .ldf-filtres__groupe--prix {
		flex: 0 1 240px;
	}
}

/* La disposition « colonne » reste en colonne à toutes les tailles. */
.ldf-filtres[data-disposition="colonne"] .ldf-filtres__groupes {
	flex-direction: column;
	gap: 1.6em;
	border-bottom: 0;
}

/* ---------- titres ---------- */

.ldf-filtres__titre {
	display: block;
	margin: 0 0 .6em;
	font-size: 11.5px;
	letter-spacing: .14em;
	text-transform: uppercase;
	opacity: .62;
}

.ldf-filtres__aide {
	margin: .5em 0 0;
	font-size: 12px;
	opacity: .5;
}

/* ---------- pastilles ---------- */

.ldf-filtres__pastilles {
	display: flex;
	flex-wrap: wrap;
	gap: .4em;
	margin: 0;
	padding: 0;
}

.ldf-filtres__pastille {
	display: inline-flex;
	align-items: baseline;
	gap: .4em;
	padding: .5em .85em;
	border: 1px solid var(--ldf-filtres-bord);
	border-radius: 2px;
	color: inherit;
	text-decoration: none;
	line-height: 1.3;
	background: transparent;
	white-space: nowrap;
	/* Cible tactile confortable sans agrandir visuellement la pastille. */
	min-height: 40px;
	align-content: center;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.ldf-filtres__pastille:hover,
.ldf-filtres__pastille:focus-visible {
	border-color: var(--ldf-filtres-survol);
	background: var(--ldf-filtres-doux);
	color: inherit;
	text-decoration: none;
}

.ldf-filtres__pastille.est-actif {
	background: var(--ldf-filtres-accent);
	border-color: var(--ldf-filtres-accent);
	color: #fff;
}

.ldf-filtres__pastille.est-vide {
	opacity: .35;
}

.ldf-filtres__compte {
	font-size: 11px;
	opacity: .6;
}

/* ---------- tri ---------- */

.ldf-filtres__form-tri,
.ldf-filtres__form-prix {
	margin: 0;
	display: block;
	width: 100%;
}

.ldf-filtres__select {
	width: 100%;
	max-width: 100%;
	height: auto;
	padding: .6em 2em .6em .7em;
	border: 1px solid var(--ldf-filtres-bord);
	border-radius: 2px;
	background-color: transparent;
	color: inherit;
	font-size: 15px; /* < 16px déclenche un zoom automatique sur iOS */
	line-height: 1.3;
}

@media (min-width: 768px) {
	.ldf-filtres[data-disposition="auto"] .ldf-filtres__select,
	.ldf-filtres[data-disposition="barre"] .ldf-filtres__select {
		width: auto;
		min-width: 190px;
	}
}

.ldf-filtres__submit-tri {
	margin-left: .4em;
	padding: .5em .8em;
	border: 1px solid var(--ldf-filtres-bord);
	background: transparent;
	color: inherit;
	cursor: pointer;
	border-radius: 2px;
	font-size: 13px;
}

.ldf-filtres--js .ldf-filtres__submit-tri {
	display: none;
}

/* ---------- prix ---------- */

.ldf-filtres__curseur {
	position: relative;
	height: 24px;
	width: 100%;
	margin: .1em 0 .6em;
	display: none;
}

.ldf-filtres--js .ldf-filtres__curseur {
	display: block;
}

.ldf-filtres__piste {
	position: absolute;
	top: 10px;
	left: 7px;
	right: 7px;
	height: 3px;
	background: var(--ldf-filtres-bord);
	border-radius: 3px;
}

.ldf-filtres__piste-active {
	position: absolute;
	top: 0;
	bottom: 0;
	background: var(--ldf-filtres-survol);
	border-radius: 3px;
}

.ldf-filtres__range {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 24px;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.ldf-filtres__range:focus {
	outline: none;
}

.ldf-filtres__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	pointer-events: auto;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--ldf-filtres-accent);
	cursor: grab;
}

.ldf-filtres__range::-moz-range-thumb {
	pointer-events: auto;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--ldf-filtres-accent);
	cursor: grab;
}

.ldf-filtres__range::-moz-range-track {
	background: none;
	border: 0;
}

.ldf-filtres__prix-champs {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: .4em;
	width: 100%;
}

.ldf-filtres__prix-champs label {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
}

.ldf-filtres__prix-champs input {
	width: 100%;
	min-width: 0;
	padding: .5em;
	border: 1px solid var(--ldf-filtres-bord);
	border-radius: 2px;
	background: transparent;
	color: inherit;
	font-size: 15px;
}

.ldf-filtres__tiret,
.ldf-filtres__devise {
	flex: none;
	opacity: .6;
}

.ldf-filtres__bouton {
	display: inline-block;
	margin-top: .7em;
	padding: .65em 1.4em;
	border: 0;
	border-radius: 2px;
	background: var(--ldf-filtres-accent);
	color: #fff;
	font-size: 12px;
	letter-spacing: .12em;
	text-transform: uppercase;
	cursor: pointer;
	min-height: 40px;
}

.ldf-filtres__bouton:hover {
	background: var(--ldf-filtres-survol);
}

/* ---------- bascule stock ---------- */

.ldf-filtres__bascule {
	display: inline-flex;
	align-items: center;
	gap: .55em;
	min-height: 40px;
	color: inherit;
	text-decoration: none;
}

.ldf-filtres__case {
	width: 16px;
	height: 16px;
	border: 1px solid var(--ldf-filtres-bord);
	border-radius: 2px;
	position: relative;
	flex: none;
}

.ldf-filtres__bascule.est-actif .ldf-filtres__case {
	background: var(--ldf-filtres-accent);
	border-color: var(--ldf-filtres-accent);
}

.ldf-filtres__bascule.est-actif .ldf-filtres__case::after {
	content: "";
	position: absolute;
	left: 4.5px;
	top: 1px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* ---------- filtres actifs ---------- */

.ldf-filtres__actifs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5em;
	padding-top: .9em;
}

.ldf-filtres__actifs-titre {
	width: 100%;
	font-size: 11.5px;
	letter-spacing: .14em;
	text-transform: uppercase;
	opacity: .62;
}

@media (min-width: 768px) {
	.ldf-filtres__actifs-titre {
		width: auto;
		margin-right: .3em;
	}
}

.ldf-filtres__puce {
	display: inline-flex;
	align-items: center;
	gap: .45em;
	padding: .35em .7em;
	border-radius: 999px;
	background: var(--ldf-filtres-doux);
	color: inherit;
	text-decoration: none;
	font-size: 13px;
}

.ldf-filtres__puce:hover {
	background: var(--ldf-filtres-survol);
	color: #fff;
}

.ldf-filtres__puce-croix {
	font-size: 15px;
	line-height: 1;
	opacity: .65;
}

.ldf-filtres__reset {
	font-size: 13px;
	color: inherit;
	opacity: .65;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ldf-filtres__reset:hover {
	opacity: 1;
}

/* ---------- état de chargement ---------- */

.ldf-filtres.est-en-cours {
	opacity: .55;
	pointer-events: none;
}

/* ---------- panneau repliable ---------- */

.ldf-filtres__panneau {
	margin: 0;
	border: 1px solid var(--ldf-filtres-bord);
	border-radius: 2px;
}

.ldf-filtres__declencheur {
	display: flex;
	align-items: center;
	gap: .6em;
	padding: .8em 1em;
	min-height: 44px;
	cursor: pointer;
	list-style: none;
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
	user-select: none;
}

/* Retire le triangle natif (Chrome/Safari puis Firefox). */
.ldf-filtres__declencheur::-webkit-details-marker {
	display: none;
}

.ldf-filtres__declencheur::marker {
	content: "";
}

.ldf-filtres__declencheur:hover {
	background: var(--ldf-filtres-doux);
}

.ldf-filtres__declencheur:focus-visible {
	outline: 2px solid var(--ldf-filtres-survol);
	outline-offset: -2px;
}

.ldf-filtres__declencheur-icone {
	width: 16px;
	height: 16px;
	flex: none;
}

.ldf-filtres__declencheur-texte {
	flex: 1 1 auto;
}

.ldf-filtres__badge {
	flex: none;
	min-width: 20px;
	height: 20px;
	padding: 0 .4em;
	border-radius: 999px;
	background: var(--ldf-filtres-accent);
	color: #fff;
	font-size: 11px;
	letter-spacing: 0;
	line-height: 20px;
	text-align: center;
}

.ldf-filtres__chevron {
	width: 12px;
	height: 12px;
	flex: none;
	opacity: .55;
	transition: transform .18s ease;
}

.ldf-filtres__panneau[open] .ldf-filtres__chevron {
	transform: rotate(180deg);
}

.ldf-filtres__panneau .ldf-filtres__groupes {
	padding: 0 1em 1.1em;
	border-bottom: 0;
	border-top: 1px solid var(--ldf-filtres-bord);
	padding-top: 1.2em;
}

@media (prefers-reduced-motion: reduce) {
	.ldf-filtres__chevron {
		transition: none;
	}
}

/* Blocs visibles suivis du panneau replié : on sépare les deux. */
.ldf-filtres__groupes + .ldf-filtres__panneau {
	margin-top: 1.2em;
}

/* En colonne, les blocs visibles n'ont pas besoin du trait de séparation :
   le panneau replié fait déjà la coupure visuelle. */
.ldf-filtres[data-disposition="colonne"] .ldf-filtres__groupes + .ldf-filtres__panneau {
	margin-top: 1.4em;
}
