/* =========================================================
   Pop-up promocional — Black Week GDO
   Arte PC: 800 × 500 (16:10)   ·   Arte celular: 720 × 960 (3:4)
   Troca de arte em 700px (mesmo breakpoint do <picture>).
   Cor de destaque em --pr-accent.
   ========================================================= */

.promo {
	--pr-ratio: 3 / 4;
	--pr-max-w: min(90vw, 420px);
	--pr-accent: #FF2E9F;
	position: fixed; inset: 0; margin: auto;
	max-width: none; max-height: none;
	padding: 0; border: 0; background: none; overflow: visible;
	color: #fff; font-family: inherit;
	box-sizing: border-box;
}
.promo *, .promo *::before, .promo *::after { box-sizing: border-box; }
.promo button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.promo img { display: block; max-width: 100%; }

@media (min-width: 700px) {
	.promo { --pr-ratio: 8 / 5; --pr-max-w: min(88vw, 800px); }
}

/* evita estourar a altura em telas baixas (ex.: notebook 1366×650, celular deitado) */
.promo { width: min(var(--pr-max-w), calc((100dvh - 96px) * (var(--pr-ratio)))); }

.promo:not([open]) { display: none; }

/* Entrada por @keyframes: roda sozinha quando o dialog abre ([open]),
   sem depender de classe via JS — o cartão nunca fica preso invisível. */
.promo::backdrop {
	background: rgba(8, 4, 14, .72);
	-webkit-backdrop-filter: blur(6px) saturate(1.2);
	backdrop-filter: blur(6px) saturate(1.2);
	animation: promo-fade .35s ease both;
}

/* ---------- Cartão ---------- */
.promo-card {
	position: relative;
	border-radius: 26px;
	box-shadow: 0 0 0 3px var(--pr-accent), 0 0 34px 2px rgba(255, 46, 159, .55), 0 30px 80px -20px rgba(0, 0, 0, .7);
}
.promo[open] .promo-card { animation: promo-in .55s cubic-bezier(.34, 1.56, .64, 1) both; }

/* saída */
.promo.is-out .promo-card { animation: promo-out .25s ease both; }
.promo.is-out::backdrop { animation: promo-fade .25s ease reverse both; }

@keyframes promo-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes promo-in {
	from { opacity: 0; transform: translateY(40px) scale(.88) rotate(-2deg); }
	to   { opacity: 1; transform: none; }
}
@keyframes promo-out { to { opacity: 0; transform: translateY(24px) scale(.94); } }

.promo-link {
	display: block; position: relative; overflow: hidden;
	border-radius: inherit; aspect-ratio: var(--pr-ratio);
	background: #000;
}
.promo-link img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
@media (hover: hover) { .promo-link:hover img { transform: scale(1.03); } }

/* brilho que atravessa a arte uma vez ao abrir */
.promo-link::after {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%);
	transform: translateX(-120%);
}
.promo[open] .promo-link::after { animation: promo-shine 1.1s .5s ease-out forwards; }
@keyframes promo-shine { to { transform: translateX(120%); } }

/* ---------- Botão fechar ---------- */
.promo .promo-close {
	position: absolute; top: -14px; right: -14px; z-index: 2;
	width: 44px; height: 44px; border-radius: 50%;
	display: grid; place-items: center;
	background: #000; color: #fff;
	box-shadow: 0 0 0 3px var(--pr-accent), 0 0 16px rgba(255, 46, 159, .6), 0 8px 18px -6px rgba(0, 0, 0, .5);
	font-size: 28px; line-height: 1;
	transition: transform .25s cubic-bezier(.2, .8, .2, 1), background-color .2s;
}
.promo .promo-close:hover { transform: rotate(90deg) scale(1.06); background: var(--pr-accent); }
@media (max-width: 699px) { .promo .promo-close { top: -12px; right: -8px; } }

/* ---------- "Não mostrar novamente" ---------- */
.promo .promo-skip {
	display: block; margin: 14px auto 0;
	font-size: 14px; font-weight: 600; color: #fff;
	text-decoration: underline; text-underline-offset: 3px; opacity: .85;
}
.promo .promo-skip:hover { opacity: 1; }

/* fallback sem showModal(): sombra gigante faz o papel do backdrop */
.promo.is-fallback { z-index: 99999; height: fit-content; }
.promo.is-fallback .promo-card { box-shadow: 0 0 0 3px var(--pr-accent), 0 0 0 100vmax rgba(8, 4, 14, .72); }

@media (prefers-reduced-motion: reduce) {
	.promo[open] .promo-card { animation: promo-fade .2s ease both; }
	.promo.is-out .promo-card { animation: promo-fade .15s ease reverse both; }
	.promo-link img { transition: none; transform: none !important; }
	.promo-link::after { display: none; }
}
