/* ==========================================================================
   Pressell Popup Builder — estilos do frontend
   ========================================================================== */

html, body { margin: 0; padding: 0; height: 100%; }

.ppb-body {
	min-height: 100vh;
	overflow-x: hidden;
	background: #0b1020;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}
.ppb-body.ppb-locked { overflow: hidden; }
.ppb-locked { overflow: hidden; }

/* Fundo (imagem) ---------------------------------------------------------- */
.ppb-bg {
	position: fixed;
	inset: 0;
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
	z-index: 0;
}
.ppb-bg--desktop { background-image: var(--ppb-bg-desktop); display: block; }
.ppb-bg--mobile  { background-image: var(--ppb-bg-mobile);  display: none; }

@media (max-width: 768px) {
	.ppb-bg--desktop { display: none; }
	.ppb-bg--mobile  { display: block; }
}

/* Conteúdo de SEO --------------------------------------------------------- */
/* Oculto: sai da tela mas permanece no HTML (lido por buscadores). */
.ppb-seo--hidden {
	position: absolute;
	left: -99999px;
	top: auto;
	width: 820px;
	height: auto;
	overflow: hidden;
}
/* Visível: rodapé legível abaixo da primeira dobra. */
.ppb-seo--visible {
	position: relative;
	z-index: 5;
	margin-top: 100vh;
	background: #0b1020;
	color: #cbd5e1;
	padding: 56px 20px;
}
.ppb-seo__inner { max-width: 820px; margin: 0 auto; line-height: 1.75; }
.ppb-seo__inner h1 { color: #fff; font-size: 30px; line-height: 1.25; margin: 0 0 18px; }
.ppb-seo__inner h2 { color: #f1f5f9; font-size: 22px; margin: 28px 0 10px; }
.ppb-seo__inner h3 { color: #e2e8f0; font-size: 18px; margin: 22px 0 8px; }
.ppb-seo__inner p  { margin: 0 0 14px; }
.ppb-seo__inner ul { margin: 0 0 14px 20px; }
.ppb-seo__inner strong { color: #fff; }

/* Popup: raiz e fundo escurecido ----------------------------------------- */
.ppb-modal-root {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	visibility: hidden;
	opacity: 0;
	transition: opacity .28s ease, visibility .28s ease;
}
.ppb-modal-root.is-open { visibility: visible; opacity: 1; }

/* Camada de escurecimento + desfoque (controlada pelas variáveis do usuário). */
.ppb-scrim {
	position: absolute;
	inset: 0;
	background: var(--ppb-overlay-rgba, rgba(0, 0, 0, .55));
	cursor: pointer;
	-webkit-backdrop-filter: blur(var(--ppb-blur, 0));
	backdrop-filter: blur(var(--ppb-blur, 0));
}

/* Cartão do popup --------------------------------------------------------- */
.ppb-modal {
	position: relative;
	z-index: 1;
	width: min(440px, 94vw);
	background: var(--ppb-popup-bg, #fff);
	border-radius: var(--ppb-popup-radius, 16px);
	padding: calc(var(--ppb-popup-pad, 24px) + 6px) var(--ppb-popup-pad, 24px) var(--ppb-popup-pad, 24px);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .38);
	text-align: center;
	transform: translateY(10px) scale(.96);
	transition: transform .32s cubic-bezier(.2, .8, .25, 1);
}
.ppb-modal-root.is-open .ppb-modal { transform: none; }

.ppb-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba(17, 24, 39, .06);
	color: #4b5563;
	cursor: pointer;
	transition: background .15s ease;
	z-index: 2;
}
.ppb-close:hover { background: rgba(17, 24, 39, .13); }

.ppb-modal__head { display: none; text-align: center; }
.ppb-icon { display: inline-block; line-height: 1; }

.ppb-modal__title {
	font-size: var(--ppb-font-title, 22px);
	font-weight: 800;
	color: var(--ppb-title-color, #111827);
	line-height: 1.3;
	margin: 4px 0 8px;
}
.ppb-modal__text {
	font-size: var(--ppb-font-text, 15px);
	color: var(--ppb-text-color, #4b5563);
	line-height: 1.55;
	margin: 0 0 22px;
}

/* Marca no popup: bandeira (imagem) + nome do produto */
.ppb-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0 0 10px;
	flex-wrap: wrap;
}
img.ppb-flag {
	height: var(--ppb-flag-size, 26px);
	width: auto;
	border-radius: 3px;
	display: block;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}
.ppb-product {
	font-size: var(--ppb-font-product, 16px);
	font-weight: 700;
	color: var(--ppb-title-color, #111827);
	line-height: 1.2;
}
.ppb-tm {
	font-size: .6em;
	vertical-align: super;
	margin-left: 1px;
	font-weight: 600;
}

/* Bandeira acima do nome (coluna) ou ao lado (linha) */
.ppb-flag-top .ppb-brand { flex-direction: column; }
.ppb-flag-inline .ppb-brand { flex-direction: row; }

/* Alinhamento configurável do conteúdo do popup */
.ppb-align-left .ppb-modal { text-align: left; }
.ppb-align-center .ppb-modal { text-align: center; }
.ppb-align-right .ppb-modal { text-align: right; }
.ppb-align-left .ppb-brand { justify-content: flex-start; }
.ppb-align-center .ppb-brand { justify-content: center; }
.ppb-align-right .ppb-brand { justify-content: flex-end; }
.ppb-flag-top.ppb-align-left .ppb-brand { align-items: flex-start; }
.ppb-flag-top.ppb-align-center .ppb-brand { align-items: center; }
.ppb-flag-top.ppb-align-right .ppb-brand { align-items: flex-end; }

/* Bandeira no rodapé (sutil): imagem pequena + legenda ao lado, alinhada à esquerda */
.ppb-flag-bottom .ppb-brand {
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 6px;
	margin: 16px 0 0;
}
.ppb-caption {
	font-size: 12px;
	color: var(--ppb-text-color, #4b5563);
	opacity: .8;
	line-height: 1.3;
	text-align: left;
}
.ppb-product-line { margin: 0 0 8px; }

/* Overlay de escurecimento quando o popup está desligado (modo sem popup) */
.ppb-bg-overlay {
	position: fixed;
	inset: 0;
	z-index: 1;
	background: var(--ppb-overlay-rgba, rgba(0, 0, 0, .55));
	-webkit-backdrop-filter: blur(var(--ppb-blur, 0));
	backdrop-filter: blur(var(--ppb-blur, 0));
	pointer-events: none;
}

.ppb-actions { display: flex; gap: 10px; }
.ppb-btn {
	flex: 1;
	min-width: 0;
	border: 0;
	border-radius: var(--ppb-btn-radius, 10px);
	padding: 14px 12px;
	font-size: var(--ppb-font-btn, 15px);
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: transform .12s ease, filter .12s ease;
}
.ppb-btn:active { transform: translateY(1px); }
.ppb-btn--1 { background: var(--ppb-accent, #16a34a); color: #fff; }
.ppb-btn--1:hover { filter: brightness(1.06); }
.ppb-btn--2 { background: var(--ppb-btn2, #e5e7eb); color: var(--ppb-btn2-text, #111827); }
.ppb-btn--2:hover { filter: brightness(.97); }

/* ==========================================================================
   Modelos (todos com 2 botões + X)
   ========================================================================== */

/* Clássico: cartão limpo (padrão). */

/* Minimalista */
.ppb-tpl-minimal .ppb-modal { border: 1px solid #ececf0; box-shadow: 0 10px 40px rgba(0, 0, 0, .26); }
.ppb-tpl-minimal .ppb-modal__title { font-weight: 700; font-size: 20px; }
.ppb-tpl-minimal .ppb-btn--2 { background: transparent; border: 1px solid #d1d5db; color: #374151; }

/* Urgência */
.ppb-tpl-urgent .ppb-modal { border-top: 5px solid var(--ppb-accent, #dc2626); }
.ppb-tpl-urgent .ppb-modal__head { display: block; margin: 2px 0 6px; }
.ppb-tpl-urgent .ppb-icon { font-size: 36px; }
.ppb-tpl-urgent .ppb-icon::before { content: "\23F0"; } /* relogio */
.ppb-tpl-urgent .ppb-btn--1 { animation: ppb-pulse 1.5s ease-in-out infinite; }
@keyframes ppb-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.035); }
}

/* Cupom */
.ppb-tpl-coupon .ppb-modal { border: 2px dashed var(--ppb-accent, #7c3aed); background: #fffdf9; }
.ppb-tpl-coupon .ppb-modal__head { display: block; margin: 2px 0 6px; }
.ppb-tpl-coupon .ppb-icon { font-size: 34px; }
.ppb-tpl-coupon .ppb-icon::before { content: "\1F39F"; } /* ticket */
.ppb-tpl-coupon .ppb-btn--1 { text-transform: uppercase; letter-spacing: .3px; }

/* Alerta */
.ppb-tpl-alert .ppb-modal { padding-top: 0; overflow: hidden; }
.ppb-tpl-alert .ppb-modal__head { display: block; background: var(--ppb-accent, #2563eb); padding: 18px 0 16px; border-radius: var(--ppb-popup-radius, 16px) var(--ppb-popup-radius, 16px) 0 0; }
.ppb-tpl-alert .ppb-icon { font-size: 34px; }
.ppb-tpl-alert .ppb-icon::before { content: "\26A0"; } /* aviso */
.ppb-tpl-alert .ppb-modal__title { padding: 0 24px; margin-top: 16px; }
.ppb-tpl-alert .ppb-modal__text { padding: 0 24px; }
.ppb-tpl-alert .ppb-actions { padding: 0 24px; }
.ppb-tpl-alert .ppb-close { color: #fff; background: rgba(255, 255, 255, .22); }
.ppb-tpl-alert .ppb-close:hover { background: rgba(255, 255, 255, .35); }

/* Presente */
.ppb-tpl-gift .ppb-modal { padding: 0 0 24px; overflow: hidden; }
.ppb-tpl-gift .ppb-modal__head { display: block; background: linear-gradient(135deg, var(--ppb-accent, #db2777), #fb7185); padding: 24px 0 18px; border-radius: var(--ppb-popup-radius, 16px) var(--ppb-popup-radius, 16px) 0 0; }
.ppb-tpl-gift .ppb-icon { font-size: 42px; }
.ppb-tpl-gift .ppb-icon::before { content: "\1F381"; } /* presente */
.ppb-tpl-gift .ppb-modal__title { padding: 0 24px; margin-top: 16px; }
.ppb-tpl-gift .ppb-modal__text { padding: 0 24px; }
.ppb-tpl-gift .ppb-actions { padding: 0 24px; }
.ppb-tpl-gift .ppb-close { color: #fff; background: rgba(255, 255, 255, .25); }
.ppb-tpl-gift .ppb-close:hover { background: rgba(255, 255, 255, .4); }

/* ==========================================================================
   Responsivo e acessibilidade
   ========================================================================== */
@media (max-width: 420px) {
	.ppb-modal__title { font-size: 20px; }
	.ppb-btn { padding: 13px 8px; font-size: 14px; }
	.ppb-tpl-alert .ppb-modal__title,
	.ppb-tpl-alert .ppb-modal__text,
	.ppb-tpl-alert .ppb-actions,
	.ppb-tpl-gift .ppb-modal__title,
	.ppb-tpl-gift .ppb-modal__text,
	.ppb-tpl-gift .ppb-actions { padding-left: 18px; padding-right: 18px; }
}

.ppb-btn:focus-visible,
.ppb-close:focus-visible {
	outline: 3px solid rgba(37, 99, 235, .6);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.ppb-modal-root, .ppb-modal, .ppb-btn { transition: none !important; animation: none !important; }
}
