/* Popup Studio – front-end styles. All rules are scoped to .pstu-popup. */

.pstu-popup[hidden] { display: none !important; }
.pstu-popup, .pstu-popup * { box-sizing: border-box; }

.pstu-popup {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-size: var(--pstu-fs, 16px);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* Overlay */
.pstu-overlay {
	position: absolute;
	inset: 0;
	background: var(--pstu-overlay, rgba(0,0,0,.6));
	opacity: 0;
	transition: opacity .3s ease;
}
.pstu-popup.is-visible .pstu-overlay { opacity: 1; }

/* Box */
.pstu-box {
	position: relative;
	width: min(var(--pstu-width, 520px), 100%);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: auto;
	overscroll-behavior: contain;
	background: var(--pstu-bg, #fff);
	color: var(--pstu-text, #1d2327);
	border-radius: var(--pstu-radius, 14px);
	padding: var(--pstu-pad, 36px);
	outline: none;
	opacity: 0;
	transition: opacity .35s ease, transform .45s cubic-bezier(.2,.9,.3,1.15);
	isolation: isolate;
}
.pstu-has-shadow .pstu-box { box-shadow: 0 24px 70px -12px rgba(0,0,0,.35), 0 4px 14px rgba(0,0,0,.08); }
.pstu-align-center .pstu-body { text-align: center; }
.pstu-align-left .pstu-body { text-align: left; }
.pstu-body { position: relative; z-index: 1; }

/* Animations: start states */
.pstu-anim-zoom .pstu-box { transform: scale(.88); }
.pstu-anim-slide-up .pstu-box { transform: translateY(40px); }
.pstu-anim-slide-down .pstu-box { transform: translateY(-40px); }
.pstu-anim-slide-left .pstu-box { transform: translateX(60px); }
.pstu-anim-slide-right .pstu-box { transform: translateX(-60px); }
.pstu-anim-bounce .pstu-box { transform: scale(.6); transition: opacity .3s ease, transform .6s cubic-bezier(.34,1.8,.5,1); }
.pstu-anim-none .pstu-box { transition: none; }
.pstu-popup.is-visible .pstu-box { opacity: 1; transform: none; }
.pstu-popup.is-closing .pstu-box { opacity: 0; transition-duration: .2s; }
.pstu-popup.is-closing .pstu-overlay { opacity: 0; transition-duration: .2s; }

/* ---------- Layouts ---------- */

/* Split */
.pstu-layout-split .pstu-box {
	display: grid;
	grid-template-columns: 42% 1fr;
	padding: 0;
}
.pstu-layout-split .pstu-body { padding: var(--pstu-pad); align-self: center; }
.pstu-layout-split.pstu-media-right .pstu-media { order: 2; }
.pstu-layout-split.pstu-media-none .pstu-box { grid-template-columns: 1fr; }
.pstu-layout-split .pstu-media { min-height: 100%; border-radius: 0; margin: 0; }

/* Fullscreen */
.pstu-layout-fullscreen { padding: 0; }
.pstu-layout-fullscreen .pstu-box {
	width: 100%;
	height: 100%;
	max-height: none;
	border-radius: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.pstu-layout-fullscreen .pstu-body, .pstu-layout-fullscreen .pstu-media { width: min(var(--pstu-width), 100%); }

/* Slide-in */
.pstu-layout-slidein { inset: auto; padding: 0; display: block; }
.pstu-layout-slidein.pstu-pos-bottom-right { right: 20px; bottom: 20px; }
.pstu-layout-slidein.pstu-pos-bottom-left { left: 20px; bottom: 20px; }
.pstu-layout-slidein.pstu-pos-top-right { right: 20px; top: 20px; }
.pstu-layout-slidein.pstu-pos-top-left { left: 20px; top: 20px; }
.pstu-layout-slidein .pstu-box { width: min(var(--pstu-width), calc(100vw - 32px)); max-height: calc(100vh - 40px); }

/* Bar */
.pstu-layout-bar { inset: auto 0 auto 0; padding: 0; display: block; }
.pstu-layout-bar.pstu-pos-top { top: 0; }
.pstu-layout-bar.pstu-pos-bottom { bottom: 0; }
.admin-bar .pstu-layout-bar.pstu-pos-top { top: 32px; }
.pstu-layout-bar .pstu-box { width: 100%; max-width: none; border-radius: 0; padding: var(--pstu-pad) 52px var(--pstu-pad) 16px; }
.pstu-layout-bar .pstu-body { display: flex; align-items: center; justify-content: center; gap: 8px 16px; flex-wrap: wrap; text-align: center; }
.pstu-layout-bar .pstu-heading { margin: 0; font-weight: 600; }
.pstu-layout-bar .pstu-content, .pstu-layout-bar .pstu-content p, .pstu-layout-bar .pstu-actions, .pstu-layout-bar .pstu-coupon, .pstu-layout-bar .pstu-countdown { margin: 0; }
.pstu-layout-bar .pstu-form { margin: 0; }
.pstu-layout-bar .pstu-fields { flex-wrap: nowrap; }
.pstu-layout-bar .pstu-input { min-width: 0; width: 220px; flex: 0 1 220px; padding: 8px 12px; }
.pstu-layout-bar .pstu-btn { padding: 8px 18px; }
.pstu-layout-bar .pstu-secondary { margin: 0; }
.pstu-layout-bar .pstu-close { top: 50%; transform: translateY(-50%); width: 30px; height: 30px; }
.pstu-layout-bar .pstu-badge { margin: 0; }
.pstu-layout-bar .pstu-countdown .pstu-cd-unit { padding: 4px 8px; min-width: 0; }
.pstu-layout-bar .pstu-countdown b { font-size: 1.1em; }

/* Side panel */
.pstu-layout-sidepanel { padding: 0; }
.pstu-layout-sidepanel .pstu-box {
	position: absolute;
	top: 0;
	bottom: 0;
	width: min(var(--pstu-width), 100vw);
	max-height: none;
	border-radius: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.pstu-layout-sidepanel.pstu-pos-right .pstu-box { right: 0; }
.pstu-layout-sidepanel.pstu-pos-left .pstu-box { left: 0; }

/* Inline (shortcode embed) */
.pstu-popup.pstu-inline { position: relative; inset: auto; z-index: auto; display: block; padding: 0; margin: 1.5em 0; }
.pstu-inline .pstu-box { margin: 0 auto; max-height: none; opacity: 1; transform: none; }

/* ---------- Media ---------- */
.pstu-media {
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: linear-gradient(135deg, var(--pstu-accent), var(--pstu-accent2));
	color: var(--pstu-btn-text);
	min-height: 150px;
	position: relative;
	z-index: 1;
}
.pstu-media .pstu-img { display: block; width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.pstu-visual { font-size: clamp(48px, 7vw, 92px); font-weight: 800; line-height: 1; letter-spacing: -.02em; text-shadow: 0 6px 24px rgba(0,0,0,.18); }

.pstu-media-top .pstu-media {
	margin: calc(var(--pstu-pad) * -1) calc(var(--pstu-pad) * -1) var(--pstu-pad);
	border-radius: var(--pstu-radius) var(--pstu-radius) 0 0;
}
.pstu-layout-fullscreen.pstu-media-top .pstu-media { margin: 0 0 24px; border-radius: var(--pstu-radius); }

.pstu-layout-modal.pstu-media-left .pstu-box, .pstu-layout-modal.pstu-media-right .pstu-box,
.pstu-layout-slidein.pstu-media-left .pstu-box, .pstu-layout-slidein.pstu-media-right .pstu-box,
.pstu-layout-sidepanel.pstu-media-left .pstu-box, .pstu-layout-sidepanel.pstu-media-right .pstu-box {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 16px;
	align-items: start;
}
.pstu-layout-modal.pstu-media-right .pstu-media, .pstu-layout-slidein.pstu-media-right .pstu-media, .pstu-layout-sidepanel.pstu-media-right .pstu-media { order: 2; }
.pstu-layout-modal.pstu-media-left .pstu-media, .pstu-layout-modal.pstu-media-right .pstu-media,
.pstu-layout-slidein.pstu-media-left .pstu-media, .pstu-layout-slidein.pstu-media-right .pstu-media,
.pstu-layout-sidepanel.pstu-media-left .pstu-media, .pstu-layout-sidepanel.pstu-media-right .pstu-media {
	width: 64px; height: 64px; min-height: 0; border-radius: 50%;
}
.pstu-layout-modal.pstu-media-left .pstu-visual, .pstu-layout-modal.pstu-media-right .pstu-visual,
.pstu-layout-slidein.pstu-media-left .pstu-visual, .pstu-layout-slidein.pstu-media-right .pstu-visual,
.pstu-layout-sidepanel.pstu-media-left .pstu-visual, .pstu-layout-sidepanel.pstu-media-right .pstu-visual { font-size: 30px; }
.pstu-layout-slidein.pstu-media-top .pstu-media { min-height: 110px; }
.pstu-layout-slidein.pstu-media-top .pstu-visual { font-size: 56px; }

/* ---------- Typography ---------- */
.pstu-badge {
	display: inline-block;
	margin: 0 0 12px;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--pstu-accent);
	color: var(--pstu-btn-text);
	font-size: .72em;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	line-height: 1.4;
}
.pstu-eyebrow {
	margin: 0 0 6px;
	color: var(--pstu-accent-text, var(--pstu-accent));
	font-size: .78em;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}
.pstu-heading {
	margin: 0 0 .45em;
	padding: 0;
	font-family: inherit;
	font-size: var(--pstu-hs, 28px);
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -.015em;
	color: inherit;
	text-transform: none;
	border: 0;
}
.pstu-heading::before, .pstu-heading::after { content: none; }
.pstu-content { margin: 0 0 1.1em; opacity: .88; }
.pstu-content > :last-child { margin-bottom: 0; }
.pstu-content p { margin: 0 0 .7em; color: inherit; }
.pstu-content ul, .pstu-content ol { margin: 0 0 .7em 1.2em; padding: 0; text-align: left; }
.pstu-align-center .pstu-content ul { display: inline-block; }
.pstu-content a { color: var(--pstu-accent-text, var(--pstu-accent)); text-decoration: underline; }
.pstu-content img { max-width: 100%; height: auto; }
.pstu-social { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pstu-align-left .pstu-social { justify-content: flex-start; }
.pstu-content .pstu-social a {
	display: inline-block; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .9em;
	border: 1.5px solid var(--pstu-accent); color: var(--pstu-accent);
}
.pstu-content .pstu-social a:hover { background: var(--pstu-accent); color: var(--pstu-btn-text); }

/* ---------- Buttons & form ---------- */
.pstu-actions { margin: 0; }
.pstu-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 26px;
	border: 0;
	border-radius: min(var(--pstu-radius), 10px);
	background: var(--pstu-accent);
	color: var(--pstu-btn-text) !important;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
	cursor: pointer;
	transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
	box-shadow: 0 6px 16px -6px var(--pstu-accent);
	white-space: nowrap;
}
.pstu-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.pstu-btn:active { transform: translateY(0); }
.pstu-btn[disabled] { opacity: .6; cursor: wait; }
.pstu-popup :focus-visible { outline: 2px solid var(--pstu-accent); outline-offset: 2px; }

.pstu-form { margin: 0; }
.pstu-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.pstu-align-center .pstu-fields { justify-content: center; }
.pstu-input {
	flex: 1 1 200px;
	min-width: 0;
	margin: 0;
	padding: 12px 14px;
	border: 1.5px solid rgba(128,128,128,.35);
	border: 1.5px solid color-mix(in srgb, var(--pstu-text) 22%, transparent);
	border-radius: min(var(--pstu-radius), 10px);
	background: var(--pstu-bg);
	background: color-mix(in srgb, var(--pstu-bg) 94%, var(--pstu-text));
	color: var(--pstu-text);
	font: inherit;
	line-height: 1.3;
	box-shadow: none;
}
.pstu-input::placeholder { color: inherit; opacity: .55; }
.pstu-input:focus { border-color: var(--pstu-accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pstu-accent) 25%, transparent); }
.pstu-input[aria-invalid="true"] { border-color: #d63638; }
.pstu-consent { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-size: .8em; text-align: left; opacity: .85; cursor: pointer; }
.pstu-consent input { margin: 3px 0 0; flex: none; }
.pstu-msg { margin: 8px 0 0; font-size: .9em; min-height: 0; }
.pstu-msg:empty { display: none; }
.pstu-msg.is-error { color: #d63638; font-weight: 600; }
.pstu-msg.is-success { font-weight: 700; font-size: 1em; }
.pstu-form.is-done .pstu-fields, .pstu-form.is-done .pstu-consent { display: none; }

.pstu-secondary {
	display: inline-block;
	margin: 14px 0 0;
	padding: 4px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: .85em;
	opacity: .65;
	text-decoration: underline;
	cursor: pointer;
}
.pstu-secondary:hover { opacity: 1; background: none; color: inherit; }
.pstu-body > .pstu-secondary { display: block; margin-left: auto; margin-right: auto; }
.pstu-align-left .pstu-body > .pstu-secondary { margin-left: 0; }
.pstu-footnote { margin: 12px 0 0; font-size: .72em; opacity: .55; }

.pstu-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(128,128,128,.14);
	color: var(--pstu-text);
	cursor: pointer;
	transition: background .15s ease, transform .15s ease;
}
.pstu-close:hover { background: rgba(128,128,128,.28); transform: rotate(90deg); }
.pstu-layout-split.pstu-media-right .pstu-close { color: var(--pstu-btn-text); background: rgba(0,0,0,.15); }

/* Countdown */
.pstu-countdown { display: flex; gap: 8px; margin: 0 0 1.1em; justify-content: center; }
.pstu-align-left .pstu-countdown { justify-content: flex-start; }
.pstu-cd-unit {
	display: flex; flex-direction: column; align-items: center;
	min-width: 62px; padding: 8px 6px;
	border-radius: min(var(--pstu-radius), 10px);
	background: rgba(128,128,128,.12);
	background: color-mix(in srgb, var(--pstu-accent) 14%, transparent);
}
.pstu-cd-unit b { font-size: 1.6em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pstu-cd-unit small { font-size: .68em; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.pstu-countdown.is-expired { font-weight: 700; }

/* Coupon */
.pstu-coupon { display: flex; justify-content: center; align-items: stretch; margin: 0 0 1.1em; }
.pstu-align-left .pstu-coupon { justify-content: flex-start; }
.pstu-coupon-code {
	padding: 10px 18px;
	border: 2px dashed var(--pstu-accent);
	border-right: 0;
	border-radius: min(var(--pstu-radius), 10px) 0 0 min(var(--pstu-radius), 10px);
	background: transparent;
	color: inherit;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 1.15em;
	font-weight: 700;
	letter-spacing: .12em;
}
.pstu-coupon-copy {
	padding: 0 16px;
	border: 0;
	border-radius: 0 min(var(--pstu-radius), 10px) min(var(--pstu-radius), 10px) 0;
	background: var(--pstu-accent);
	color: var(--pstu-btn-text);
	font: inherit;
	font-weight: 700;
	font-size: .85em;
	cursor: pointer;
}

/* Honeypot + screen-reader text */
.pstu-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.pstu-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Decorations ---------- */
.pstu-decor { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.pstu-decor span { position: absolute; display: block; }

.pstu-decor-blobs .pstu-decor span:nth-child(1) { width: 260px; height: 260px; top: -120px; right: -90px; border-radius: 50%; background: var(--pstu-accent); opacity: .14; filter: blur(4px); }
.pstu-decor-blobs .pstu-decor span:nth-child(2) { width: 180px; height: 180px; bottom: -90px; left: -60px; border-radius: 50%; background: var(--pstu-accent2); opacity: .16; }
.pstu-decor-blobs .pstu-decor span:nth-child(3) { width: 60px; height: 60px; bottom: 30px; right: 26px; border-radius: 50%; background: var(--pstu-accent2); opacity: .22; }

.pstu-decor-dots .pstu-decor span:nth-child(1) { width: 160px; height: 120px; top: 14px; right: 14px; background-image: radial-gradient(var(--pstu-accent) 1.6px, transparent 1.8px); background-size: 14px 14px; opacity: .28; }
.pstu-decor-dots .pstu-decor span:nth-child(2) { width: 120px; height: 90px; bottom: 14px; left: 14px; background-image: radial-gradient(var(--pstu-accent2) 1.6px, transparent 1.8px); background-size: 14px 14px; opacity: .3; }

.pstu-decor-stripes .pstu-decor span:nth-child(1) { left: 0; right: 0; top: 0; height: 8px; background: repeating-linear-gradient(-45deg, var(--pstu-accent) 0 12px, var(--pstu-accent2) 12px 24px); }
.pstu-decor-stripes .pstu-decor span:nth-child(2) { width: 140px; height: 140px; bottom: -40px; right: -40px; background: repeating-linear-gradient(-45deg, var(--pstu-accent) 0 2px, transparent 2px 12px); opacity: .18; border-radius: 50%; }

.pstu-decor-confetti .pstu-decor span:nth-child(1) {
	inset: 0;
	background-image:
		radial-gradient(circle, var(--pstu-accent) 3px, transparent 3.5px),
		radial-gradient(circle, var(--pstu-accent2) 3px, transparent 3.5px),
		linear-gradient(45deg, transparent 45%, var(--pstu-accent2) 45% 55%, transparent 55%),
		linear-gradient(-45deg, transparent 45%, var(--pstu-accent) 45% 55%, transparent 55%);
	background-size: 90px 70px, 110px 90px, 70px 80px, 130px 100px;
	background-position: 10px 12px, 55px 40px, 30px 60px, 80px 20px;
	opacity: .35;
	-webkit-mask-image: linear-gradient(180deg, #000 0, transparent 35%, transparent 70%, #000 100%);
	mask-image: linear-gradient(180deg, #000 0, transparent 35%, transparent 70%, #000 100%);
}

.pstu-decor-gradient .pstu-decor span:nth-child(1) { inset: -40% -20% auto; height: 90%; background: radial-gradient(closest-side, var(--pstu-accent), transparent); opacity: .28; }
.pstu-decor-gradient .pstu-decor span:nth-child(2) { inset: auto -30% -50% 20%; height: 80%; background: radial-gradient(closest-side, var(--pstu-accent2), transparent); opacity: .22; }

.pstu-decor-wave .pstu-decor span:nth-child(1) { left: -20%; right: -20%; bottom: -70px; height: 140px; border-radius: 50%; background: var(--pstu-accent); opacity: .12; }
.pstu-decor-wave .pstu-decor span:nth-child(2) { left: -10%; right: -30%; bottom: -95px; height: 150px; border-radius: 45%; background: var(--pstu-accent2); opacity: .14; }

.pstu-decor-ring .pstu-decor span { border-radius: 50%; border: 2px solid var(--pstu-accent2); opacity: .35; }
.pstu-decor-ring .pstu-decor span:nth-child(1) { width: 220px; height: 220px; top: -110px; left: -110px; }
.pstu-decor-ring .pstu-decor span:nth-child(2) { width: 320px; height: 320px; top: -160px; left: -160px; opacity: .2; }
.pstu-decor-ring .pstu-decor span:nth-child(3) { width: 160px; height: 160px; bottom: -80px; right: -60px; border-color: var(--pstu-accent); }

/* Scroll lock for modal layouts */
html.pstu-lock, html.pstu-lock body { overflow: hidden !important; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
	.pstu-popup { padding: 12px; }
	.pstu-box { padding: min(var(--pstu-pad), 24px); }
	.pstu-heading { font-size: min(var(--pstu-hs), 26px); }
	.pstu-layout-split .pstu-box { grid-template-columns: 1fr; }
	.pstu-layout-split .pstu-media { min-height: 120px; order: 0 !important; }
	.pstu-layout-split .pstu-body { padding: min(var(--pstu-pad), 24px); }
	.pstu-media-top .pstu-media { margin: calc(min(var(--pstu-pad), 24px) * -1) calc(min(var(--pstu-pad), 24px) * -1) min(var(--pstu-pad), 24px); }
	.pstu-layout-slidein.pstu-pos-bottom-right, .pstu-layout-slidein.pstu-pos-bottom-left { left: 12px; right: 12px; bottom: 12px; }
	.pstu-layout-slidein.pstu-pos-top-right, .pstu-layout-slidein.pstu-pos-top-left { left: 12px; right: 12px; top: 12px; }
	.pstu-layout-slidein .pstu-box { width: 100%; }
	.pstu-layout-bar .pstu-fields { flex-wrap: wrap; justify-content: center; }
	.pstu-layout-bar .pstu-input { flex: 1 1 160px; }
	.pstu-fields .pstu-btn { flex: 1 1 100%; }
	.pstu-layout-bar .pstu-fields .pstu-btn { flex: 0 0 auto; }
	.pstu-cd-unit { min-width: 52px; }
}
@media (max-width: 782px) {
	.admin-bar .pstu-layout-bar.pstu-pos-top { top: 46px; }
}
@media (prefers-reduced-motion: reduce) {
	.pstu-box, .pstu-overlay, .pstu-btn, .pstu-close { transition: none !important; transform: none !important; }
}

/* Keep the first line clear of the close button */
.pstu-align-left .pstu-body > :first-child { padding-right: 34px; }
.pstu-align-center .pstu-body > :first-child:not(.pstu-badge) { padding-left: 30px; padding-right: 30px; }
.pstu-layout-split .pstu-body > :first-child, .pstu-layout-bar .pstu-body > :first-child, .pstu-media-top .pstu-body > :first-child { padding-left: 0; padding-right: 0; }
