.cpm-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.cpm-popup-box {
	position: relative;
	background: #fff;
	max-width: 560px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	border-radius: 8px;
	padding: 32px 24px 24px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
	box-sizing: border-box;
	/* Corrige le bug d'affichage "texte invisible" : certains thèmes (notamment les thèmes
	   sombres) définissent une couleur de texte globale claire (ex: body { color: #fff }).
	   Comme le pop-up a toujours un fond blanc, ce texte hérité devient invisible.
	   On force donc une couleur de texte lisible et on isole le pop-up du mode sombre du thème. */
	color: #1e1e1e;
	color-scheme: light;
}

.cpm-popup-content,
.cpm-popup-content :where(h1, h2, h3, h4, h5, h6, p, span, li, strong, b, em, a, label, td, th, div) {
	color: inherit;
}

.cpm-popup-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 36px;
	height: 36px;
	border: none;
	background: rgba(0, 0, 0, 0.06);
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.cpm-popup-close:hover {
	background: rgba(0, 0, 0, 0.12);
}

.cpm-popup-content {
	margin-bottom: 16px;
}

.cpm-popup-content img {
	max-width: 100%;
	height: auto;
}

/* CTA */
.cpm-cta-wrapper {
	text-align: center;
	margin-top: 16px;
}

.cpm-cta-button {
	display: inline-block;
	padding: 12px 28px;
	font-weight: 600;
	text-decoration: none;
	font-size: 15px;
	transition: opacity 0.2s ease, transform 0.15s ease;
}

.cpm-cta-button:hover {
	opacity: 0.9;
	transform: translateY(-1px);
}

/* Countdown */
.cpm-countdown {
	text-align: center;
	margin: 16px 0;
}

.cpm-countdown-label {
	font-size: 14px;
	margin: 0 0 8px;
	font-weight: 600;
}

.cpm-countdown-timer {
	display: flex;
	justify-content: center;
	gap: 10px;
}

.cpm-countdown-unit {
	background: #f3f3f3;
	border-radius: 6px;
	padding: 8px 10px;
	min-width: 48px;
	text-align: center;
}

.cpm-countdown-unit span {
	display: block;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
}

.cpm-countdown-unit small {
	font-size: 11px;
	color: #666;
	text-transform: uppercase;
}

/* Produit WooCommerce */
.cpm-wc-product {
	display: flex;
	gap: 16px;
	align-items: center;
	margin: 16px 0;
	padding: 16px;
	border: 1px solid #eee;
	border-radius: 8px;
	text-align: left;
}

.cpm-wc-product-image img {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}

.cpm-wc-product-info {
	flex: 1;
	min-width: 0;
}

.cpm-wc-product-title {
	font-weight: 600;
	margin: 0 0 4px;
}

.cpm-wc-product-price {
	margin: 0 0 10px;
	color: #2271b1;
	font-weight: 600;
}

.cpm-wc-product-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.cpm-wc-qty-input {
	width: 56px;
	padding: 8px 6px;
	border: 1px solid #ccc;
	border-radius: 6px;
	text-align: center;
}

.cpm-wc-add-to-cart.button {
	padding: 8px 18px;
	border-radius: 6px;
	background: #2271b1;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	border: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
}

.cpm-wc-add-to-cart.loading {
	opacity: 0.6;
	pointer-events: none;
}

.cpm-wc-added-message {
	color: #2e7d32;
	font-size: 13px;
	font-weight: 600;
	margin: 8px 0 0;
}

@media (max-width: 480px) {
	.cpm-wc-product {
		flex-direction: column;
		text-align: center;
	}

	.cpm-wc-product-actions {
		justify-content: center;
	}
}

/* Mobile */
@media (max-width: 600px) {
	.cpm-popup-box {
		padding: 28px 16px 20px;
		max-height: 85vh;
	}

	.cpm-countdown-unit {
		min-width: 40px;
		padding: 6px 8px;
	}

	.cpm-countdown-unit span {
		font-size: 16px;
	}

	.cpm-popup-close {
		width: 40px;
		height: 40px;
		font-size: 24px;
	}
}
