/* ============================================================
   LAKASG Campaign Popup — Frontend + Admin  v2.23.4
   ============================================================ */

/* ── Admin layout picker ───────────────────────────────────── */
.lakasg-cp-layout-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin: 4px 0;
}
.lakasg-cp-layout-card {
	border: 2px solid #c3c4c7;
	border-radius: 8px;
	padding: 16px 12px;
	text-align: center;
	cursor: pointer;
	transition: border-color 150ms, background 150ms;
	background: #fff;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}
.lakasg-cp-layout-card:hover   { border-color: #2271b1; background: #f0f6ff; }
.lakasg-cp-layout-card.is-selected { border-color: #2271b1; background: #e8f0fe; }
.lakasg-cp-layout-icon  { font-size: 22px; }
.lakasg-cp-layout-label { font-size: 12px; font-weight: 600; color: #333; }
.lakasg-cp-table td, .lakasg-cp-table th { padding: 10px 12px !important; }

/* ── Overlay ───────────────────────────────────────────────── */
.lakasg-cp-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--lakasg-cp-anim-dur, 320ms) ease;
	overscroll-behavior: contain;
}
.lakasg-cp-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

/* ── Dialog ────────────────────────────────────────────────── */
.lakasg-cp-dialog {
	position: relative;
	box-sizing: border-box;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);
	/* All sizing (width, height, overflow) set inline by JS per campaign */
}

/* ── Position variants ─────────────────────────────────────── */
.lakasg-cp-pos-center        { align-items: center;     justify-content: center;     }
.lakasg-cp-pos-bottom-left   { align-items: flex-end;   justify-content: flex-start; padding: 24px; background: transparent !important; }
.lakasg-cp-pos-bottom-right  { align-items: flex-end;   justify-content: flex-end;   padding: 24px; background: transparent !important; }
.lakasg-cp-pos-bottom-center { align-items: flex-end;   justify-content: center;     padding: 0 16px; background: transparent !important; }
.lakasg-cp-pos-slide-in-left { align-items: center;     justify-content: flex-start; padding: 16px; background: transparent !important; }
.lakasg-cp-pos-slide-in-right{ align-items: center;     justify-content: flex-end;   padding: 16px; background: transparent !important; }

/* Fullscreen — dialog fills entire viewport */
.lakasg-cp-pos-fullscreen {
	padding: 0;
	align-items: stretch;
	justify-content: stretch;
}
.lakasg-cp-pos-fullscreen .lakasg-cp-dialog {
	width: 100vw !important;
	max-width: 100vw !important;
	height: 100dvh !important;
	max-height: 100dvh !important;
	border-radius: 0 !important;
	overflow: hidden !important;
	display: flex !important;
	flex-direction: column !important;
	box-shadow: none;
}

/* Mobile: fullscreen keeps no border-radius */
@media ( max-width: 480px ) {
	.lakasg-cp-pos-fullscreen .lakasg-cp-dialog {
		border-radius: 0 !important;
	}
}

/* ── Entry animations ──────────────────────────────────────── */
/* All use --lakasg-cp-anim-dur CSS var set inline by JS */
.lakasg-cp-anim-fade .lakasg-cp-dialog {
	opacity: 0;
	transition: opacity var(--lakasg-cp-anim-dur, 320ms) ease;
}
.lakasg-cp-anim-fade.is-open .lakasg-cp-dialog { opacity: 1; }

.lakasg-cp-anim-slide-up .lakasg-cp-dialog {
	transform: translateY(40px); opacity: 0;
	transition: transform var(--lakasg-cp-anim-dur, 320ms) ease, opacity var(--lakasg-cp-anim-dur, 320ms) ease;
}
.lakasg-cp-anim-slide-up.is-open .lakasg-cp-dialog { transform: translateY(0); opacity: 1; }

.lakasg-cp-anim-slide-down .lakasg-cp-dialog {
	transform: translateY(-40px); opacity: 0;
	transition: transform var(--lakasg-cp-anim-dur, 320ms) ease, opacity var(--lakasg-cp-anim-dur, 320ms) ease;
}
.lakasg-cp-anim-slide-down.is-open .lakasg-cp-dialog { transform: translateY(0); opacity: 1; }

.lakasg-cp-anim-zoom .lakasg-cp-dialog {
	transform: scale(0.85); opacity: 0;
	transition: transform var(--lakasg-cp-anim-dur, 320ms) cubic-bezier(0.34,1.56,0.64,1), opacity var(--lakasg-cp-anim-dur, 320ms) ease;
}
.lakasg-cp-anim-zoom.is-open .lakasg-cp-dialog { transform: scale(1); opacity: 1; }

.lakasg-cp-anim-flip .lakasg-cp-dialog {
	transform: perspective(800px) rotateX(-12deg); opacity: 0;
	transition: transform var(--lakasg-cp-anim-dur, 320ms) ease, opacity var(--lakasg-cp-anim-dur, 320ms) ease;
}
.lakasg-cp-anim-flip.is-open .lakasg-cp-dialog { transform: perspective(800px) rotateX(0deg); opacity: 1; }

.lakasg-cp-pos-slide-in-left .lakasg-cp-dialog {
	transform: translateX(-60px); opacity: 0;
	transition: transform var(--lakasg-cp-anim-dur, 320ms) ease, opacity var(--lakasg-cp-anim-dur, 320ms) ease;
}
.lakasg-cp-pos-slide-in-right .lakasg-cp-dialog {
	transform: translateX(60px); opacity: 0;
	transition: transform var(--lakasg-cp-anim-dur, 320ms) ease, opacity var(--lakasg-cp-anim-dur, 320ms) ease;
}
.lakasg-cp-pos-slide-in-left.is-open .lakasg-cp-dialog,
.lakasg-cp-pos-slide-in-right.is-open .lakasg-cp-dialog { transform: translateX(0); opacity: 1; }

/* ── Image ─────────────────────────────────────────────────── */
/* Sizing is handled entirely via inline styles set by JS.
   These rules only provide safe fallbacks. */
.lakasg-cp-image {
	display: block;
	width: 100%;
	overflow: hidden;
	flex-shrink: 0;
}
.lakasg-cp-image img {
	display: block;
	width: 100%;
}
/* Fullscreen: image fills all available height */
.lakasg-cp-pos-fullscreen .lakasg-cp-image {
	flex: 1 1 0;
	min-height: 0;
}
.lakasg-cp-pos-fullscreen .lakasg-cp-image img {
	width: 100%;
	height: 100%;
}

/* ── Text content ──────────────────────────────────────────── */
.lakasg-cp-text         { padding: 24px 28px; }
.lakasg-cp-headline     { margin: 0 0 12px; font-weight: 700; line-height: 1.25; }
.lakasg-cp-body         { margin: 0 0 20px; line-height: 1.6; }
.lakasg-cp-body a       { color: inherit; text-decoration: underline; }

.lakasg-cp-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.lakasg-cp-hero .lakasg-cp-btns { justify-content: center; }
.lakasg-cp-hero .lakasg-cp-text { text-align: center; padding: 48px 40px; }

/* ── Buttons ───────────────────────────────────────────────── */
.lakasg-cp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none !important;
	cursor: pointer;
	transition: opacity 200ms, transform 150ms;
	white-space: nowrap;
	border: none;
}
.lakasg-cp-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.lakasg-cp-btn:active { transform: scale(0.97); }

/* ── Split layouts ─────────────────────────────────────────── */
.lakasg-cp-split {
	display: flex;
	min-height: 240px;
}
.lakasg-cp-split .lakasg-cp-image { width: 45%; flex-shrink: 0; }
.lakasg-cp-split .lakasg-cp-image img { height: 100%; object-fit: cover; }
.lakasg-cp-split .lakasg-cp-text { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.lakasg-cp-split--rev { flex-direction: row-reverse; }
@media ( max-width: 540px ) {
	.lakasg-cp-split { flex-direction: column !important; }
	.lakasg-cp-split .lakasg-cp-image { width: 100%; }
}

/* ── Image background layout ───────────────────────────────── */
.lakasg-cp-bg-wrap {
	min-height: 280px;
	display: flex;
	align-items: flex-end;
}
.lakasg-cp-bg-wrap .lakasg-cp-text {
	background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
	width: 100%;
}
.lakasg-cp-bg-wrap .lakasg-cp-headline,
.lakasg-cp-bg-wrap .lakasg-cp-body { color: #fff !important; }

/* ── Close button ──────────────────────────────────────────── */
.lakasg-cp-close { transition: background 150ms !important; }
.lakasg-cp-close:hover { background: rgba(0,0,0,0.6) !important; }

/* ── Progress bar ──────────────────────────────────────────── */
.lakasg-cp-progress {
	position: absolute;
	bottom: 0; left: 0; right: 0;
	height: 4px;
	background: rgba(0,0,0,0.12);
	overflow: hidden;
}
.lakasg-cp-progress-fill {
	height: 100%;
	background: #2271b1;
	width: 100%;
	animation: lakasg-cp-drain linear forwards;
}
@keyframes lakasg-cp-drain {
	from { width: 100%; }
	to   { width: 0%; }
}
