/* Custom Popup Builder — front-end styles */

.cpb-popup {
	position: fixed;
	inset: 0;
	display: none;
}

.cpb-popup.cpb-active {
	display: block;
}

.cpb-popup-overlay {
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.6);
}

.cpb-popup-box {
	position: fixed;
	box-sizing: border-box;
	max-width: 92vw;
	overflow-y: auto;
	padding: 32px;
	background: #fff;
}

.cpb-popup-close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	opacity: 0.6;
	padding: 4px 8px;
}

.cpb-popup-close:hover {
	opacity: 1;
}

.cpb-popup-content {
	width: 100%;
}

.cpb-popup-image {
	max-width: 100%;
	height: auto;
	display: block;
}

.cpb-popup-text {
	font-size: 16px;
	line-height: 1.6;
}

.cpb-popup-text p:first-child {
	margin-top: 0;
}

.cpb-popup-cta {
	display: inline-block;
	margin-top: 18px;
	padding: 12px 26px;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 600;
	transition: opacity 0.15s ease;
}

.cpb-popup-cta:hover {
	opacity: 0.88;
	color: inherit;
}

/* ---------- Positions ---------- */

.cpb-pos-center .cpb-popup-box {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.cpb-pos-top .cpb-popup-box {
	top: 24px;
	left: 50%;
	transform: translateX(-50%);
}

.cpb-pos-bottom .cpb-popup-box {
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
}

.cpb-pos-left .cpb-popup-box {
	top: 50%;
	left: 24px;
	transform: translateY(-50%);
}

.cpb-pos-right .cpb-popup-box {
	top: 50%;
	right: 24px;
	transform: translateY(-50%);
}

.cpb-pos-top-left .cpb-popup-box {
	top: 24px;
	left: 24px;
}

.cpb-pos-top-right .cpb-popup-box {
	top: 24px;
	right: 24px;
}

.cpb-pos-bottom-left .cpb-popup-box {
	bottom: 24px;
	left: 24px;
}

.cpb-pos-bottom-right .cpb-popup-box {
	bottom: 24px;
	right: 24px;
}

.cpb-pos-fullscreen .cpb-popup-box {
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100% !important;
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	border-radius: 0 !important;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.cpb-pos-bar-top .cpb-popup-box,
.cpb-pos-bar-bottom .cpb-popup-box {
	left: 0;
	right: 0;
	width: 100% !important;
	max-width: 100%;
	border-radius: 0 !important;
	padding: 16px 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	flex-wrap: wrap;
	gap: 12px;
}

.cpb-pos-bar-top .cpb-popup-box {
	top: 0;
}

.cpb-pos-bar-bottom .cpb-popup-box {
	bottom: 0;
}

.cpb-pos-bar-top .cpb-popup-cta,
.cpb-pos-bar-bottom .cpb-popup-cta {
	margin-top: 0;
	margin-left: 16px;
}

/* ---------- Body scroll lock ---------- */

body.cpb-scroll-locked {
	overflow: hidden !important;
}

/* ---------- Animations ---------- */

.cpb-popup.cpb-active .cpb-popup-overlay {
	animation: cpb-fade-in 0.2s ease forwards;
}

.cpb-anim-fade.cpb-active .cpb-popup-box {
	animation: cpb-fade-in var(--cpb-speed, 0.4s) ease forwards;
}

.cpb-anim-zoom.cpb-active .cpb-popup-box {
	animation: cpb-zoom-in var(--cpb-speed, 0.4s) ease forwards;
}

.cpb-anim-bounce.cpb-active .cpb-popup-box {
	animation: cpb-bounce-in var(--cpb-speed, 0.5s) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.cpb-anim-slide-down.cpb-active .cpb-popup-box {
	animation: cpb-slide-down var(--cpb-speed, 0.4s) ease forwards;
}

.cpb-anim-slide-up.cpb-active .cpb-popup-box {
	animation: cpb-slide-up var(--cpb-speed, 0.4s) ease forwards;
}

.cpb-anim-slide-left.cpb-active .cpb-popup-box {
	animation: cpb-slide-from-right var(--cpb-speed, 0.4s) ease forwards;
}

.cpb-anim-slide-right.cpb-active .cpb-popup-box {
	animation: cpb-slide-from-left var(--cpb-speed, 0.4s) ease forwards;
}

@keyframes cpb-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes cpb-zoom-in {
	from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
	to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes cpb-bounce-in {
	0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
	60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
	100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes cpb-slide-down {
	from { opacity: 0; transform: translate(-50%, -20px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}

.cpb-pos-center.cpb-anim-slide-down.cpb-active .cpb-popup-box,
.cpb-pos-center.cpb-anim-slide-up.cpb-active .cpb-popup-box,
.cpb-pos-center.cpb-anim-zoom.cpb-active .cpb-popup-box,
.cpb-pos-center.cpb-anim-bounce.cpb-active .cpb-popup-box {
	transform-origin: center;
}

@keyframes cpb-slide-up {
	from { opacity: 0; transform: translate(-50%, 20px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes cpb-slide-from-right {
	from { opacity: 0; transform: translateX(40px); }
	to   { opacity: 1; transform: translateX(0); }
}

@keyframes cpb-slide-from-left {
	from { opacity: 0; transform: translateX(-40px); }
	to   { opacity: 1; transform: translateX(0); }
}

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

@media (max-width: 600px) {
	.cpb-popup-box {
		width: 92vw !important;
		max-width: 92vw !important;
		padding: 24px;
	}

	.cpb-pos-left .cpb-popup-box,
	.cpb-pos-right .cpb-popup-box {
		left: 50%;
		right: auto;
		transform: translate(-50%, -50%);
		top: 50%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cpb-popup * {
		animation-duration: 0.01ms !important;
	}
}
