@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lato:wght@400;700&display=swap');

/* ─── VARIABLES ──────────────────────────────────────────────────────────────── */
:root {
	--color-bg:       #130d1e;
	--color-surface:  #1e1530;
	--color-gold:     #DBCA58;
	--color-gold-dim: #a8993a;
	--color-text:     #e8f0ff;
	--color-text-dim: #9b91b0;
	--color-border:   #2e2248;
	--color-error:    #e07070;
}

/* ─── OCULTAR HEADER Y TÍTULO DE WORDPRESS ──────────────────────────────────── */
.tarot-elena-page .entry-title,
.tarot-elena-page h1.page-title,
.tarot-elena-page .elementor-page-title {
	display: none !important;
}

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

/* ─── CONTENEDOR PRINCIPAL ───────────────────────────────────────────────────── */
.tarot-elena {
	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: 'Lato', sans-serif;
	color: var(--color-text);
	line-height: 1.6;
}

/* Fondo via ::before para que el contenido no herede la opacidad */
.tarot-elena::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-elena > * {
	position: relative;
	z-index: 1;
}

/* ─── PANTALLAS ──────────────────────────────────────────────────────────────── */

/* Pantallas 1, 2, 3, 4 y 6: full screen sin scroll */
.tarot-pantalla[data-pantalla="1"],
.tarot-pantalla[data-pantalla="2"],
.tarot-pantalla[data-pantalla="3"],
.tarot-pantalla[data-pantalla="6"] {
	height: 100vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

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

/* Pantalla 5: única con scroll */
.tarot-pantalla[data-pantalla="5"] {
	min-height: 100vh;
	width: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	box-sizing: border-box;
}

/* Pantallas 1 y 6: padding y centrado */
.tarot-pantalla[data-pantalla="1"],
.tarot-pantalla[data-pantalla="6"] {
	text-align: center;
	padding: 2rem;
}

/* ─── TIPOGRAFÍA ─────────────────────────────────────────────────────────────── */
.tarot-titulo {
	font-family: 'Cinzel', serif;
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--color-gold);
	margin: 0 0 0.5rem 0;
}

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

.tarot-label {
	font-size: 1rem;
	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: 'Lato', sans-serif;
	font-size: 1rem;
	color: var(--color-text);
	background-color: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	resize: none;
	outline: none;
	box-sizing: border-box;
}

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

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

/* ─── BOTONES ────────────────────────────────────────────────────────────────── */
.tarot-btn-principal {
	font-family: 'Cinzel', serif;
	font-weight: 700;
	font-size: 1rem;
	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: 'Cinzel', serif;
	font-weight: 700;
	font-size: 1rem;
	background-color: #25D366;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 0.875rem 2rem;
	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-limite-msg {
	color: var(--color-gold-dim);
	font-size: 1rem;
	margin-top: 1.5rem;
	max-width: 500px;
	line-height: 1.5;
}

.tarot-error-msg {
	color: var(--color-error);
	font-size: 0.875rem;
	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: 1.25rem;
	color: var(--color-text-dim);
	font-style: italic;
}

/* ─── PANTALLA 3: ABANICO ────────────────────────────────────────────────────── */
.tarot-instruccion {
	font-size: 1rem;
	color: var(--color-text);
	text-align: center;
	margin: 0;
	padding: 0.5rem 1rem;
	flex-shrink: 0;
}

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

.tarot-abanico {
	display: flex;
	flex-direction: row;
	justify-content: center;
	gap: 8px;
	width: 100%;
	max-width: 380px;
	overflow: visible;
	padding: 0 0.5rem;
	flex: 1;
	min-height: 0;
	box-sizing: border-box;
}

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

.tarot-carta-dorso {
	flex: 0 0 auto;
	width: 100%;
	aspect-ratio: 562 / 1060;
	/* Encimar cartas dejando solo ~15px visibles del borde superior */
	margin-bottom: calc(-1 * (100% * 1060 / 562) + 15px);
	overflow: visible;
	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;
}

.tarot-carta-dorso img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 4px;
	display: block;
}

/* Botón confirmar en pantalla 3 */
.tarot-pantalla[data-pantalla="3"] .tarot-btn-principal {
	flex-shrink: 0;
	margin-top: 0.5rem;
}

/* ─── PANTALLA 4: MESA ───────────────────────────────────────────────────────── */
/*
 * SISTEMA DE COORDENADAS PORCENTUALES (del CLAUDE.md):
 * - .tarot-mesa usa padding-bottom en % para definir la altura proporcional
 * - Cada .tarot-carta-mesa usa left/top en % del contenedor
 * - width en % del contenedor según número de cartas
 * - Funciona igual en desktop y mobile — solo cambia el tamaño del contenedor
 */

.tarot-mesa {
	position: relative;
	width: 90%;
	max-width: 700px;
	/* height:0 + padding-bottom definen la altura proporcional */
	height: 0;
	overflow: visible;
}

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

/* Estructura flip 3D */
.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;
	width: 100%;
	height: 100%;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	border-radius: 4px;
	overflow: hidden;
}

/* El frente empieza oculto (rotado) y se muestra al voltear */
.tarot-carta-mesa-front {
	transform: rotateY(180deg);
}

.tarot-carta-mesa-front img,
.tarot-carta-mesa-back img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

/* Carta invertida: imagen del frente rotada 180° */
.tarot-carta-invertida .tarot-carta-mesa-front img {
	transform: rotate(180deg);
}

/* Cruz Celta: carta 2 rotada 90° sobre carta 1 */
.tarot-carta-rotada .tarot-carta-mesa-inner {
	transform: rotate(90deg);
}

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

/* Label de posición debajo de cada carta */
.tarot-carta-mesa-label {
	position: absolute;
	bottom: -22px;
	left: 0;
	right: 0;
	text-align: center;
	font-size: 0.6rem;
	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: 0.7rem;
		bottom: -24px;
	}
}

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

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

#tarot-lectura-texto,
.tarot-lectura-texto {
	font-size: 1rem;
	line-height: 1.8;
	color: var(--color-text);
}

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

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

/* Profundizaciones */
.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: 0.875rem;
	color: var(--color-gold-dim);
	font-style: italic;
	margin: 0 0 0.75rem 0;
}

.tarot-prof-respuesta-texto {
	font-size: 1rem;
	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-profundizar {
	margin-top: 2rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

#tarot-btn-finalizar {
	margin-top: 2rem;
	align-self: center;
}

/* ─── PANTALLA 6: CIERRE ─────────────────────────────────────────────────────── */
.tarot-titulo-cierre {
	font-family: 'Cinzel', serif;
	font-size: 2rem;
	font-weight: 700;
	color: var(--color-gold);
	margin: 0 0 1.5rem 0;
}

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

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

	.tarot-subtitulo {
		font-size: 1rem;
	}

	.tarot-btn-principal {
		font-size: 0.875rem;
		padding: 0.75rem 1.5rem;
	}

	.tarot-titulo-cierre {
		font-size: 1.5rem;
	}

	.tarot-texto-cierre {
		font-size: 1rem;
	}

	/* Pantalla 5: padding lateral en mobile */
	.tarot-lectura-contenedor {
		padding: 1.5rem 1rem;
	}

	/* Mesa en mobile: contenedor más angosto pero mismas proporciones */
	.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;
}
