/**
 * CPC Modal Engine — Styles v1.0.6
 *
 * Mobile-first bottom-sheet modal.
 * Font-family 'Poppins' is loaded by Breakdance — not imported here.
 */

/* ── Custom properties ─────────────────────────────────────────────── */
.cpc-modal {
	--cpc-orange: #F4580D;
	--cpc-black: #111111;
	--cpc-white: #ffffff;
	--cpc-sheet-radius: 20px 20px 0 0;
	--cpc-btn-radius: 15px;
	--cpc-ease: cubic-bezier(0.32, 0, 0.67, 0);
	--cpc-ease-out: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ── Modal wrapper ─────────────────────────────────────────────────── */
.cpc-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;             /* toggled via JS */
	align-items: flex-end;     /* bottom-sheet on mobile */
	justify-content: center;
	pointer-events: none;
	font-family: 'Poppins', sans-serif;
}

.cpc-modal.is-open {
	pointer-events: auto;
}

/* ── Backdrop ──────────────────────────────────────────────────────── */
.cpc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: transparent;
	transition: background 300ms var(--cpc-ease-out);
}

.cpc-modal.is-open .cpc-modal__backdrop {
	background: rgba(0, 0, 0, 0.45);
}

/* ── Sheet ─────────────────────────────────────────────────────────── */
.cpc-modal__sheet {
	position: relative;
	width: 100%;
	max-height: 90vh;
	background: #f5f5f5;
	border-radius: var(--cpc-sheet-radius);
	transform: translateY(100%);
	transition: transform 380ms var(--cpc-ease-out),
	            opacity 380ms var(--cpc-ease-out);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--cpc-orange) transparent;
}

.cpc-modal.is-open .cpc-modal__sheet {
	transform: translateY(0);
}

/* ── Header / close button ─────────────────────────────────────────── */
.cpc-modal__header {
	display: flex;
	justify-content: flex-end;
	padding: 16px 16px 0;
}

.cpc-modal__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: var(--cpc-black);
	color: var(--cpc-white);
	cursor: pointer;
	transition: transform 200ms var(--cpc-ease-out);
}

.cpc-modal__close:hover {
	transform: rotate(90deg);
}

/* ── Body ──────────────────────────────────────────────────────────── */
.cpc-modal__body {
	padding: 4px 24px 28px;
	overflow-y: auto;
	max-height: calc(90vh - 60px);
}

/* ── Meta area ─────────────────────────────────────────────────────── */
.cpc-modal__meta {
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e8e8e8;
}

.cpc-modal__kicker {
	font-size: 12px;
	font-weight: 700;
	color: var(--cpc-orange);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin: 0 0 6px;
}

.cpc-modal__headline {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--cpc-black);
	line-height: 1.25;
	margin: 0 0 6px;
}

.cpc-modal__subheadline {
	font-size: 14px;
	color: #555;
	margin: 0;
}

/* ── Background image variant ────────────────────────────────── */
/*
 * background-image is driven by the CSS custom property --cpc-bg-url,
 * which is set on .cpc-modal__sheet by engine.js via style.setProperty().
 * Using !important here ensures no page-builder (Breakdance) or theme
 * stylesheet can override it with a regular declaration.
 */
.cpc-sheet--has-bg {
	background-image: var( --cpc-bg-url ) !important;
	background-size: cover;
	background-position: center top;
	background-repeat: no-repeat;
}

.cpc-sheet--has-bg::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.88);
	border-radius: inherit;
	pointer-events: none;
}

.cpc-sheet--has-bg > * {
	position: relative;
	z-index: 1;
}

/* ── Form slots ────────────────────────────────────────────────────── */
.cpc-form-slot[hidden] {
	display: none !important;
}

.cpc-form-slot .gform_wrapper {
	margin: 0 !important;
}

.cpc-form-slot .gform_title {
	display: none;
}

/* ── Submit button ─────────────────────────────────────────────────── */
.cpc-form-slot input[type="submit"],
.cpc-form-slot .gform_button {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 10px 20px;
	border: none;
	border-radius: var(--cpc-btn-radius);
	background: var(--cpc-orange);
	color: var(--cpc-white);
	font-family: 'Poppins', sans-serif;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 180ms var(--cpc-ease-out);
}

.cpc-form-slot input[type="submit"]:hover,
.cpc-form-slot .gform_button:hover {
	background: #d94d0a;
}

/* ── Escape link ───────────────────────────────────────────────────── */
.cpc-modal__escape {
	margin-top: 12px;
	text-align: center;
}

.cpc-modal__escape-or {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 600;
	color: #bbb;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.cpc-modal__escape-or::before,
.cpc-modal__escape-or::after {
	content: '';
	flex: 1;
	height: 1px;
	background: #e4e4e4;
}

.cpc-modal__escape-link {
	font-size: 12px;
	color: #888;
	text-decoration: underline;
}

.cpc-modal__escape-link:hover {
	color: #666;
}

/* ── Scroll lock ───────────────────────────────────────────────────── */
body.cpc-modal-open {
	overflow: hidden;
	padding-right: var(--cpc-scrollbar-width, 0px);
}

/* ── Desktop (≥ 768 px) ────────────────────────────────────────────── */
@media (min-width: 768px) {
	.cpc-modal {
		justify-content: center;
		align-items: center;
	}

	.cpc-modal__sheet {
		max-width: 560px;
		border-radius: 16px;
		transform: translateY(40px) scale(0.97);
		opacity: 0;
	}

	.cpc-modal.is-open .cpc-modal__sheet {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}
