/*
 * Tostao · Salto de secciones — estilos
 *
 * 1. Diseño de las "pantallas" (se ve siempre, también dentro del editor).
 * 2. Modo salto (solo cuando el script lo activa: html.tostao-salto).
 *
 * Los colores salen de los Ajustes globales de Elementor (Burdeos, Amarillo,
 * Crema), así que cambiarlos allí cambia toda la web.
 */

:root {
	--tostao-burdeos: var(--e-global-color-primary, #5e2129);
	--tostao-amarillo: var(--e-global-color-secondary, #ffff00);
	--tostao-crema: var(--e-global-color-accent, #f7edcf);
	--tostao-curva: cubic-bezier(0.77, 0, 0.18, 1);
}

/* ---------- 1. Pantallas ---------- */

/* Alto, centrado y márgenes se ajustan en Elementor (pestaña Diseño de cada sección). */
.e-con.tostao-pantalla {
	box-sizing: border-box;
	overflow: hidden;
}

.e-con.tostao-interior {
	width: 100%;
	max-width: 90rem;
	margin-inline: auto;
}

/* Etiqueta pequeña sobre el título. */
.tostao-pantalla .tostao-eti .elementor-heading-title {
	margin: 0;
	font-size: clamp(0.75rem, 0.6rem + 0.25vw, 0.875rem);
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.25em;
	text-transform: uppercase;
}

/* Titulares. */
.tostao-pantalla .tostao-t1 .elementor-heading-title {
	margin: 0;
	max-width: 36rem;
	font-size: clamp(1.35rem, min(3vw, 4.6vh), 2.4rem);
	font-weight: 800;
	line-height: 1.12;
}

.tostao-pantalla .tostao-h2 .elementor-heading-title {
	margin: 0;
	text-wrap: balance;
	font-size: clamp(2rem, min(5.4vw, 8.5vh), 5rem);
	font-weight: 900;
	line-height: 0.95;
	letter-spacing: -0.025em;
}

.tostao-pantalla .tostao-h2b .elementor-heading-title {
	margin: 0;
	font-size: clamp(1.8rem, min(4.6vw, 7.4vh), 4.2rem);
	font-weight: 900;
	line-height: 0.98;
	letter-spacing: -0.025em;
}

.tostao-pantalla .tostao-h2c .elementor-heading-title {
	margin: 0;
	font-size: clamp(2rem, min(6vw, 9vh), 5.5rem);
	font-weight: 900;
	line-height: 0.95;
	letter-spacing: -0.025em;
}

.tostao-pantalla .tostao-h2d .elementor-heading-title {
	margin: 0;
	max-width: 40rem;
	font-size: clamp(1.4rem, min(3.6vw, 5.6vh), 3rem);
	font-weight: 800;
	line-height: 1.1;
}

/* Cifra grande (la dirección, como el "13" de la inauguración). */
.tostao-pantalla .tostao-cifra .elementor-heading-title {
	margin: 0;
	font-size: clamp(4.5rem, min(14vw, 22vh), 11rem);
	font-weight: 900;
	line-height: 0.8;
	letter-spacing: -0.05em;
}

.tostao-pantalla .tostao-cifra-rotulo .elementor-heading-title {
	margin: 0;
	padding-bottom: 0.25rem;
	font-size: clamp(1.1rem, min(3vw, 4.5vh), 2.2rem);
	font-weight: 800;
	line-height: 1;
	text-transform: uppercase;
}

/*
 * Párrafos. El tamaño va en el contenedor del widget (no en el <p>) para que
 * Elementor > Estilo > Tipografía lo pueda cambiar desde el panel.
 */
.tostao-pantalla .tostao-tx {
	max-width: 36rem;
	font-size: clamp(0.9rem, calc(1.6vh + 0.4vw), 1.2rem);
	font-weight: 500;
	line-height: 1.6;
}

.tostao-pantalla .tostao-tx p,
.tostao-pantalla .tostao-direccion p {
	margin: 0;
	font: inherit;
}

/* Pastilla ("Ya estamos abiertos"). */
.tostao-pantalla .tostao-pastilla .elementor-heading-title {
	margin: 0;
	font-size: clamp(0.95rem, 1.6vh, 1.125rem);
	font-weight: 800;
	line-height: 1;
}

/* Botones y enlaces con el estilo de la web. */
.tostao-pantalla .elementor-button {
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	line-height: 1.2;
	text-transform: uppercase;
	transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.tostao-pantalla .elementor-button:hover {
	transform: translateY(-2px);
}

.tostao-pantalla .tostao-enlace .elementor-button {
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.15em;
}

.tostao-pantalla .tostao-enlace .elementor-button:hover {
	background: transparent;
	transform: none;
}

/* Tarjetas: todo el recuadro es el enlace. */
.e-con.tostao-tarjeta {
	position: relative;
	transition: transform 0.3s var(--tostao-curva);
}

.e-con.tostao-tarjeta:hover {
	transform: translateY(-4px) rotate(-0.6deg);
}

.tostao-tarjeta .tostao-enlace .elementor-button::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}

.tostao-pantalla .tostao-tarjeta .elementor-heading-title {
	margin: 0;
	font-size: clamp(0.95rem, 1.5vw, 1.25rem);
	font-weight: 800;
	line-height: 1.15;
}

.tostao-pantalla .tostao-tarjeta .tostao-tx {
	font-size: clamp(0.78rem, 1.2vh + 0.2vw, 0.9rem);
	line-height: 1.4;
}

/* Títulos de las tarjetas de curso (más pequeños que los de las tarjetas de la tienda para que quepan en una línea). */
.e-con.tostao-tarjeta .elementor-heading-title {
	font-size: clamp(0.95rem, 1.25vw, 1.125rem);
}

/* Foto con esquinas redondeadas. */
.tostao-pantalla .tostao-foto img {
	display: block;
	width: 100%;
	height: min(72vh, 40rem);
	object-fit: cover;
	border-radius: 2rem;
}

/* Dirección en el recuadro amarillo. */
.tostao-pantalla .tostao-direccion {
	font-size: clamp(1.1rem, calc(2.4vh + 0.5vw), 1.6rem);
	font-weight: 800;
	line-height: 1.3;
}

/* Tarjeta amarilla ajustada al ancho de su contenido y centrada en su hueco (escritorio). */
@media (min-width: 1025px) {
	.e-con.tostao-tarjeta-direccion {
		width: fit-content;
		max-width: 100%;
		flex: 0 0 auto;
		margin-inline: auto;
	}
}

/*
 * En móviles estrechos la barra negra de WordPress (solo la ve quien tiene la sesión iniciada) no es fija:
 * se va con el primer desplazamiento, así que la cabecera se pega arriba del todo.
 */
@media (max-width: 600px) {
	html.tostao-previo body header.elementor-location-header,
	html.tostao-salto body header.elementor-location-header,
	html.tostao-tactil body header.elementor-location-header {
		top: 0;
	}

	html.tostao-previo:root {
		--t-cab: var(--tostao-cab-previa, 64px);
	}
}

/* Tableta y móvil: mascota más pequeña y tarjetas sin la frase explicativa, para que cada pantalla quepa entera. */
@media (max-width: 1024px) {
	html .tostao-pantalla .tostao-mascota img {
		height: min(30vh, 26rem);
		height: min(30dvh, 26rem);
	}
}

@media (max-width: 767px) {
	/* Solo en las tarjetas de curso (las de la tienda llevan una frase corta y se quedan). */
	.e-con.tostao-tarjeta .tostao-tx {
		display: none;
	}

	.tostao-fotos .tostao-fondo .swiper-slide-inner {
		padding-right: 7rem;
	}

	.tostao-pantalla .tostao-logo-apilado img {
		height: min(9dvh, 4.5rem);
	}
}

/* Elementos que solo se muestran en pantallas anchas (la foto de la tienda). */
@media (max-width: 1024px) {
	.tostao-pantalla .tostao-solo-escritorio {
		display: none;
	}
}

/* Texto de cada foto, en crema y sobre un degradado granate. */
.tostao-fotos .tostao-fondo .elementor-slide-heading {
	color: var(--tostao-crema);
}

/*
 * Degradado granate sobre cada foto. Va en un pseudo-elemento propio (no en la
 * "Superposición" del widget) para que también lo tenga una diapositiva nueva.
 */
.tostao-fotos .tostao-fondo .swiper-slide-inner::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: linear-gradient(to top, rgba(94, 33, 41, 0.9), rgba(94, 33, 41, 0.2) 50%, rgba(94, 33, 41, 0.6));
	background-image: linear-gradient(
		to top,
		color-mix(in srgb, var(--tostao-burdeos) 90%, transparent),
		color-mix(in srgb, var(--tostao-burdeos) 20%, transparent) 50%,
		color-mix(in srgb, var(--tostao-burdeos) 60%, transparent)
	);
}

.tostao-fotos .tostao-fondo .swiper-slide-contents {
	position: relative;
	z-index: 1;
}

.tostao-fotos .tostao-fondo .elementor-swiper-button {
	color: var(--tostao-crema);
}

/* Mascota que flota suavemente. */
.tostao-pantalla .tostao-mascota {
	display: flex;
	justify-content: center;
}

.tostao-pantalla .tostao-mascota img {
	width: auto;
	max-width: 100%;
	height: min(66vh, 38rem);
	animation: tostao-flota 5s ease-in-out infinite;
	transform-origin: 50% 90%;
}

@keyframes tostao-flota {
	0%,
	100% {
		transform: translateY(0) rotate(-1.5deg);
	}

	50% {
		transform: translateY(-1.2rem) rotate(1.5deg);
	}
}

/* Logotipo grande de la portada. */
.tostao-pantalla .tostao-logo-grande img {
	display: block;
	width: min(86vw, 40rem, 60vh);
	max-width: 100%;
	height: auto;
}

.tostao-pantalla .tostao-logo-apilado img {
	display: block;
	width: auto;
	height: min(14vh, 6rem);
}

/* Pantalla de fotos (diapositivas a pantalla completa). */
.e-con.tostao-fotos {
	position: relative;
	padding: 0;
}

.tostao-fotos .tostao-fondo {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	margin: 0;
}

.tostao-fotos .tostao-fondo .elementor-slides-wrapper,
.tostao-fotos .tostao-fondo .elementor-main-swiper,
.tostao-fotos .tostao-fondo .swiper-wrapper,
.tostao-fotos .tostao-fondo .swiper-slide,
.tostao-fotos .tostao-fondo .swiper-slide-inner {
	height: 100%;
	min-height: 100%;
}

.tostao-fotos .tostao-fondo .elementor-slide-heading {
	font-size: clamp(1rem, calc(2vh + 0.5vw), 1.5rem);
	font-weight: 700;
	line-height: 1.3;
	text-align: left;
}

.tostao-fotos .tostao-fondo .swiper-slide-inner {
	align-items: flex-end;
	justify-content: flex-start;
	padding: 0 clamp(1.25rem, 6vw, 5rem) clamp(2rem, 7vh, 4.5rem);
}

.tostao-fotos .tostao-fondo .swiper-slide-contents {
	max-width: 36rem;
	margin: 0;
	text-align: left;
}

.tostao-fotos .tostao-sobre {
	position: relative;
	z-index: 2;
	pointer-events: none;
}

/* Flechas redondas abajo a la derecha, como en la web de Tostao. */
.tostao-fotos .tostao-fondo .elementor-swiper-button {
	top: auto;
	bottom: clamp(2rem, 7vh, 4.5rem);
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	display: grid;
	place-items: center;
	border: 2px solid currentColor;
	border-radius: 9999px;
	transform: none;
}

.tostao-fotos .tostao-fondo .elementor-swiper-button-next {
	right: clamp(1.25rem, 6vw, 5rem);
}

.tostao-fotos .tostao-fondo .elementor-swiper-button-prev {
	right: calc(clamp(1.25rem, 6vw, 5rem) + 3.5rem);
	left: auto;
}

.tostao-fotos .tostao-fondo .elementor-swiper-button svg,
.tostao-fotos .tostao-fondo .elementor-swiper-button i {
	width: 1rem;
	height: 1rem;
	font-size: 1rem;
}

/* Textos que se esconden cuando la ventana es poco alta. */
@media (max-height: 700px) {
	.tostao-pantalla .tostao-corto {
		display: none;
	}
}

/*
 * "tostao-previo": clase que se pone en <html> desde la cabecera de la página,
 * antes de que cargue nada, en las pantallas anchas de una página con salto.
 * Deja la página ya colocada (cabecera fija, sin franja, sin barras de
 * desplazamiento y contenido oculto a la espera de su animación) para que no
 * se vea ningún parpadeo mientras carga el script. El script la sustituye por
 * "tostao-salto" (o la quita si el salto no se puede usar).
 */
html.tostao-previo {
	--t-cab: calc(var(--tostao-cab-previa, 74px) + var(--wp-admin--admin-bar--height, 0px));
}

/* Entrada escalonada de los elementos marcados con "tostao-aparece". */
html.tostao-previo .tostao-pantalla .tostao-aparece,
html.tostao-salto .tostao-pantalla .tostao-aparece,
html.tostao-tactil .tostao-pantalla .tostao-aparece {
	opacity: 0;
	transform: translateY(2.5rem);
	transition: opacity 0.7s var(--tostao-curva), transform 0.9s var(--tostao-curva);
}

html.tostao-salto .tostao-pantalla.is-activa .tostao-aparece,
html.tostao-salto .tostao-pantalla.is-saliendo .tostao-aparece,
html.tostao-tactil .tostao-pantalla.is-activa .tostao-aparece,
html.tostao-tactil .tostao-pantalla.is-saliendo .tostao-aparece {
	opacity: 1;
	transform: none;
}

html.tostao-salto .tostao-pantalla.is-activa .tostao-aparece,
html.tostao-tactil .tostao-pantalla.is-activa .tostao-aparece {
	transition-delay: calc(0.45s + var(--i, 0) * 0.09s);
}

/* ---------- 2. Modo salto ---------- */

html.tostao-previo,
html.tostao-previo body,
html.tostao-salto,
html.tostao-salto body {
	overflow: hidden;
	overscroll-behavior: none;
	scroll-behavior: auto !important;
}

/*
 * Modo táctil (móvil, tableta, o ventana donde no caben las pantallas): se usa el
 * desplazamiento NATIVO del navegador y cada pantalla se "imanta" al soltar el
 * dedo (scroll-snap), con su inercia y suavidad de siempre. Si una pantalla es
 * más alta que la ventana, se puede recorrer entera antes de pasar a la siguiente.
 */
html.tostao-tactil {
	scroll-snap-type: y mandatory;
	overscroll-behavior-y: none;
	overflow-x: hidden;
	/* WordPress añade un margen de ajuste por su barra de administración; aquí las pantallas se imantan al borde de la ventana. */
	scroll-padding-top: 0 !important;
}

html.tostao-tactil .tostao-pantalla {
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

/*
 * El pie también es un punto de parada (por su borde inferior): si la última pantalla no cabe
 * junto al pie (móvil apaisado, letra grande…), el final de la página sigue siendo alcanzable.
 * Cuando todo cabe, coincide con el inicio de la última pantalla y no cambia nada.
 */
html.tostao-tactil footer.elementor-location-footer,
html.tostao-tactil #colophon {
	scroll-snap-align: end;
}

/* La última pantalla comparte altura con el pie: juntos llenan exactamente una ventana. */
html.tostao-tactil .e-con.tostao-pantalla.tostao-ultima {
	min-height: calc(100vh - var(--t-pie, 0px));
	min-height: calc(100dvh - var(--t-pie, 0px));
	padding-bottom: 1.5vh !important;
}

/* La cabecera se queda fija arriba y cada pantalla le deja sitio. */
html.tostao-previo header.elementor-location-header,
html.tostao-salto header.elementor-location-header,
html.tostao-tactil header.elementor-location-header {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	z-index: 9990;
	width: 100%;
}

html.tostao-previo .e-con.tostao-pantalla,
html.tostao-salto .e-con.tostao-pantalla,
html.tostao-tactil .e-con.tostao-pantalla {
	min-height: 100vh;
	min-height: 100dvh;
	padding-top: calc(var(--t-cab, 0px) + 1.5vh) !important;
}

/*
 * La última pantalla se muestra junto con el pie de página: al llegar al final
 * se ve desde "pie" píxeles hasta el borde de la ventana, así que el hueco del
 * pie se reserva ARRIBA (junto con el de la cabecera), no abajo.
 */
html.tostao-salto .e-con.tostao-pantalla.tostao-ultima {
	padding-top: calc(var(--t-cab, 0px) + var(--t-pie, 0px) + 1.5vh) !important;
	padding-bottom: 1.5vh !important;
}

html.tostao-sin-franja .tostao-franja {
	display: none !important;
}

/* Puntos de navegación a la derecha. */
.tostao-puntos {
	position: fixed;
	z-index: 9980;
	top: 50%;
	right: clamp(0.75rem, 2vw, 1.75rem);
	display: none;
	flex-direction: column;
	gap: 0;
	align-items: flex-end;
	transform: translateY(-50%);
	color: var(--tostao-burdeos);
	transition: color 0.5s ease;
	/* Solo los puntos reciben toques: el resto de la columna deja pasar el dedo al contenido de debajo. */
	pointer-events: none;
}

html.tostao-salto .tostao-puntos,
html.tostao-tactil .tostao-puntos {
	display: flex;
}

body[data-tostao-tema="oscuro"] .tostao-puntos {
	color: var(--tostao-amarillo);
}

body[data-tostao-tema="foto"] .tostao-puntos {
	color: var(--tostao-crema);
}

.tostao-puntos__item {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Zona táctil de unos 32 px alrededor de cada punto. */
	padding: 0.65rem 0.55rem;
	text-decoration: none;
	pointer-events: auto;
}

/* El estilo de enlaces de Elementor pinta los <a>; aquí manda el color de la pantalla. */
.tostao-puntos a.tostao-puntos__item,
.tostao-puntos a.tostao-puntos__item:hover,
.tostao-puntos a.tostao-puntos__item:focus,
.tostao-puntos a.tostao-puntos__item:visited {
	color: inherit;
	background: none;
}

.tostao-puntos__rotulo {
	font-family: var(--e-global-typography-text-font-family, "Montserrat", sans-serif);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	white-space: nowrap;
	/* El rótulo flota fuera del punto (no ocupa sitio ni recibe toques). */
	position: absolute;
	right: 100%;
	top: 50%;
	margin-right: 0.25rem;
	opacity: 0;
	transform: translate(0.5rem, -50%);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
}

.tostao-puntos__item:focus-visible .tostao-puntos__rotulo {
	opacity: 1;
	transform: translate(0, -50%);
}

/* El rótulo al pasar el ratón solo en pantallas con ratón (en el móvil el "hover" se quedaría pegado tras tocar). */
@media (hover: hover) {
	.tostao-puntos__item:hover .tostao-puntos__rotulo {
		opacity: 1;
		transform: translate(0, -50%);
	}
}

.tostao-puntos__marca {
	display: block;
	width: 0.7rem;
	height: 0.7rem;
	border: 2px solid currentColor;
	border-radius: 9999px;
	transition: background-color 0.3s ease, transform 0.3s ease;
}

.tostao-puntos__item[aria-current="true"] .tostao-puntos__marca {
	background-color: currentColor;
	transform: scale(1.3);
}

.tostao-puntos__item:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
	border-radius: 9999px;
}

@media (prefers-reduced-motion: reduce) {
	html.tostao-previo .tostao-pantalla .tostao-aparece,
	html.tostao-salto .tostao-pantalla .tostao-aparece,
	html.tostao-tactil .tostao-pantalla .tostao-aparece {
		opacity: 1;
		transform: none;
		transition: none !important;
	}

	.tostao-pantalla .tostao-mascota img {
		animation: none;
	}

	.e-con.tostao-tarjeta,
	.tostao-pantalla .elementor-button {
		transition: none;
	}
}
