#can-popup-root {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 999999;
}

.can-popup {
	position: fixed;
	pointer-events: auto;
	background: var(--can-bg, #fff);
	color: var(--can-text, #1e1e1e);
	border: 1px solid var(--can-border, #e2e2e2);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.can-popup[hidden] {
	display: none !important;
}

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

.can-popup-close:hover,
.can-popup-close:focus {
	opacity: 1;
}

.can-popup-badge {
	display: inline-block;
	background: var(--can-btn, #2271b1);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 20px;
	margin-bottom: 8px;
}

.can-popup-title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
}

.can-popup-desc {
	font-size: 14px;
	line-height: 1.4;
	margin-bottom: 12px;
	opacity: 0.9;
}

.can-popup-button {
	display: inline-block;
	background: var(--can-btn, #2271b1);
	color: #fff !important;
	text-decoration: none;
	padding: 10px 18px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 14px;
}

.can-popup-icon {
	width: 36px;
	height: 36px;
	object-fit: cover;
	border-radius: 50%;
	margin-bottom: 8px;
}

/* Animations — duration is set per-campaign via the "Animation Speed" field. */
:root { --can-anim-duration: 0.35s; }

.can-anim-fade { animation: can-fade var(--can-anim-duration) ease both; }
.can-anim-slide-up { animation: can-slide-up var(--can-anim-duration) ease both; }
.can-anim-slide-down { animation: can-slide-down var(--can-anim-duration) ease both; }
.can-anim-zoom { animation: can-zoom var(--can-anim-duration) ease both; }
.can-anim-bounce { animation: can-bounce calc(var(--can-anim-duration) * 1.4) ease both; }
.can-anim-scale { animation: can-scale var(--can-anim-duration) ease both; }
.can-anim-flip { animation: can-flip calc(var(--can-anim-duration) * 1.2) ease both; }
.can-anim-rotate { animation: can-rotate var(--can-anim-duration) ease both; }
.can-anim-pulse { animation: can-scale var(--can-anim-duration) ease both, can-pulse 1.6s ease-in-out 1; }
.can-anim-floating { animation: can-fade var(--can-anim-duration) ease both, can-floating 3s ease-in-out infinite; }
.can-anim-elastic { animation: can-elastic calc(var(--can-anim-duration) * 1.8) cubic-bezier(0.68, -0.55, 0.27, 1.55) both; }

@keyframes can-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes can-slide-up { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes can-slide-down { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes can-zoom { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
@keyframes can-scale { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes can-bounce {
	0% { opacity: 0; transform: translateY(20px); }
	60% { opacity: 1; transform: translateY(-6px); }
	100% { transform: translateY(0); }
}
@keyframes can-flip {
	from { opacity: 0; transform: perspective(600px) rotateX(-90deg); }
	to { opacity: 1; transform: perspective(600px) rotateX(0deg); }
}
@keyframes can-rotate {
	from { opacity: 0; transform: rotate(-8deg) scale(0.9); }
	to { opacity: 1; transform: rotate(0) scale(1); }
}
@keyframes can-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(34, 113, 177, 0.35); }
	50% { box-shadow: 0 0 0 10px rgba(34, 113, 177, 0); }
}
@keyframes can-floating {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-6px); }
}
@keyframes can-elastic {
	0% { opacity: 0; transform: scale(0.3); }
	50% { transform: scale(1.05); }
	75% { transform: scale(0.95); }
	100% { opacity: 1; transform: scale(1); }
}

/* Style templates */
.can-style-glassmorphism {
	background: rgba(255, 255, 255, 0.55) !important;
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

.can-style-dark-mode {
	background: #1f1f1f !important;
	color: #f5f5f5 !important;
	border-color: #333 !important;
}

.can-style-light-mode {
	background: #ffffff !important;
	color: #1e1e1e !important;
	border-color: #eaeaea !important;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.can-style-minimal {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	border-radius: 4px;
}

.can-style-modern-card {
	border-radius: 16px;
}

.can-style-rounded-card {
	border-radius: 28px;
}

.can-style-gradient {
	background: linear-gradient(135deg, var(--can-bg, #fff), var(--can-border, #eee)) !important;
}

.can-style-material-design {
	border-radius: 4px;
	border: none;
	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

.can-style-ai-style {
	border-radius: 18px;
	background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(59, 130, 246, 0.1)), var(--can-bg, #fff) !important;
	border: 1px solid rgba(124, 58, 237, 0.25) !important;
}

.can-style-ecommerce-style {
	border-radius: 10px;
	border-width: 2px !important;
	border-style: solid !important;
}

/* Snooze / Don't show again controls */
.can-popup-controls {
	display: flex;
	gap: 12px;
	margin-top: 10px;
}

.can-popup-snooze,
.can-popup-never {
	background: transparent;
	border: none;
	padding: 0;
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
	color: inherit;
	opacity: 0.75;
}

.can-popup-snooze:hover,
.can-popup-never:hover {
	opacity: 1;
}

/* Positions (desktop/tablet defaults; mobile overrides in popup-mobile.css) */
.can-pos-bottom-left { left: 20px; bottom: 20px; }
.can-pos-bottom-right { right: 20px; bottom: 20px; }
.can-pos-top-left { left: 20px; top: 20px; }
.can-pos-top-right { right: 20px; top: 20px; }
.can-pos-center { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.can-pos-sticky-bottom { left: 0; right: 0; bottom: 0; border-radius: 0; }
.can-pos-sticky-top { left: 0; right: 0; top: 0; border-radius: 0; }

/* Ad type: GIF/Image — full-bleed, no title/description */
.can-ad-gif {
	padding: 0;
}

.can-popup-gif-image {
	display: block;
	width: 100%;
	max-height: 320px;
	object-fit: cover;
	border-radius: inherit;
}

.can-ad-gif .can-popup-button {
	display: block;
	margin: 10px;
	text-align: center;
}

/* Ad type: raw HTML — admin's own markup, no extra chrome imposed */
.can-ad-html {
	padding: 0;
}

/* Ad type: Video — fixed 9:16 vertical frame */
.can-ad-video {
	padding: 0;
}

.can-popup-video-el {
	display: block;
	width: 100%;
	aspect-ratio: 9 / 16;
	max-height: 420px;
	object-fit: cover;
	background: #000;
	border-radius: inherit;
}

.can-ad-video .can-popup-button {
	display: block;
	margin: 10px;
	text-align: center;
}

/* Full-bleed ad types (GIF, HTML, Video) don't use the standard popup padding —
   their content controls its own spacing. Close/snooze controls get their own
   floating treatment instead since they can no longer rely on parent padding. */
.can-adtype-gif,
.can-adtype-html,
.can-adtype-video {
	padding: 0 !important;
	overflow: hidden;
}

.can-adtype-gif .can-popup-close,
.can-adtype-html .can-popup-close,
.can-adtype-video .can-popup-close {
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	border-radius: 50%;
	width: 28px;
	height: 28px;
	line-height: 26px;
	text-align: center;
	top: 8px;
	right: 8px;
	opacity: 0.9;
}

.can-adtype-gif .can-popup-controls,
.can-adtype-html .can-popup-controls,
.can-adtype-video .can-popup-controls {
	position: absolute;
	bottom: 6px;
	left: 10px;
	z-index: 2;
	background: rgba(0, 0, 0, 0.45);
	padding: 3px 8px;
	border-radius: 20px;
}

.can-adtype-gif .can-popup-snooze,
.can-adtype-gif .can-popup-never,
.can-adtype-html .can-popup-snooze,
.can-adtype-html .can-popup-never,
.can-adtype-video .can-popup-snooze,
.can-adtype-video .can-popup-never {
	color: #fff;
}

/* Consent banner + push opt-in prompt — simple bottom bars, separate from
   the ad popups themselves (not affected by campaign style/position settings). */
#can-consent-banner,
#can-push-optin {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1000000;
	background: #1f1f1f;
	color: #f5f5f5;
	padding: 14px 20px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

#can-consent-banner p,
#can-push-optin p {
	margin: 0;
	flex: 1;
	min-width: 200px;
}

.can-consent-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.can-consent-actions button {
	border: none;
	border-radius: 6px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

#can-consent-accept,
#can-push-yes {
	background: #2271b1;
	color: #fff;
}

#can-consent-decline,
#can-push-no {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
}

@media (max-width: 600px) {
	#can-consent-banner,
	#can-push-optin {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}
	.can-consent-actions {
		justify-content: center;
	}
}

.can-manual-trigger {
	cursor: pointer;
}
