/* [RW] Pop-up · frontend
 * Los colores llegan como variables desde la plantilla (--rwp-*).
 * La tipografía es la del sitio (Oxygen la carga Elementor); no se carga ninguna fuente aquí.
 */

.rw-popup {
	--rwp-accent: #c0402b;
	--rwp-decor: #e35137;
	--rwp-heading: #2a344f;
	--rwp-header-bg: #fbe9e4;
	--rwp-box-bg: #f4efec;
	--rwp-text: #4a4f5c;
	--rwp-radius: 20px;
	--rwp-gutter: clamp(22px, 6.5vw, 53px);
	--rwp-header-ratio: 800 / 373;
	--rwp-transition: .2s ease;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: "Oxygen", system-ui, -apple-system, "Segoe UI", sans-serif;
	opacity: 0;
	transition: opacity var(--rwp-transition);
}

.rw-popup[hidden] {
	display: none;
}

.rw-popup.is-open {
	opacity: 1;
}

.rw-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 26, 40, .62);
}

.rw-popup__dialog {
	position: relative;
	width: 100%;
	max-width: 800px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	/* Columna flexible: si no cabe todo, encoge la cabecera y el contenido se ve entero
	   sin scroll. El scroll solo queda como último recurso (p. ej. móvil en horizontal),
	   cuando la cabecera ya está en su altura mínima. */
	display: flex;
	flex-direction: column;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	border-radius: var(--rwp-radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
	transform: translateY(12px) scale(.98);
	transition: transform var(--rwp-transition);
	outline: none;
}

.rw-popup.is-open .rw-popup__dialog {
	transform: none;
}

/* Botón de cierre. Selector reforzado porque el tema y Elementor dan estilo a todos los <button>. */
.rw-popup button.rw-popup__close {
	position: absolute;
	top: 21px;
	right: 21px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 58px;
	height: 58px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--rwp-heading);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
	font-size: 0;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
	transition: transform var(--rwp-transition), box-shadow var(--rwp-transition);
}

.rw-popup button.rw-popup__close:hover,
.rw-popup button.rw-popup__close:focus {
	transform: scale(1.06);
	border: 0;
	background: #fff;
	color: var(--rwp-heading);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
	outline: none;
}

.rw-popup button.rw-popup__close:focus-visible {
	outline: 3px solid var(--rwp-accent);
	outline-offset: 2px;
}

/* Cabecera con logo, círculos decorativos e imagen.
   Su altura natural sale de la proporción, pero puede encoger (flex-shrink) hasta
   min-height para que el contenido quepa sin scroll. */
.rw-popup__header {
	position: relative;
	flex: 0 1 auto;
	min-height: 150px;
	overflow: hidden;
	aspect-ratio: var(--rwp-header-ratio);
	background: var(--rwp-header-bg);
}

/* Lienzo de la composición: mantiene la proporción y se centra cuando la cabecera
   encoge, así logo, círculos e imagen se reducen juntos sin deformarse. */
.rw-popup__stage {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	max-width: 100%;
	aspect-ratio: var(--rwp-header-ratio);
	transform: translateX(-50%);
}

.rw-popup__circle,
.rw-popup__dot {
	position: absolute;
	border-radius: 50%;
	aspect-ratio: 1;
}

.rw-popup__circle {
	left: 25%;
	top: 14%;
	width: 50%;
	/* Tono intermedio entre el círculo decorativo y el fondo de la cabecera. */
	background: #f6cbc1;
	background: color-mix(in srgb, var(--rwp-decor) 22%, var(--rwp-header-bg));
}

.rw-popup__dot--decor {
	left: 75.25%;
	top: 22%;
	width: 9.5%;
	background: var(--rwp-decor);
}

.rw-popup__dot--heading {
	left: 18.4%;
	top: 69.7%;
	width: 4%;
	background: var(--rwp-heading);
}

.rw-popup__header .rw-popup__logo {
	position: absolute;
	z-index: 2;
	left: 4.75%;
	top: 8.5%;
	width: 24%;
	max-width: 200px;
	height: auto;
}

.rw-popup__header .rw-popup__image {
	position: absolute;
	z-index: 1;
	left: 31.5%;
	bottom: 10%;
	width: 45%;
	height: auto;
	max-height: 80%;
	object-fit: contain;
	object-position: bottom center;
}

/* Contenido: no encoge nunca; los márgenes verticales se ajustan también a la altura de la pantalla. */
.rw-popup__body {
	flex: 0 0 auto;
	padding: clamp(20px, min(6vw, 4.5vh), 48px) var(--rwp-gutter) clamp(24px, min(7vw, 6vh), 80px);
	color: var(--rwp-text);
}

.rw-popup .rw-popup__eyebrow {
	margin: 0 0 10px;
	color: var(--rwp-accent);
	font-size: clamp(12.5px, 2.2vw, 16px);
	font-weight: 700;
	letter-spacing: .14em;
	line-height: 1.3;
	text-transform: uppercase;
}

.rw-popup .rw-popup__title {
	margin: 0 0 clamp(18px, 3vw, 24px);
	color: var(--rwp-heading);
	font-family: inherit;
	font-size: clamp(24px, 4.8vw, 38px);
	font-weight: 700;
	letter-spacing: -.005em;
	line-height: 1.2;
}

.rw-popup__highlights {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: clamp(10px, 2vw, 16px);
	margin: 0 0 clamp(20px, 3vw, 28px);
	padding: 0;
	list-style: none;
}

.rw-popup__highlight {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 0;
	padding: clamp(14px, 2.4vw, 18px) clamp(14px, 3.3vw, 26px);
	border-radius: 12px;
	background: var(--rwp-box-bg);
}

.rw-popup__icon {
	flex: 0 0 auto;
	color: var(--rwp-accent);
}

.rw-popup__highlight-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.rw-popup__highlight-label {
	font-size: clamp(12px, 1.9vw, 15px);
	line-height: 1.3;
}

.rw-popup__highlight-value {
	color: var(--rwp-heading);
	font-size: clamp(18px, 3.3vw, 26px);
	font-weight: 700;
	line-height: 1.2;
}

.rw-popup__text {
	font-size: clamp(14.5px, 2.3vw, 18px);
	line-height: 1.7;
}

.rw-popup__text p {
	margin: 0 0 .8em;
}

.rw-popup__text p:last-child {
	margin-bottom: 0;
}

.rw-popup__text strong,
.rw-popup__text b {
	color: var(--rwp-heading);
	font-weight: 700;
}

.rw-popup__text a {
	color: var(--rwp-accent);
}

/* Botón opcional */
.rw-popup__actions {
	margin: clamp(20px, 3vw, 28px) 0 0;
}

.rw-popup .rw-popup__button {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 12px 28px;
	border-radius: 999px;
	background: var(--rwp-accent);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color var(--rwp-transition);
}

.rw-popup .rw-popup__button:hover,
.rw-popup .rw-popup__button:focus-visible {
	background: var(--rwp-heading);
	color: #fff;
}

/* Móvil: cabecera más alta, sin punto azul ni iconos de calendario */
@media (max-width: 600px) {
	.rw-popup {
		padding: 12px;
	}

	.rw-popup__dialog {
		max-height: calc(100vh - 24px);
		max-height: calc(100dvh - 24px);
	}

	.rw-popup button.rw-popup__close {
		top: 12px;
		right: 12px;
		width: 44px;
		height: 44px;
	}

	.rw-popup__close svg {
		width: 18px;
		height: 18px;
	}

	.rw-popup {
		--rwp-header-ratio: 360 / 210;
	}

	.rw-popup__header {
		min-height: 110px;
	}

	.rw-popup__circle {
		left: 22%;
		top: 21%;
		width: 55.5%;
	}

	.rw-popup__dot--decor {
		left: 79%;
		top: 57%;
		width: 9.5%;
	}

	.rw-popup__dot--heading,
	.rw-popup__icon {
		display: none;
	}

	.rw-popup__header .rw-popup__logo {
		left: 5.5%;
		top: 8.5%;
		width: 31%;
	}

	.rw-popup__header .rw-popup__image {
		left: 29%;
		bottom: 9.5%;
		width: 51%;
	}

	.rw-popup__highlights {
		grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	}
}

/* Pantallas muy bajas (móvil en horizontal): no hay sitio para la cabecera sin scroll,
   así que se oculta y el contenido se ve entero. */
@media (max-height: 460px) {
	.rw-popup__header {
		display: none;
	}

	.rw-popup__body {
		padding-right: calc(var(--rwp-gutter) + 40px);
	}
}

/* Bloqueo del scroll de la página mientras está abierto */
html.rw-popup-lock,
html.rw-popup-lock body {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.rw-popup,
	.rw-popup__dialog,
	.rw-popup__close {
		transition: none;
	}
}
