/* ─── 1. VARIABLES: PALETA Y TIPOGRAFÍA ─────────────────────────────────────── */
:root {
	--color-bg:        #130d1e;
	--color-surface:   #1e1530;
	--color-gold:      #DBCA58;
	--color-gold-dim:  #a8993a;
	--color-text:      #f0f4ff;
	--color-text-dim:  #8ab0cc;
	--color-border:    #2e2248;
	--color-error:     #e07070;

	--font-display: 'Cinzel', serif;
	--font-body:    'Lato', sans-serif;

	--step-xs:   0.75rem;
	--step-sm:   0.875rem;
	--step-base: 1rem;
	--step-md:   1.25rem;
	--step-lg:   1.5rem;
	--step-xl:   2rem;
	--step-2xl:  2.5rem;
}

* {
	box-sizing: border-box;
}

/* ─── 2. CONTENEDOR PRINCIPAL Y FONDO ────────────────────────────────────────── */
.tarot-gratis {
	position: relative;
	width: 100vw;
	min-height: 100vh;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	background-color: var(--color-bg);
	overflow-x: hidden;
	font-family: var(--font-body);
	color: var(--color-text);
	line-height: 1.6;
}

.tarot-gratis::before {
	content: '';
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background-image: var(--fondo-url);
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	opacity: 0.7;
	z-index: 0;
	pointer-events: none;
}

.tarot-gratis > * {
	position: relative;
	z-index: 1;
}

/* ─── 3. OCULTAR HEADER DE WORDPRESS + CABECERA DE MARCA ─────────────────────── */
.tarot-gratis-page .entry-title,
.tarot-gratis-page h1.page-title,
.tarot-gratis-page .elementor-page-title {
	display: none !important;
}

.tarot-gratis-page header.site-header,
.tarot-gratis-page header.elementor-location-header {
	display: none !important;
}

.tarot-marca {
	position: absolute;
	top: 1rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 5;
	display: block;
	line-height: 0;
	opacity: 0.85;
	transition: opacity 0.2s ease;
}

.tarot-marca:hover {
	opacity: 1;
}

.tarot-marca img {
	height: 36px;
	width: auto;
	display: block;
}

@media (min-width: 768px) {
	.tarot-marca img {
		height: 48px;
	}
}

/* ─── 4. PANTALLAS FULL SCREEN ───────────────────────────────────────────────── */
/* min-height en vez de height fijo, con 100dvh como mejora progresiva: en
   mobile, 100vh no descuenta la barra del navegador y el contenido (sobre
   todo el botón de la pantalla 3) quedaba cortado sin forma de hacer scroll
   para alcanzarlo. overflow-y: auto es la red de seguridad para cuando,
   aun así, el contenido no entra en el alto real disponible. */
.tarot-pantalla[data-pantalla="1"],
.tarot-pantalla[data-pantalla="2"],
.tarot-pantalla[data-pantalla="3"],
.tarot-pantalla[data-pantalla="6"] {
	min-height: 100vh;
	min-height: 100dvh;
	overflow-y: auto;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	padding-top: 4rem;
}

.tarot-pantalla[data-pantalla="4"] {
	min-height: 100vh;
	height: auto;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 1rem;
	padding-top: 4rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
}

.tarot-pantalla[data-pantalla="5"] {
	min-height: 100vh;
	width: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	box-sizing: border-box;
	padding-top: 4rem;
}

.tarot-pantalla[data-pantalla="1"],
.tarot-pantalla[data-pantalla="6"] {
	text-align: center;
	padding: 2rem 1rem;
	padding-top: 4rem;
}

/* ─── TIPOGRAFÍA GENERAL ─────────────────────────────────────────────────────── */
.tarot-titulo {
	font-family: var(--font-display);
	font-size: var(--step-2xl);
	font-weight: 700;
	color: var(--color-gold);
	margin: 0 0 0.5rem 0;
}

.tarot-subtitulo {
	font-size: var(--step-md);
	color: var(--color-text-dim);
	margin: 0 0 2rem 0;
}

.tarot-label {
	font-size: var(--step-base);
	color: var(--color-text);
	margin-bottom: 0.5rem;
	display: block;
	text-align: left;
	width: 100%;
}

/* ─── PANTALLA 1: FORMULARIO ─────────────────────────────────────────────────── */
.tarot-contenido-centrado {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	max-width: 600px;
	width: 100%;
}

.tarot-form-consulta {
	width: 100%;
	max-width: 500px;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.tarot-textarea {
	width: 100%;
	padding: 1rem;
	font-family: var(--font-body);
	font-size: var(--step-base);
	color: var(--color-text);
	background-color: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	resize: none;
	outline: none;
}

.tarot-textarea:focus {
	border-color: var(--color-gold);
}

.tarot-textarea::placeholder {
	color: var(--color-text-dim);
}

/* ─── BOTONES ────────────────────────────────────────────────────────────────── */
.tarot-btn-principal {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--step-base);
	background-color: var(--color-gold);
	color: var(--color-bg);
	border: none;
	border-radius: 8px;
	padding: 0.875rem 2rem;
	cursor: pointer;
	transition: background-color 0.2s ease;
	letter-spacing: 0.5px;
}

.tarot-btn-principal:hover {
	background-color: var(--color-gold-dim);
}

.tarot-btn-principal:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.tarot-btn-whatsapp {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--step-sm);
	background-color: #25D366;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 0.75rem 1.25rem;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.tarot-btn-whatsapp:hover {
	background-color: #1da851;
	color: #fff;
	text-decoration: none;
}

/* ─── MENSAJES ───────────────────────────────────────────────────────────────── */
.tarot-error-msg {
	color: var(--color-error);
	font-size: var(--step-sm);
	margin-top: 1rem;
}

/* ─── PANTALLA 2: SPINNER ────────────────────────────────────────────────────── */
.tarot-spinner {
	width: 48px;
	height: 48px;
	border: 3px solid var(--color-border);
	border-top-color: var(--color-gold);
	border-radius: 50%;
	animation: tarot-spin 0.8s linear infinite;
	margin-bottom: 1.5rem;
}

@keyframes tarot-spin {
	to { transform: rotate(360deg); }
}

.tarot-spinner-texto {
	font-size: var(--step-md);
	color: var(--color-text-dim);
	font-style: italic;
}

/* ─── PANTALLA 3: INSTRUCCIÓN Y CONTADOR ─────────────────────────────────────── */
.tarot-instruccion {
	font-size: var(--step-base);
	color: var(--color-text);
	text-align: center;
	margin: 0;
	padding: 0.5rem 1rem;
	flex-shrink: 0;
}

.tarot-contador {
	font-size: var(--step-sm);
	color: var(--color-gold);
	text-align: center;
	margin: 0;
	padding: 0 1rem 0.5rem;
	flex-shrink: 0;
}

.tarot-pantalla[data-pantalla="3"] .tarot-btn-principal {
	flex-shrink: 0;
	margin-top: 30px;
}

/* ─── 5. MEDIDAS DE LAS CARTAS — REGLA GENERAL ───────────────────────────────── */
.tarot-carta img,
.tarot-carta-dorso img,
.tarot-carta-mesa img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.tarot-carta,
.tarot-carta-dorso,
.tarot-carta-mesa {
	aspect-ratio: 562 / 1060;
	overflow: visible;
}

/* ─── 6. ABANICO DE CARTAS (PANTALLA 3) ──────────────────────────────────────── */
.tarot-abanico {
	display: flex;
	flex-direction: row;
	justify-content: center;
	gap: 8px;
	width: 100%;
	max-width: 480px;
	overflow: visible;
	padding: 0 1rem;
	box-sizing: border-box;
}

.tarot-abanico-columna {
	display: flex;
	flex-direction: column;
	flex: 1;
	overflow: visible;
}

.tarot-carta-dorso {
	flex: 0 0 auto;
	width: 100%;
	/* Encimar dejando 28px visibles del borde superior — área táctil mínima */
	margin-bottom: calc(-1 * (100% * 1060 / 562) + 28px);
	position: relative;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	z-index: 1;
}

.tarot-carta-dorso:last-child {
	margin-bottom: 0;
}

.tarot-carta-dorso:hover,
.tarot-carta-dorso.seleccionada {
	transform: translateY(-12px);
	box-shadow: 0 0 14px 4px var(--color-gold);
	z-index: 10;
}

/* ─── 7. MESA DE CARTAS (PANTALLA 4) Y MESA-RESUMEN (PANTALLA 5) ─────────────── */
.tarot-mesa {
	position: relative;
	width: 90%;
	max-width: 700px;
	height: 0; /* la altura la define el padding-bottom de cada tirada */
	overflow: visible;
}

.tarot-carta-mesa {
	position: absolute;
	transform-origin: center;
}

.tarot-carta-mesa-inner {
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	-webkit-transform-style: preserve-3d;
	transition: transform 0.6s ease;
}

.tarot-carta-mesa-inner.volteada {
	transform: rotateY(180deg);
}

.tarot-carta-mesa-front,
.tarot-carta-mesa-back {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	overflow: visible;
}

.tarot-carta-mesa-front {
	transform: rotateY(180deg);
}

.tarot-carta-invertida .tarot-carta-mesa-front img {
	transform: rotate(180deg);
}

.tarot-carta-mesa-label {
	position: absolute;
	bottom: -22px;
	left: 0;
	right: 0;
	text-align: center;
	font-size: var(--step-xs);
	color: var(--color-text-dim);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}

@media (min-width: 480px) {
	.tarot-carta-mesa-label {
		font-size: var(--step-sm);
		bottom: -24px;
	}
}

@media (min-width: 768px) {
	.tarot-carta-mesa-label {
		bottom: -26px;
	}
}

.tarot-mesa-resumen {
	margin: 0 auto 1.5rem;
	max-width: 420px;
	pointer-events: none;
}

/* ─── PANTALLA 5: LECTURA ────────────────────────────────────────────────────── */
.tarot-lectura-contenedor {
	max-width: 700px;
	width: 100%;
	margin: 0 auto;
	padding: 2rem 1.5rem 3rem;
	box-sizing: border-box;
}

.tarot-lectura-texto {
	font-size: var(--step-base);
	line-height: 1.8;
	color: var(--color-text);
}

.tarot-lectura-texto p {
	margin: 0 0 1rem 0;
}

.tarot-lectura-texto strong {
	color: var(--color-gold);
}

.tarot-prof-respuestas {
	margin-top: 1.5rem;
}

.tarot-prof-item {
	border-top: 1px solid var(--color-border);
	padding-top: 1.5rem;
	margin-top: 1.5rem;
}

.tarot-prof-pregunta-texto {
	font-size: var(--step-sm);
	color: var(--color-gold-dim);
	font-style: italic;
	margin: 0 0 0.75rem 0;
}

.tarot-prof-respuesta-texto {
	font-size: var(--step-base);
	line-height: 1.8;
	color: var(--color-text);
}

.tarot-prof-respuesta-texto p {
	margin: 0 0 1rem 0;
}

.tarot-prof-respuesta-texto strong {
	color: var(--color-gold);
}

.tarot-consultoras-titulo {
	font-family: var(--font-display);
	font-size: var(--step-md);
	color: var(--color-gold);
	text-align: center;
	margin: 2rem 0 1rem;
}

.tarot-profundizar {
	margin-top: 2rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

#tarot-btn-finalizar {
	margin-top: 2rem;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

/* ─── PANTALLA 6: CIERRE ─────────────────────────────────────────────────────── */
.tarot-titulo-cierre {
	font-family: var(--font-display);
	font-size: var(--step-xl);
	font-weight: 700;
	color: var(--color-gold);
	margin: 0 0 1.5rem 0;
}

.tarot-texto-cierre {
	font-size: var(--step-md);
	color: var(--color-text-dim);
	margin: 0 0 2rem 0;
	max-width: 500px;
	line-height: 1.6;
}

/* ─── 8. CONSULTORAS ─────────────────────────────────────────────────────────── */
.tarot-gratis-consultoras {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	width: 100%;
	max-width: 400px;
	margin: 0 auto;
}

.tarot-gratis-consultora {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.consultora-foto {
	width: 70px;
	height: 70px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--color-gold);
	flex-shrink: 0;
}

.consultora-info {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.consultora-nombre {
	font-family: var(--font-display);
	font-size: var(--step-base);
	color: var(--color-text);
	font-weight: 700;
}

/* Versión compacta dentro de la pantalla 5 */
.tarot-gratis-consultoras--compacto {
	gap: 0.75rem;
	margin: 0 auto;
	padding: 1.25rem 1rem;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	background: var(--color-surface);
}

.tarot-gratis-consultoras--compacto .consultora-foto {
	width: 48px;
	height: 48px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
	.tarot-titulo {
		font-size: var(--step-lg);
	}

	.tarot-subtitulo {
		font-size: var(--step-base);
	}

	.tarot-btn-principal {
		font-size: var(--step-sm);
		padding: 0.75rem 1.5rem;
	}

	.tarot-titulo-cierre {
		font-size: var(--step-lg);
	}

	.tarot-texto-cierre {
		font-size: var(--step-base);
	}

	.tarot-lectura-contenedor {
		padding: 1.5rem 1rem 2rem;
	}

	.tarot-mesa {
		width: 95%;
	}
}

@media (min-width: 768px) {
	.tarot-lectura-contenedor {
		padding: 3rem 2rem;
	}
}

/* ─── ESTADO DE CARGA ────────────────────────────────────────────────────────── */
.tarot-loading {
	opacity: 0.6;
	pointer-events: none;
}
