/* Badges promo – Mimosa
 * Les valeurs (couleurs, taille, marges…) viennent de WooCommerce > Badges promo.
 */
:root {
	--mimosa-dpd-promo: #E30613;
	--mimosa-dpd-bulk: #009486;
	--mimosa-dpd-special: #022E5F;
	--mimosa-dpd-text: #FFFFFF;
	--mimosa-dpd-font-size: 13px;
	--mimosa-dpd-weight: 700;
	--mimosa-dpd-transform: uppercase;
	--mimosa-dpd-padding: 10px;
	--mimosa-dpd-margin: 0;
	--mimosa-dpd-radius: 0;
}

.mimosa-dpd-badge {
	display: inline-block;
	max-width: 100%;
	margin: var(--mimosa-dpd-margin);
	padding: var(--mimosa-dpd-padding);
	border-radius: var(--mimosa-dpd-radius);
	font-family: inherit;
	font-size: var(--mimosa-dpd-font-size);
	font-weight: var(--mimosa-dpd-weight);
	line-height: 1.2;
	text-transform: var(--mimosa-dpd-transform);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	vertical-align: middle;
	color: var(--mimosa-dpd-text);
	background: var(--mimosa-dpd-promo);
}

.mimosa-dpd-badge--bulk { background: var(--mimosa-dpd-bulk); }
.mimosa-dpd-badge--special { background: var(--mimosa-dpd-special); }

/* ---------------------------------------------------------------------
 * Position absolue (coin haut gauche / haut droit)
 * ------------------------------------------------------------------ */

.mimosa-dpd-badge--abs {
	position: absolute;
	top: 0;
	z-index: 9;
	pointer-events: none;
}

.mimosa-dpd-badge--abs.mimosa-dpd-badge--top-left { left: 0; }
.mimosa-dpd-badge--abs.mimosa-dpd-badge--top-right { right: 0; }

/* Widget Shortcode Elementor contenant un badge absolu : il sort du flux
 * (aucun espace laissé dans la carte) et le badge se cale dans le coin
 * du conteneur parent. */
.elementor-widget-shortcode:has(.mimosa-dpd-badge--abs),
.elementor-widget-shortcode:has(.mimosa-dpd-slot) {
	position: absolute !important;
	inset: 0 auto auto 0;
	width: 100% !important;
	height: 0;
	margin: 0 !important;
	padding: 0 !important;
	z-index: 9;
	pointer-events: none;
}

.elementor-widget-shortcode:has(.mimosa-dpd-badge--abs) > .elementor-widget-container,
.elementor-widget-shortcode:has(.mimosa-dpd-slot) > .elementor-widget-container,
.elementor-widget-shortcode:has(.mimosa-dpd-badge--abs) .elementor-shortcode {
	margin: 0;
	padding: 0;
}

/* Repère vide (produit sans promo). */
.mimosa-dpd-slot {
	display: none;
}

/* Affichage automatique : badge posé sur l'image. */
.mimosa-dpd-wrap,
.woocommerce ul.products li.product:has(> .mimosa-dpd-badge--auto),
.woocommerce div.product:has(> .mimosa-dpd-badge--auto) {
	position: relative;
}

.mimosa-dpd-badge--auto {
	max-width: calc(100% - 20px);
}
