/**
 * Pastille promo dynamique (BF / templates éditeur).
 */

.roe-pastille {
	--pastille-size: 72px;
	position: absolute;
	top: -22px;
	right: -12px;
	z-index: 12;
	width: var(--pastille-size);
	height: var(--pastille-size);
	pointer-events: none;
	display: block;
	overflow: visible;
	filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));
	/* Empêche iOS d’altérer l’interlettrage / corps vs desktop + éditeur */
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

.roe-pastille--pdp {
	--pastille-size: 96px;
	/* PDP : haut gauche du hero (position relative gérée dans bf-product-2026). */
	position: relative;
	top: auto;
	right: auto;
	left: auto;
	z-index: 3;
	filter: none;
}

/* PDP normale (accessoires) : un peu sous 2× — surchargée aussi dans bf-product-2026. */
body.bf-product-2026:not(.pdp-board-landing-page) .roe-pastille--pdp {
	--pastille-size: 160px;
}

/* Landing planche : pastille ancrée dans le hero (placement dans bf-pdp-board-2026). */
.roe-pastille--board-hero {
	--pastille-size: 180px;
	position: absolute;
	z-index: 4;
	filter: none;
}

.roe-pastille__bg {
	position: relative;
	z-index: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
}

.roe-pastille__eyebrow,
.roe-pastille__subline {
	position: absolute;
	z-index: 2;
	left: calc(50% + var(--nudge-x, 0%));
	transform: translateX(-50%);
	width: max-content;
	max-width: none;
	margin: 0;
	padding: 0;
	text-align: center;
	font-family: "mono45-headline", Impact, sans-serif;
	font-weight: 700;
	line-height: 0.95;
	text-transform: uppercase;
	white-space: nowrap;
	pointer-events: none;
}

.roe-pastille__eyebrow {
	top: var(--eyebrow-top, 14%);
	color: var(--eyebrow-color, #d3ff00);
	font-size: calc(var(--pastille-size, 72px) * var(--eyebrow-size, 11.5) / 100);
	letter-spacing: var(--eyebrow-tracking, 0.04em);
}

.roe-pastille__subline {
	top: var(--subline-top, 72%);
	color: var(--subline-color, #000);
	font-size: calc(var(--pastille-size, 72px) * var(--subline-size, 9) / 100);
	letter-spacing: var(--subline-tracking, 0.02em);
}

.roe-pastille__subline:empty {
	display: none;
}

.roe-pastille__price {
	position: absolute;
	z-index: 2;
	left: calc(50% + var(--nudge-x, 0%));
	top: var(--price-top, 38%);
	transform: translate(-50%, -50%) skewX(var(--price-skew, 0deg));
	transform-origin: center center;
	width: max-content;
	line-height: 0;
	overflow: visible;
	pointer-events: none;
	/* Métriques lues par bf-pastille-2026.js pour le SVG (idem éditeur). */
	color: var(--price-color, #fff);
	font-family: "mono45-headline", Impact, sans-serif;
	font-weight: 700;
	font-size: calc(var(--pastille-size, 72px) * var(--price-size, 28) / 100);
	letter-spacing: var(--price-tracking, -0.02em);
	text-transform: uppercase;
}

/* Fallback no-JS ; remplacé par SVG stroke (même formule que l’éditeur). */
.roe-pastille__price-label {
	display: block;
	margin: 0;
	padding: 0;
	font: inherit;
	letter-spacing: inherit;
	line-height: 0.95;
	text-transform: inherit;
	white-space: nowrap;
	color: inherit;
	-webkit-text-stroke: calc(var(--pastille-size, 72px) * var(--price-stroke-w, 0.55) / 100 * 2)
		var(--price-stroke, #000);
	paint-order: stroke fill;
}

.roe-pastille__price.is-stroke-svg .roe-pastille__price-label {
	display: none;
}

.roe-pastille__price-svg {
	display: block;
	overflow: visible;
	margin: 0 auto;
	pointer-events: none;
}

.roe-pastille__price-svg text {
	font-family: "mono45-headline", Impact, sans-serif;
	font-weight: 700;
}

@media (max-width: 768px) {
	.roe-pastille {
		--pastille-size: 58px;
		top: -16px;
		right: -8px;
	}

	.roe-pastille--pdp {
		--pastille-size: 72px;
		top: auto;
		right: auto;
	}

	body.bf-product-2026:not(.pdp-board-landing-page) .roe-pastille--pdp {
		--pastille-size: 120px;
	}
}

/* Ne pas zoomer la pastille avec l’image produit */
.woocommerce ul.products li.product:hover .shop-card__media-panel img.roe-pastille__bg,
.woocommerce ul.products li.product .shop-card__media-panel:hover img.roe-pastille__bg {
	transform: none !important;
}
