/**
 * Shortcode « Promotions » — présentation produits pleine largeur.
 * Namespace .cdax-promo (aucun impact sur la grille produit classique ni sur
 * les shortcodes .products.promo existants).
 * Mobile-first : base = mobile, @media (min-width:768px) = desktop.
 */

.cdax-promo {
	display: block;
	width: 100%;
}

/* --- Item produit -------------------------------------------------------- */
.cdax-promo__item {
	position: relative;
	display: block;
	width: 100%;
	overflow: hidden;
	background: #fff;
}

.cdax-promo__item + .cdax-promo__item {
	margin-top: 20px;
}

/* --- Média (mobile : bloc en haut) --------------------------------------- */
.cdax-promo__media {
	position: relative;
	z-index: 1;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.cdax-promo__media img,
.cdax-promo__video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.cdax-promo__video {
	pointer-events: none;
}

.cdax-promo__video::-webkit-media-controls {
	display: none !important;
}

/* YouTube : iframe recadrée « cover » via unités de conteneur. */
.cdax-promo__yt {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background-size: cover;
	background-position: center;
	container-type: size;
}

.cdax-promo__yt iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: max(100cqw, 177.7778cqh);
	height: max(56.25cqw, 100cqh);
	border: 0;
	pointer-events: none;
}

/* --- Lien étiré : toute la carte cliquable ------------------------------- */
.cdax-promo__link {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: block;
}

/* --- Cartouche (mobile : sous la photo, dans le flux) -------------------- */
.cdax-promo__cartouche {
	position: relative;
	z-index: 3;
	box-sizing: border-box;
	padding: 14px 16px;
	background-color: #fff;
	color: #1B160F;
	font-family: 'Work Sans', Arial, sans-serif;
	line-height: 1.3;
	text-align: left;
	/* Les clics traversent vers le lien étiré ; seul le bouton reste actif. */
	pointer-events: none;
}

/* Reprend la mise en forme du cartouche du widget (.cdax-encart__*). */
.cdax-promo__title {
	margin: 0 0 5px;
	font-weight: 700;
	font-size: 20px;
	color: inherit;
}

.cdax-promo__desc {
	margin: 0 0 8px;
	font-size: 13px;
	color: #686868;
}

.cdax-promo__desc p {
	margin: 0;
}

.cdax-promo__desc p + p {
	margin-top: 6px;
}

.cdax-promo__price {
	margin: 0;
	font-weight: 700;
	font-size: 28px;
	line-height: 1.05;
	color: #1B160F;
}

.cdax-promo__sub {
	margin: 2px 0 0;
	font-size: 13px;
	color: #686868;
}

.cdax-promo__price-old {
	margin-right: 4px;
	color: #e20e17;
	text-decoration: line-through;
}

.cdax-promo__ecotaxe {
	color: #1B160F;
}

/* --- Bouton « Voir en magasin » (repris de .promo-rdv) ------------------- */
.cdax-promo .cdax-promo__cartouche .cdax-promo__rdv {
	display: inline-block;
	margin-top: 14px;
	padding: 8px 12px;
	background: #012D5A;
	color: #fff;
	border: 1px solid #012D5A;
	font-weight: bold;
	text-decoration: none;
	transition: all .2s;
	pointer-events: auto; /* Réactive le clic au-dessus du lien étiré. */
}

.cdax-promo .cdax-promo__cartouche .cdax-promo__rdv:hover {
	background: #fff;
	color: #012D5A;
}

/* --- Desktop (>= 768px) : média plein cadre + cartouche superposé -------- */
@media (min-width: 768px) {

	.cdax-promo__item {
		aspect-ratio: 2.1 / 1;
	}

	.cdax-promo__media {
		position: absolute;
		inset: 0;
		aspect-ratio: auto;
		height: 100%;
	}

	/* Cartouche superposé en bas à droite. */
	.cdax-promo__cartouche {
		position: absolute;
		right: 40px;
		bottom: 40px;
		width: auto;
		max-width: min(330px, calc(100% - 80px));
		padding: 20px 26px;
		box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
	}

	.cdax-promo__title {
		margin: 0 0 10px;
		font-size: 20px;
	}

	.cdax-promo__price {
		font-size: 42px;
	}

	.cdax-promo__price-old {
		font-size: 20px;
	}
}

/* --- Accessibilité : préférence de mouvement réduit ---------------------- */
@media (prefers-reduced-motion: reduce) {
	.cdax-promo__yt iframe {
		display: none;
	}
}
