/* ==========================================================================
   Notre Héritage — carrousels de produits et effet d'apparition
   ========================================================================== */

.nh-carrousel {
	--nh-ecart: 8px;
	position: relative;
	width: 100%;
	margin: 0;
	text-align: left;
}

/* Dans Elementor, le widget prend toute la largeur de son conteneur (même centré). */
.elementor-widget-nh-carrousel-produits:not(.elementor-widget__width-initial):not(.elementor-widget__width-auto) {
	width: 100%;
	max-width: 100%;
	align-self: stretch;
}

/* ---------- En-tête : titre à gauche, « Tout voir » et flèches à droite ---------- */

.nh-carrousel__entete {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	margin: 0 0 24px;
}

.nh-carrousel__titres {
	min-width: 0;
}

.nh-carrousel__surtitre {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 10px;
	font: 600 12px/1.4 var(--nh-sans, "Montserrat", sans-serif);
	letter-spacing: 2.4px;
	text-transform: uppercase;
	color: var(--nh-rouge, #C4232C);
}

.nh-carrousel__surtitre::before {
	content: "";
	flex: 0 0 auto;
	width: 28px;
	height: 2px;
	background: var(--nh-rouge, #C4232C);
}

body.nh-site .nh-carrousel .nh-carrousel__titre {
	margin: 0;
	font-family: var(--nh-titre, "EB Garamond", Georgia, serif);
	font-size: clamp(30px, 3.2vw, 42px);
	font-weight: 500;
	line-height: 1.05;
	color: var(--nh-bleu, #0F213C);
}

.nh-carrousel__actions {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-shrink: 0;
	padding-bottom: 4px;
}

body.nh-site .nh-carrousel .nh-carrousel__lien {
	font: 600 12px/1.4 var(--nh-sans, "Montserrat", sans-serif);
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--nh-bleu, #0F213C);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 6px;
	white-space: nowrap;
	transition: color .2s ease;
}

body.nh-site .nh-carrousel .nh-carrousel__lien:hover,
body.nh-site .nh-carrousel .nh-carrousel__lien:focus-visible {
	color: var(--nh-bouton, #B5121B);
}

.nh-carrousel__fleches {
	display: flex;
	gap: 8px;
}

.nh-carrousel__fleches[hidden] {
	display: none;
}

.nh-carrousel .nh-carrousel__fleche,
body.nh-site .nh-carrousel .nh-carrousel__fleche {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid rgba(15, 33, 60, .25);
	border-radius: 50%;
	background: #fff;
	color: var(--nh-bleu, #0F213C);
	cursor: pointer;
	box-shadow: none;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}

.nh-carrousel .nh-carrousel__fleche svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

body.nh-site .nh-carrousel .nh-carrousel__fleche:hover:not(:disabled),
body.nh-site .nh-carrousel .nh-carrousel__fleche:focus-visible {
	background: var(--nh-bleu, #0F213C);
	border-color: var(--nh-bleu, #0F213C);
	color: #fff;
}

.nh-carrousel .nh-carrousel__fleche:focus-visible {
	outline: 2px solid var(--nh-rouge, #C4232C);
	outline-offset: 2px;
}

.nh-carrousel .nh-carrousel__fleche:disabled {
	opacity: .3;
	cursor: default;
}

/* Écrans tactiles : on fait glisser du doigt, pas de flèches. */
@media (hover: none), (pointer: coarse) {
	.nh-carrousel__fleches {
		display: none !important;
	}
}

/* ---------- Piste : les cartes de la boutique, en ligne ---------- */

.nh-carrousel .nh-carrousel__piste .woocommerce {
	width: auto;
	margin: 0;
}

.nh-carrousel .nh-carrousel__piste ul.products {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: var(--nh-ecart) !important;
	grid-template-columns: none !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.nh-carrousel .nh-carrousel__piste ul.products::-webkit-scrollbar {
	display: none;
}

.nh-carrousel .nh-carrousel__piste ul.products::before,
.nh-carrousel .nh-carrousel__piste ul.products::after {
	content: none !important;
	display: none !important;
}

.nh-carrousel .nh-carrousel__piste ul.products li.product {
	flex: 0 0 calc((100% - (var(--nh-cartes, 4) - 1) * var(--nh-ecart)) / var(--nh-cartes, 4)) !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0;
	margin: 0 !important;
	float: none !important;
	clear: none !important;
	scroll-snap-align: start;
}

/* Glisser à la souris : pas d'aimantation pendant le geste. */
.nh-carrousel.est-glisse .nh-carrousel__piste ul.products {
	scroll-snap-type: none;
	scroll-behavior: auto;
	cursor: grabbing;
	user-select: none;
}

.nh-carrousel.est-glisse .nh-carrousel__piste ul.products a {
	pointer-events: none;
}

/* Tablette : deux cartes et demie. */
@media (max-width: 1024px) {
	.nh-carrousel .nh-carrousel__piste ul.products li.product {
		flex-basis: calc((100% - 2 * var(--nh-ecart)) / 2.4) !important;
	}
}

/* Mobile : une carte et demie, pour montrer qu'on peut faire glisser. */
@media (max-width: 767px) {
	.nh-carrousel {
		--nh-ecart: 6px;
	}

	/* Le titre prend toute la largeur ; « Tout voir » passe sous le carrousel. */
	.nh-carrousel {
		display: flex;
		flex-direction: column;
	}

	.nh-carrousel__entete {
		display: contents;
	}

	.nh-carrousel__titres {
		order: 1;
		margin-bottom: 16px;
	}

	.nh-carrousel__piste {
		order: 2;
	}

	.nh-carrousel__jauge {
		order: 3;
		margin-top: 18px;
	}

	.nh-carrousel__actions {
		order: 4;
		margin-top: 18px;
		padding-bottom: 0;
	}

	.nh-carrousel .nh-carrousel__piste ul.products li.product {
		flex-basis: 60% !important;
	}
}

/* ---------- Jauge de défilement ---------- */

.nh-carrousel__jauge {
	position: relative;
	height: 2px;
	margin-top: 22px;
	overflow: hidden;
	background: var(--nh-trait, rgba(15, 33, 60, .12));
}

.nh-carrousel__jauge[hidden] {
	display: none;
}

.nh-carrousel__jauge span {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 25%;
	background: var(--nh-bouton, #B5121B);
	transition: transform .12s linear;
}

/* Message dans l'éditeur Elementor seulement. */
.nh-carrousel-notice {
	padding: 18px 20px;
	border: 1px dashed rgba(15, 33, 60, .3);
	font-size: 14px;
	color: var(--nh-bleu, #0F213C);
	background: #fafafa;
}

/* ==========================================================================
   Effet d'apparition : montée en fondu au défilement
   (classe nh-anim posée par le script : sans script, rien n'est masqué ;
   ce qui est à l'écran au chargement reste affiché tel quel)
   ========================================================================== */

.nh-anim body:not(.elementor-editor-active) :is(ul.products > li.product, .nh-apparition):not(.nh-fin) {
	transition:
		opacity .8s cubic-bezier(.22, .61, .36, 1) var(--nh-delai, 0ms),
		transform .8s cubic-bezier(.22, .61, .36, 1) var(--nh-delai, 0ms);
}

.nh-anim body:not(.elementor-editor-active) :is(ul.products > li.product, .nh-apparition):not(.est-visible) {
	opacity: 0;
	transform: translate3d(0, 28px, 0);
}

@media (prefers-reduced-motion: reduce) {
	.nh-carrousel .nh-carrousel__piste ul.products {
		scroll-behavior: auto;
	}

	.nh-anim body :is(ul.products > li.product, .nh-apparition) {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}
