/**
 * Widget Elementor : Encarts Produits.
 * Mobile-first : le code par défaut cible le mobile, les @media (min-width)
 * gèrent le desktop. Breakpoint desktop/mobile : 768px.
 */

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

/* --- Encart : conteneur plein largeur ------------------------------------ */
.cdax-encart {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: var(--ratio-m, 1 / 1);
	overflow: hidden;
	color: inherit;
	text-decoration: none;
}

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

/* --- Média de fond -------------------------------------------------------- */
.cdax-encart__media {
	position: absolute;
	inset: 0;
	z-index: 1;
}

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

/* Vidéo décorative : pas d'interaction (évite commandes / Picture-in-Picture). */
.cdax-encart__video {
	pointer-events: none;
}

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

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

.cdax-encart__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;
}

/* --- Voile sombre optionnel ---------------------------------------------- */
.cdax-encart__overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	background: #000;
	opacity: var(--overlay-o, 0);
	pointer-events: none;
}

/* --- Couches de positionnement (titre & cartouche) ----------------------- */
.cdax-encart__layer {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	padding: 20px;
	pointer-events: none;
}

.cdax-encart__layer > * {
	pointer-events: auto;
}

/* Positions — mobile par défaut (variables fournies en inline). */
.cdax-encart__layer--title {
	justify-content: var(--title-jc-m, center);
	align-items: var(--title-ai-m, flex-start);
}

.cdax-encart__layer--cartouche {
	justify-content: var(--cart-jc-m, flex-end);
	align-items: var(--cart-ai-m, flex-end);
}

/* --- Titre (image PNG/webP) ---------------------------------------------- */
.cdax-encart__title {
	display: block;
	width: var(--title-w-m, 80%);
	max-width: 100%;
	height: auto;
}

/* --- Cartouche ----------------------------------------------------------- */
.cdax-encart__cartouche {
	box-sizing: border-box;
	max-width: min(330px, 100%);
	padding: 10px;
	background-color: #fff;
	color: #1B160F;
	font-family: 'Work Sans', Arial, sans-serif;
	line-height: 1.3;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.cdax-encart__product {
	margin: 0 0 .3px;
	font-size: 15px;
}

.cdax-encart__product-name {
	font-weight: 700;
}

.cdax-encart__product-detail {
	font-weight: 400;
}

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

.cdax-encart__price {
	margin: 0;
	font-weight: 700;
	font-size: 28px;
	line-height: 1.05;
}

.cdax-encart__saving {
	margin: 4px 0 0;
	font-weight: 700;
	font-size: 14px;
	color: #e20e17;
}

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

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

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

/* --- Desktop (>= 768px) -------------------------------------------------- */
@media (min-width: 768px) {

	.cdax-encart {
		aspect-ratio: var(--ratio-d, 2.1 / 1);
	}

	.cdax-encart__layer {
		padding: 40px;
	}

	.cdax-encart__layer--title {
		justify-content: var(--title-jc-d, flex-end);
		align-items: var(--title-ai-d, flex-start);
	}

	.cdax-encart__layer--cartouche {
		justify-content: var(--cart-jc-d, flex-end);
		align-items: var(--cart-ai-d, flex-end);
	}

	.cdax-encart__title {
		width: var(--title-w-d, 40%);
	}

	.cdax-encart__cartouche {
		padding: 20px 26px;
	}

	.cdax-encart__product {
		margin: 0 0 6px;
		font-size: 16px;
	}

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

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

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