/* DZ Campaign Popup — styles front-end */

.dzcp-root {
	position: fixed;
	inset: 0;
	z-index: 999990;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
}

.dzcp-root * {
	box-sizing: border-box;
}

.dzcp-root.is-visible {
	display: flex;
}

.dzcp-overlay {
	position: absolute;
	inset: 0;
	background: var(--dzcp-overlay, rgba(0, 0, 0, .55));
	opacity: 0;
	transition: opacity .28s ease;
}

.dzcp-root.is-open .dzcp-overlay {
	opacity: 1;
}

/* ---------- Modale ---------- */

.dzcp-modal {
	position: relative;
	display: flex;
	width: 100%;
	max-width: var(--dzcp-width, 960px);
	max-height: calc(100vh - 48px);
	overflow: hidden;
	background: var(--dzcp-panel-bg, #fff);
	border-radius: var(--dzcp-radius, 16px);
	box-shadow: var(--dzcp-shadow, 0 24px 60px rgba(0, 0, 0, .18));
	color: var(--dzcp-text, #111);
	opacity: 0;
	transition: opacity .32s ease, transform .32s cubic-bezier(.22, 1, .36, 1);
}

.dzcp-layout-split-left .dzcp-modal,
.dzcp-modal.dzcp-layout-split-left {
	flex-direction: row-reverse;
}

/* Animations d'ouverture */
.dzcp-anim-fade .dzcp-modal { transform: none; }
.dzcp-anim-zoom .dzcp-modal { transform: scale(.94); }
.dzcp-anim-slide-up .dzcp-modal { transform: translateY(40px); }
.dzcp-anim-slide-down .dzcp-modal { transform: translateY(-40px); }

.dzcp-root.is-open .dzcp-modal {
	opacity: 1;
	transform: none;
}

/* ---------- Contenu ---------- */

.dzcp-content {
	flex: 1 1 52%;
	min-width: 0;
	padding: 56px 48px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow-y: auto;
}

.dzcp-layout-full .dzcp-content {
	flex: 1 1 100%;
	padding: 56px 44px;
}

.dzcp-align-center { text-align: center; align-items: center; }
.dzcp-align-left   { text-align: left;   align-items: flex-start; }
.dzcp-align-right  { text-align: right;  align-items: flex-end; }

.dzcp-icon {
	color: var(--dzcp-accent, #4f39e6);
	line-height: 0;
	margin-bottom: 22px;
}

.dzcp-badge-img {
	margin-bottom: 22px;
	line-height: 0;
}

.dzcp-badge-img img {
	max-width: 140px;
	height: auto;
	display: inline-block;
}

.dzcp-heading {
	margin: 0 0 14px;
	font-size: clamp(28px, 3.4vw, 44px);
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -.5px;
	color: var(--dzcp-text, #111);
}

.dzcp-subheading {
	margin: 0 0 8px;
	font-size: 18px;
	line-height: 1.5;
	opacity: .9;
}

.dzcp-description {
	font-size: 15px;
	line-height: 1.6;
	opacity: .78;
}

.dzcp-description p {
	margin: 0 0 8px;
}

/* ---------- Coupon ---------- */

.dzcp-coupon {
	position: relative;
	width: 100%;
	max-width: 380px;
	margin: 28px 0 16px;
	padding: 16px 24px;
	background: #e5e2fb; /* fallback navigateurs sans color-mix */
	background: color-mix(in srgb, var(--dzcp-accent, #4f39e6) 14%, #fff);
	border-radius: 6px;
	font-size: 16px;
	letter-spacing: .6px;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Encoches latérales façon ticket */
.dzcp-coupon::before,
.dzcp-coupon::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 18px;
	height: 18px;
	background: var(--dzcp-panel-bg, #fff);
	border-radius: 50%;
	transform: translateY(-50%);
}

.dzcp-coupon::before { left: -9px; }
.dzcp-coupon::after  { right: -9px; }

.dzcp-coupon-code {
	font-weight: 800;
}

.dzcp-coupon.is-copyable {
	cursor: pointer;
	transition: filter .2s ease;
}

.dzcp-coupon.is-copyable:hover {
	filter: brightness(.96);
}

.dzcp-coupon-feedback {
	display: none;
	margin-left: 10px;
	font-size: 13px;
	font-weight: 700;
	color: var(--dzcp-accent, #4f39e6);
}

.dzcp-coupon.is-copied .dzcp-coupon-feedback {
	display: inline;
}

/* ---------- Boutons ---------- */

.dzcp-btn {
	display: block;
	width: 100%;
	max-width: 380px;
	margin-top: 12px;
	padding: 17px 28px;
	border: 2px solid transparent;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .4px;
	text-align: center;
	text-decoration: none;
	transition: filter .2s ease, transform .15s ease;
}

.dzcp-btn:hover {
	text-decoration: none;
	transform: translateY(-1px);
}

.dzcp-btn-primary {
	background: var(--dzcp-btn-bg, #4f39e6);
	color: var(--dzcp-btn-text, #fff);
}

.dzcp-btn-primary:hover,
.dzcp-btn-primary:focus {
	background: var(--dzcp-btn-bg, #4f39e6);
	color: var(--dzcp-btn-text, #fff);
	filter: brightness(1.08);
}

.dzcp-btn-secondary {
	background: transparent;
	border-color: var(--dzcp-btn-bg, #4f39e6);
	color: var(--dzcp-btn-bg, #4f39e6);
}

.dzcp-btn-secondary:hover,
.dzcp-btn-secondary:focus {
	color: var(--dzcp-btn-bg, #4f39e6);
}

/* ---------- Panneau visuel ---------- */

.dzcp-side {
	flex: 1 1 48%;
	min-width: 0;
	position: relative;
	background: var(--dzcp-side-bg, #e5e2fb);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.dzcp-side img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ---------- Fermeture ---------- */

.dzcp-close {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 3;
	width: 38px;
	height: 38px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .28);
	color: #fff;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background .2s ease, transform .2s ease;
}

.dzcp-close:hover {
	background: rgba(0, 0, 0, .45);
	transform: rotate(90deg);
}

.dzcp-close:focus-visible {
	outline: 2px solid var(--dzcp-accent, #4f39e6);
	outline-offset: 2px;
}

.dzcp-layout-full .dzcp-close {
	background: rgba(0, 0, 0, .10);
	color: var(--dzcp-text, #111);
}

/* ---------- Blocage du scroll ---------- */

html.dzcp-locked,
body.dzcp-locked {
	overflow: hidden !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {

	.dzcp-root {
		padding: 14px;
	}

    .dzcp-modal,
	.dzcp-modal.dzcp-layout-split-left {
		flex-direction: column;
		max-height: calc(100vh - 28px);
		max-height: calc(100dvh - 28px);
		max-width: 460px;
	}

	.dzcp-side {
		flex: 0 0 auto;
		order: -1;
		height: auto;
		max-height: 30vh;
		max-height: 30dvh;
	}

	.dzcp-side img {
		height: auto;
		max-height: 30vh;
		max-height: 30dvh;
		object-fit: contain;
	}

	.dzcp-badge-img img {
		max-width: 90px;
	}

	.dzcp-content {
		flex: 1 1 auto;
		padding: 32px 24px 36px;
	}

	.dzcp-heading {
		font-size: 28px;
	}

	.dzcp-subheading {
		font-size: 16px;
	}

	.dzcp-coupon,
	.dzcp-btn {
		max-width: 100%;
	}

	.dzcp-btn {
		padding: 16px 20px;
	}

	.dzcp-close {
		top: 12px;
		right: 12px;
		width: 42px;
		height: 42px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.dzcp-modal,
	.dzcp-overlay,
	.dzcp-btn,
	.dzcp-close {
		transition: none !important;
		transform: none !important;
	}
}
