/* ==========================================================================
   BOUTIQUE : catalogue, filtres, tri, cartes produits.
   Mobile d'abord. Variables du contrat uniquement.
   ========================================================================== */

.bdp-boutique {
	padding-block: var(--esp-6, 2rem) var(--esp-9, 5rem);
}

.bdp-boutique__entete {
	margin-bottom: var(--esp-6, 2rem);
}

.bdp-boutique__titre {
	margin: 0 0 var(--esp-3, 0.75rem);
	font-size: var(--fs-3xl, 2.5rem);
}

.bdp-boutique__intro {
	max-width: 60ch;
	color: var(--c-texte-doux, #555);
}

.bdp-boutique__intro > :last-child {
	margin-bottom: 0;
}

/* ---------- Mise en page : résultats ---------- */
.bdp-boutique__corps {
	display: grid;
	gap: var(--esp-5, 1.5rem);
}

/* ---------- Barre d'outils : compteur, tri, bouton filtres ---------- */
.bdp-boutique__outils {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--esp-3, 0.75rem) var(--esp-5, 1.5rem);
	margin-bottom: var(--esp-5, 1.5rem);
}

.bdp-boutique__compteur {
	flex: 1 1 auto;
	margin: 0;
	color: var(--c-texte-doux, #555);
	font-size: var(--fs-sm, 0.9rem);
}

.bdp-tri {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--esp-2, 0.5rem);
	width: 100%;
}

@media (min-width: 640px) {
	.bdp-tri {
		width: auto;
	}
}

.bdp-tri__label {
	font-size: var(--fs-sm, 0.9rem);
	font-weight: 600;
	white-space: nowrap;
}

.bdp-tri__select {
	flex: 1 1 11rem;
	min-width: 0;
	width: auto;
	min-height: 2.75rem;
}

/* Tri dans la barre de filtres : sur la ligne des attributs, tout à droite. */
.bdp-fbarre__tri {
	margin-top: var(--esp-3, 0.75rem);
}

@media (min-width: 960px) {
	.bdp-fbarre__tri {
		flex: 0 0 auto;
		margin-top: 0;
		margin-left: auto;
	}

	.bdp-fbarre__tri .bdp-tri__select {
		flex: 0 0 auto;
		min-width: 14rem;
	}
}

/* ---------- Filtres actifs (puces) ---------- */
.bdp-filtres-actifs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--esp-3, 0.75rem);
	margin-bottom: var(--esp-5, 1.5rem);
}

.bdp-filtres-actifs__liste {
	display: flex;
	flex-wrap: wrap;
	gap: var(--esp-2, 0.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.bdp-puce {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	min-height: 2.25rem;
	padding: 0.25em 0.9em;
	border: var(--filet, 1px) solid var(--c-ligne, #ddd);
	border-radius: var(--r-pill, 999px);
	background: var(--c-surface, #fff);
	font-size: var(--fs-sm, 0.9rem);
	font-weight: 600;
	text-decoration: none;
	transition: border-color var(--duree-s, 0.2s) var(--ease, ease);
}

.bdp-puce:hover {
	border-color: var(--c-texte, #111);
}

.bdp-puce__croix {
	width: 0.9rem;
	height: 0.9rem;
}

.bdp-filtres-actifs__tout {
	font-size: var(--fs-sm, 0.9rem);
	font-weight: 600;
}

/* Les colonnes sont gérées par la grille commune ; seul le conteneur s'adapte au contenu. */
.bdp-boutique .bdp-grille-produits {
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 960px) and (max-width: 1239px) {
	.bdp-boutique .bdp-grille-produits {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.bdp-boutique .bdp-pagination {
	margin-top: var(--esp-8, 4rem);
}

.bdp-boutique .bdp-pagination .page-numbers {
	list-style: none;
}

/* ==========================================================================
   BARRE DE FILTRES HORIZONTALE (design 1) : mécanique seulement ; l'habillage est dans design/shop.css.
   Sans JavaScript, les panneaux restent affichés à la suite ; avec JavaScript (.is-js), menus déroulants.
   ========================================================================== */
.bdp-boutique__corps--barre {
	grid-template-columns: minmax(0, 1fr);
}

.bdp-fbarre {
	margin-bottom: var(--esp-5, 1.5rem);
}

.bdp-fbarre__mobile {
	display: flex;
	align-items: center;
	gap: var(--esp-2, 0.5rem);
	width: 100%;
	min-height: 2.75rem;
	padding: 0.4em 1em;
	border: var(--filet, 1px) solid var(--c-ligne, #ddd);
	background: var(--c-surface, #fff);
	color: var(--c-texte, #111);
	font-weight: 700;
	cursor: pointer;
}

.bdp-fbarre__mobile .bdp-icone {
	width: 1.25rem;
	height: 1.25rem;
}

.bdp-fbarre__liste {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bdp-fbarre__formulaire {
	margin-top: var(--esp-3, 0.75rem);
}

.bdp-fmenu {
	position: relative;
	border-bottom: var(--filet, 1px) solid var(--c-ligne, #ddd);
}

.bdp-fmenu__bouton {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6em;
	width: 100%;
	min-height: 2.75rem;
	padding: 0.4em 0;
	border: 0;
	background: transparent;
	color: var(--c-texte, #111);
	font-weight: 700;
	text-align: left;
	cursor: pointer;
}

.bdp-fmenu__libelle {
	flex: 1;
}

.bdp-fmenu__chevron {
	flex: none;
	width: 0.85rem;
	height: 0.85rem;
	transition: transform var(--duree-s, 0.2s) var(--ease, ease);
}

.bdp-fmenu__bouton[aria-expanded="true"] .bdp-fmenu__chevron {
	transform: rotate(180deg);
}

.bdp-fmenu__nombre,
.bdp-fbarre__compte {
	display: inline-grid;
	place-items: center;
	min-width: 1.4rem;
	height: 1.4rem;
	padding-inline: 0.3rem;
	background: var(--c-primaire, #123);
	color: var(--c-primaire-texte, #fff);
	font-size: var(--fs-xs, 0.75rem);
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.bdp-fmenu__panneau {
	min-width: 0;
	margin: 0;
	padding: 0 0 var(--esp-3, 0.75rem);
	border: 0;
}

.bdp-fmenu__legende {
	padding: 0;
	font-weight: 700;
}

.bdp-fbarre.is-js .bdp-fmenu__legende {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.bdp-fmenu__options {
	display: grid;
	gap: 0;
	max-height: 18rem;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
}

.bdp-fmenu__options .bdp-case {
	align-items: center;
	min-height: 2.75rem;
}

.bdp-fbarre__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--esp-3, 0.75rem);
	margin-top: var(--esp-4, 1rem);
}

.bdp-fbarre__effacer {
	font-weight: 600;
}

/* Mobile avec JavaScript : le formulaire est masqué tant que le bouton « Filtres » ne l'ouvre pas. */
@media (max-width: 959px) {
	html.js .bdp-fbarre:not(.is-js) .bdp-fbarre__formulaire {
		display: none;
	}

	.bdp-fbarre.is-js .bdp-fbarre__effacer {
		display: none;
	}
}

/* Barre réduite sur mobile : la liste (marques ou catégories) est visible directement, dans un bouton cadré. */
@media (max-width: 959px) {
	.bdp-fbarre--reduite .bdp-fmenu__bouton {
		width: 100%;
		min-height: 2.75rem;
		border: var(--filet, 1px) solid var(--c-ligne, #ddd);
		font-weight: 700;
	}
}

@media (min-width: 960px) {
	.bdp-fbarre__formulaire {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: var(--esp-3, 0.75rem);
		margin-top: 0;
	}

	.bdp-fbarre__liste {
		flex: 1 1 auto;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: var(--esp-1, 0.25rem) var(--esp-1, 0.3rem);
	}

	.bdp-fmenu{
		border-bottom: 0;
	}

	.bdp-fmenu__bouton {
		width: auto;
		padding: 0.4em 0.55em;
		border: var(--filet, 1px) solid var(--c-ligne, #ddd);
		background: var(--c-surface, #fff);
	}

	.bdp-fbarre__actions {
		margin-top: 0;
	}

	/* Avec JavaScript : l'envoi est automatique, le bouton et le lien d'effacement sont superflus. */
	.bdp-fbarre.is-js .bdp-fbarre__appliquer,
	.bdp-fbarre.is-js .bdp-fbarre__effacer {
		display: none;
	}

	/* Sans JavaScript : panneaux affichés à la suite, en ligne. */
	.bdp-fbarre:not(.is-js) .bdp-fmenu {
		flex: 1 1 14rem;
	}

	.bdp-fbarre.is-js .bdp-fmenu__panneau {
		position: absolute;
		top: calc(100% + 0.25rem);
		left: 0;
		z-index: 30;
		width: max-content;
		min-width: 15rem;
		max-width: 22rem;
		padding: var(--esp-3, 0.75rem) var(--esp-4, 1rem);
		border: var(--filet, 1px) solid var(--c-primaire, #123);
		background: var(--c-bg, #fff);
		box-shadow: var(--ombre-m, 0 8px 24px rgb(0 0 0 / 0.15));
	}

	.bdp-fbarre.is-js .bdp-fmenu.is-droite .bdp-fmenu__panneau {
		right: 0;
		left: auto;
	}

	.bdp-fbarre.is-js .bdp-fmenu__panneau:not([hidden]) {
		animation: bdp-fmenu-ouvre var(--duree-s, 0.2s) var(--ease, ease);
	}
}

@keyframes bdp-fmenu-ouvre {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bdp-fbarre.is-js .bdp-fmenu__panneau:not([hidden]) {
		animation: none;
	}
}

/* ==========================================================================
   FILTRE DE PRIX À CURSEUR (design 1) : mécanique seulement ; couleur = --c-erreur (rouge de la palette).
   < 768 px : deux champs seulement. ≥ 768 px : ligne + deux poignées entre les champs.
   Sans JavaScript : champs + « Appliquer », la ligne n'est qu'un repère des bornes.
   ========================================================================== */
.bdp-prixcurseur {
	--poignee: 1.5rem;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--esp-3, 0.75rem);
	margin-bottom: var(--esp-3, 0.75rem);
}

.bdp-prixcurseur__champ .bdp-champ__label {
	display: block;
	margin-bottom: var(--esp-1, 0.25rem);
}

.bdp-prixcurseur__aide {
	grid-column: 1 / -1;
	margin: 0;
}

.bdp-prixcurseur__piste {
	display: none;
}

@media (min-width: 768px) {
	.bdp-prixcurseur {
		grid-template-columns: minmax(5.5rem, 8rem) minmax(0, 1fr) minmax(5.5rem, 8rem);
		align-items: end;
		gap: var(--esp-5, 1.5rem);
		margin-bottom: var(--esp-4, 1rem);
	}

	.bdp-prixcurseur__aide {
		display: none;
	}

	.bdp-prixcurseur:not(.is-js) .bdp-prixcurseur__aide {
		display: block;
	}

	.bdp-prixcurseur__piste {
		position: relative;
		display: block;
		height: 4.5rem;
	}

	.bdp-prixcurseur__champ .bdp-champ__input {
		min-height: 2.5rem;
		padding: 0.3em 0.6em;
		font-size: var(--fs-sm, 0.9rem);
	}

	.bdp-prixcurseur__valeurs {
		position: absolute;
		top: 0;
		right: 0;
		left: 0;
		margin: 0;
		color: var(--c-texte, #111);
		font-size: var(--fs-sm, 0.9rem);
		font-variant-numeric: tabular-nums;
		font-weight: 700;
		text-align: center;
	}

	.bdp-prixcurseur__ligne {
		position: absolute;
		right: calc(var(--poignee) / 2);
		bottom: calc(1.375rem - 2px);
		left: calc(var(--poignee) / 2);
		height: 4px;
		border-radius: 2px;
		background: color-mix(in srgb, var(--c-erreur, #b00020) 22%, var(--c-ligne, #ddd));
	}

	/* Plage choisie : même épaisseur que la ligne, saturée. */
	.bdp-prixcurseur__plage {
		position: absolute;
		top: 0;
		right: calc(100% - var(--fin, 100%));
		bottom: 0;
		left: var(--debut, 0%);
		border-radius: 2px;
		background: var(--c-erreur, #b00020);
	}

	.bdp-prixcurseur:not(.is-js) .bdp-prixcurseur__poignee {
		display: none;
	}

	.bdp-prixcurseur__poignee {
		position: absolute;
		bottom: 0;
		left: 0;
		z-index: 1;
		width: 100%;
		height: 2.75rem;
		margin: 0;
		background: transparent;
		pointer-events: none;
		touch-action: pan-y;
		-webkit-appearance: none;
		appearance: none;
	}

	.bdp-prixcurseur__poignee--min.est-dessus {
		z-index: 2;
	}

	.bdp-prixcurseur__poignee::-webkit-slider-runnable-track {
		height: 2.75rem;
		background: transparent;
	}

	.bdp-prixcurseur__poignee::-moz-range-track {
		height: 2.75rem;
		background: transparent;
	}

	.bdp-prixcurseur__poignee::-webkit-slider-thumb {
		width: var(--poignee);
		height: var(--poignee);
		margin-top: calc((2.75rem - var(--poignee)) / 2);
		border: 2px solid var(--c-bg, #fff);
		border-radius: 50%;
		background: var(--c-erreur, #b00020);
		box-shadow: 0 0 0 1px var(--c-erreur, #b00020), var(--ombre-s, 0 2px 6px rgb(0 0 0 / 0.25));
		cursor: grab;
		pointer-events: auto;
		-webkit-appearance: none;
		appearance: none;
	}

	.bdp-prixcurseur__poignee::-moz-range-thumb {
		box-sizing: border-box;
		width: var(--poignee);
		height: var(--poignee);
		border: 2px solid var(--c-bg, #fff);
		border-radius: 50%;
		background: var(--c-erreur, #b00020);
		box-shadow: 0 0 0 1px var(--c-erreur, #b00020), var(--ombre-s, 0 2px 6px rgb(0 0 0 / 0.25));
		cursor: grab;
		pointer-events: auto;
	}

	.bdp-prixcurseur__poignee:active::-webkit-slider-thumb {
		cursor: grabbing;
	}

	.bdp-prixcurseur__poignee:focus-visible {
		outline: none;
	}

	.bdp-prixcurseur__poignee:focus-visible::-webkit-slider-thumb {
		outline: 3px solid var(--c-focus, #1a73e8);
		outline-offset: 2px;
	}

	.bdp-prixcurseur__poignee:focus-visible::-moz-range-thumb {
		outline: 3px solid var(--c-focus, #1a73e8);
		outline-offset: 2px;
	}
}

/* Écrans tactiles ≥ 768 px : champs bien visibles (poignées de 1.5rem, zone de prise de 2.75rem). */
@media (min-width: 768px) and (pointer: coarse) {
	.bdp-prixcurseur__champ .bdp-champ__input {
		min-height: 2.75rem;
		font-size: var(--fs-base, 1rem);
	}
}

.bdp-fbarre__formulaire > .bdp-prixcurseur {
	flex: 0 0 100%;
}
