/* PEAS Home Promos — carrousel « Promotions en cours ».
 * PC (>= 922px) : 1 ligne de 4. Tablette (768–921px) : 1 ligne de 3.
 * Smartphone (<= 767px) : 2 lignes de 2. Défilement horizontal natif
 * (glissement au doigt, scroll-snap), piloté par les flèches et l'autoplay. */

.peas-hp {
	--peas-hp-gap: 20px;
	--peas-hp-cols: 4;
	--peas-hp-rows: 1;
	--peas-hp-accent: #046bd2;
	margin: 0 0 40px;
}

.peas-hp[hidden] {
	display: none !important;
}

.peas-hp__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 20px;
}

.peas-hp__title {
	margin: 0;
	/* Même taille que le titre de la grille (h1 Astra : 36px, 27.36px <= 921px). */
	font-size: 36px;
	font-weight: 400;
	line-height: 1.2;
	color: #1e293b;
}

.peas-hp__nav {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.peas-hp__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid #d1d5db;
	border-radius: 50%;
	background: #fff;
	color: #1e293b;
	cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s, opacity .15s;
}

.peas-hp__arrow:hover,
.peas-hp__arrow:focus-visible {
	background: var(--peas-hp-accent);
	border-color: var(--peas-hp-accent);
	color: #fff;
	outline: none;
}

.peas-hp__arrow:disabled {
	opacity: .35;
	cursor: default;
	background: #fff;
	border-color: #d1d5db;
	color: #1e293b;
}

.peas-hp--static .peas-hp__nav {
	display: none;
}

.peas-hp__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	outline: none;
}

.peas-hp__viewport::-webkit-scrollbar {
	display: none;
}

/* Neutralise la grille imposée par le thème à ul.products. */
.woocommerce .peas-hp ul.products.peas-hp__track,
.peas-hp ul.products.peas-hp__track {
	display: grid !important;
	grid-auto-flow: column;
	grid-template-rows: repeat(var(--peas-hp-rows), auto);
	grid-template-columns: none !important;
	grid-auto-columns: calc((100% - (var(--peas-hp-cols) - 1) * var(--peas-hp-gap)) / var(--peas-hp-cols));
	column-gap: var(--peas-hp-gap);
	row-gap: 24px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
}

.peas-hp ul.products.peas-hp__track::before,
.peas-hp ul.products.peas-hp__track::after {
	display: none !important;
}

.woocommerce .peas-hp ul.products.peas-hp__track li.product,
.peas-hp ul.products.peas-hp__track li.product {
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	float: none !important;
	clear: none !important;
	scroll-snap-align: start;
}

@media (max-width: 921px) {
	.peas-hp {
		--peas-hp-cols: 3;
	}

	.peas-hp__title {
		font-size: 27.36px;
	}
}

@media (max-width: 767px) {
	.peas-hp {
		--peas-hp-cols: 2;
		--peas-hp-rows: 2;
		--peas-hp-gap: 14px;
		margin-bottom: 32px;
	}

	.peas-hp__arrow {
		width: 34px;
		height: 34px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.peas-hp__viewport {
		scroll-behavior: auto;
	}
}
