/* Test Tuyo Tienda — frontend
 * Las reglas se scopean bajo .ttt-quiz y los colores/bordes de los botones usan
 * !important para resistir los estilos de enlace/botón del tema (WoodMart, etc.).
 */

.ttt-quiz {
	/* Por defecto toma los colores/tipografías del tema (WoodMart); con fallback. */
	--ttt-primario: var(--wd-primary-color, #2F4A55);
	--ttt-acento: var(--wd-alternative-color, #B08A4F);
	--ttt-fondo: #ffffff;
	--ttt-texto: var(--wd-text-color, #1C1C1A);
	--ttt-radio: 8px;
	--ttt-borde: rgba(28, 28, 26, .14);
	--ttt-titulo-font: var(--wd-title-font, "Cormorant Garamond", Georgia, serif);

	max-width: 760px;
	margin: 0 auto;
	font-family: inherit;
	color: var(--ttt-texto);
	line-height: 1.5;
	text-align: center;
}

.ttt-quiz * {
	box-sizing: border-box;
}

/* --- Paneles / transición --- */
.ttt-quiz .ttt-panel {
	display: none;
}
.ttt-quiz .ttt-panel.is-active {
	display: block;
	animation: ttt-fade .5s ease both;
}
@keyframes ttt-fade {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.ttt-quiz .ttt-panel.is-active { animation: none; }
}

/* --- Títulos --- */
.ttt-quiz .ttt-intro-titulo,
.ttt-quiz .ttt-pregunta-titulo,
.ttt-quiz .ttt-resultado-mensaje {
	font-family: var(--ttt-titulo-font);
	font-weight: 600;
	line-height: 1.15;
	margin: 0 0 .5em;
	color: var(--ttt-primario);
}
.ttt-quiz .ttt-intro-titulo { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.ttt-quiz .ttt-pregunta-titulo { font-size: clamp(1.4rem, 3vw, 2rem); }

.ttt-quiz .ttt-intro-texto {
	margin: 0 auto 1.6em;
	max-width: 48ch;
	opacity: .85;
}

/* --- Intro --- */
.ttt-quiz .ttt-intro {
	padding: 24px 8px;
}

/* --- Botón principal (CTA / iniciar) --- */
.ttt-quiz .ttt-btn {
	display: inline-block;
	margin: 0;
	border: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	background: var(--ttt-primario) !important;
	color: #fff !important;
	font: inherit;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase !important;
	text-decoration: none !important;
	line-height: 1.2;
	padding: 14px 34px !important;
	border-radius: var(--ttt-radio) !important;
	width: auto;
	transition: background-color .25s ease, transform .15s ease;
}
.ttt-quiz .ttt-btn:hover,
.ttt-quiz .ttt-btn:focus-visible {
	background: var(--ttt-acento) !important;
	color: #fff !important;
}

/* --- Barra de progreso --- */
.ttt-quiz .ttt-progress {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 4px 0 22px;
}
.ttt-quiz .ttt-progress-bar {
	flex: 1 1 auto;
	height: 3px;
	background: var(--ttt-borde);
	border-radius: 3px;
	overflow: hidden;
}
.ttt-quiz .ttt-progress-bar span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--ttt-acento);
	transition: width .4s ease;
}
.ttt-quiz .ttt-progress-text {
	flex: 0 0 auto;
	font-size: .8rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	opacity: .7;
}

/* --- Pregunta --- */
.ttt-quiz .ttt-pregunta {
	padding: 8px 0 4px;
}
.ttt-quiz .ttt-pregunta-img {
	margin: 0 auto 18px;
	max-width: 420px;
}
.ttt-quiz .ttt-pregunta-img img {
	width: 100%;
	height: auto;
	border-radius: var(--ttt-radio);
	display: block;
}

/* --- Opciones --- */
.ttt-quiz .ttt-opciones {
	display: grid;
	gap: 12px;
	margin: 18px 0 6px;
}
.ttt-quiz .ttt-opciones--lista {
	grid-template-columns: 1fr;
	max-width: 520px;
	margin-left: auto;
	margin-right: auto;
}
.ttt-quiz .ttt-opciones--grid {
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.ttt-quiz .ttt-opcion {
	margin: 0;
	cursor: pointer;
	font: inherit;
	text-transform: none !important;
	color: var(--ttt-texto) !important;
	background: var(--ttt-fondo) !important;
	border: 1px solid var(--ttt-borde) !important;
	border-radius: var(--ttt-radio) !important;
	box-shadow: none;
	padding: 0;
	transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease, background-color .2s ease, color .2s ease;
}
.ttt-quiz .ttt-opcion:hover,
.ttt-quiz .ttt-opcion:focus-visible {
	border-color: var(--ttt-acento) !important;
	box-shadow: 0 6px 22px rgba(28, 28, 26, .10);
	transform: translateY(-2px);
}
.ttt-quiz .ttt-opcion.is-selected {
	border-color: var(--ttt-primario) !important;
	box-shadow: 0 0 0 2px var(--ttt-primario) inset;
}

/* Opción de texto */
.ttt-quiz .ttt-opcion--texto {
	padding: 15px 20px;
	font-size: 1rem;
}
.ttt-quiz .ttt-opciones--lista .ttt-opcion--texto:hover,
.ttt-quiz .ttt-opciones--lista .ttt-opcion--texto:focus-visible {
	background: var(--ttt-primario) !important;
	color: #fff !important;
}

/* Opción con foto */
.ttt-quiz .ttt-opcion--foto {
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.ttt-quiz .ttt-opcion-img {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}
.ttt-quiz .ttt-opcion-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}
.ttt-quiz .ttt-opcion--foto:hover .ttt-opcion-img img {
	transform: scale(1.05);
}
.ttt-quiz .ttt-opcion--foto .ttt-opcion-label {
	display: block;
	padding: 12px 14px;
	font-size: .95rem;
}

/* --- Botones-enlace sutiles (anterior / volver a empezar) --- */
.ttt-quiz .ttt-back,
.ttt-quiz .ttt-reiniciar {
	margin: 18px auto 0;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	font: inherit;
	font-size: .85rem;
	letter-spacing: .03em;
	text-transform: none !important;
	color: var(--ttt-texto) !important;
	width: auto;
	padding: 0 !important;
	opacity: .6;
	transition: opacity .2s ease;
}
.ttt-quiz .ttt-back { display: inline-block; }
.ttt-quiz .ttt-reiniciar { display: block; text-decoration: underline; }
.ttt-quiz .ttt-back:hover,
.ttt-quiz .ttt-reiniciar:hover { opacity: 1; }

/* --- Resultado --- */
.ttt-quiz .ttt-resultado {
	padding: 16px 8px 24px;
}
.ttt-quiz .ttt-resultado-img {
	margin: 0 auto 22px;
	max-width: 360px;
}
.ttt-quiz .ttt-resultado-img img {
	width: 100%;
	height: auto;
	border-radius: var(--ttt-radio);
	display: block;
}
.ttt-quiz .ttt-resultado-mensaje {
	font-size: clamp(1.7rem, 4vw, 2.5rem);
}
.ttt-quiz .ttt-resultado-desc {
	margin: 0 auto 1.6em;
	max-width: 52ch;
	opacity: .85;
}
.ttt-quiz .ttt-resultado-cta {
	margin-bottom: 10px;
}

.ttt-quiz [hidden] { display: none !important; }
