/**
 * Conversion Funnel OS — frontend popups.
 * Theme-aware via the funnel brand variables; positioned modals + slide-ins.
 */

.cfos-pop {
	position: fixed;
	inset: 0;
	z-index: 99998;
	display: none;
	font-family: var(--cfos-font, system-ui, sans-serif);
}

.cfos-pop.is-open {
	display: block;
}

.cfos-pop__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.cfos-pop.is-open .cfos-pop__backdrop {
	opacity: 1;
}

/* Corner / bar variants have no dimming backdrop. */
.cfos-pop--bottom-right .cfos-pop__backdrop,
.cfos-pop--bottom-left .cfos-pop__backdrop,
.cfos-pop--bar .cfos-pop__backdrop {
	display: none;
}

.cfos-pop--bottom-right,
.cfos-pop--bottom-left,
.cfos-pop--bar {
	pointer-events: none;
}

.cfos-pop__box {
	position: absolute;
	background: #fff;
	color: #0f172a;
	border-radius: var(--cfos-radius, 12px);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
	width: min(440px, calc(100vw - 32px));
	padding: 26px;
	pointer-events: auto;
	transform: translateY(14px);
	opacity: 0;
	transition: transform 0.22s ease, opacity 0.22s ease;
	box-sizing: border-box;
}

.cfos-pop.is-open .cfos-pop__box {
	transform: none;
	opacity: 1;
}

/* Positions */
.cfos-pop--center .cfos-pop__box {
	top: 50%;
	left: 50%;
	transform: translate(-50%, calc(-50% + 14px));
}

.cfos-pop--center.is-open .cfos-pop__box {
	transform: translate(-50%, -50%);
}

.cfos-pop--bottom-right .cfos-pop__box {
	right: 22px;
	bottom: 22px;
}

.cfos-pop--bottom-left .cfos-pop__box {
	left: 22px;
	bottom: 22px;
}

.cfos-pop--bar .cfos-pop__box {
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 100%;
	border-radius: 0;
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
	justify-content: center;
	text-align: center;
}

/* Dark theme */
.cfos-pop--dark .cfos-pop__box {
	background: #0f172a;
	color: #e2e8f0;
}

.cfos-pop__close {
	position: absolute;
	top: 10px;
	right: 12px;
	border: 0;
	background: transparent;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	opacity: 0.6;
}

.cfos-pop__close:hover {
	opacity: 1;
}

.cfos-pop--bar .cfos-pop__close {
	position: static;
}

.cfos-pop__image {
	width: 100%;
	max-height: 160px;
	object-fit: cover;
	border-radius: var(--cfos-radius, 10px);
	margin-bottom: 14px;
	display: block;
}

.cfos-pop__heading {
	margin: 0 0 8px;
	font-size: 1.4rem;
	line-height: 1.2;
}

.cfos-pop--bar .cfos-pop__heading {
	font-size: 1.1rem;
	margin: 0;
}

.cfos-pop__body {
	margin: 0 0 16px;
	color: inherit;
	opacity: 0.85;
	font-size: 0.98rem;
}

.cfos-pop--bar .cfos-pop__body {
	margin: 0;
}

.cfos-pop__coupon {
	display: inline-block;
	border: 2px dashed var(--cfos-accent, #f59e0b);
	color: var(--cfos-accent, #f59e0b);
	font-weight: 800;
	letter-spacing: 0.08em;
	padding: 8px 16px;
	border-radius: 8px;
	margin-bottom: 16px;
	cursor: pointer;
	font-size: 1.05rem;
}

.cfos-pop__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--cfos-button, #16a34a);
	color: #fff;
	border: 0;
	padding: 13px 26px;
	border-radius: var(--cfos-radius, 10px);
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
	text-decoration: none;
	width: 100%;
	box-sizing: border-box;
}

.cfos-pop--bar .cfos-pop__cta {
	width: auto;
}

.cfos-pop__cta:hover {
	filter: brightness(0.95);
}

.cfos-pop__form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cfos-pop__form input {
	padding: 11px 13px;
	border: 1px solid #cbd5e1;
	border-radius: var(--cfos-radius, 9px);
	font-size: 0.95rem;
	width: 100%;
	box-sizing: border-box;
}

.cfos-pop--dark .cfos-pop__form input {
	background: #1e293b;
	border-color: #334155;
	color: #e2e8f0;
}

.cfos-pop__msg {
	font-size: 0.9rem;
	margin: 8px 0 0;
	font-weight: 600;
	text-align: center;
}

.cfos-pop__msg.is-success { color: #16a34a; }
.cfos-pop__msg.is-error { color: #dc2626; }

@media (max-width: 600px) {
	.cfos-pop__box { padding: 22px; }
	.cfos-pop--bottom-right .cfos-pop__box,
	.cfos-pop--bottom-left .cfos-pop__box { left: 16px; right: 16px; }
}
