/*
 * Tienda Child - animaciones.
 * Todas son sutiles y se desactivan si el sistema pide reducir el movimiento.
 */

/* ---------- Aparición al hacer scroll (la clase la pone animaciones.js) ---------- */
.tc-reveal {
	opacity: 0;
	transform: translateY(26px);
	transition: opacity 0.6s ease var(--tc-delay, 0ms), transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) var(--tc-delay, 0ms) !important;
}
.tc-reveal.tc-visible {
	opacity: 1;
	transform: none;
}

/* ---------- Banner: entrada del texto en cada diapositiva ---------- */
@keyframes tc-subir {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
.th-banner.is-activo .th-banner__titulo {
	animation: tc-subir 0.7s 0.05s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.th-banner.is-activo .th-banner__sub {
	animation: tc-subir 0.7s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.th-banner.is-activo .th-btn {
	animation: tc-subir 0.7s 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

/* ---------- Cabecera: sombra al bajar ---------- */
.tc-header {
	transition: box-shadow 0.25s ease;
}
.tc-header.is-scrolled {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
}

/* ---------- Mega-menú ---------- */
@keyframes tc-mega-entra {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
.tc-nav__item:hover > .tc-mega,
.tc-nav__item:focus-within > .tc-mega {
	animation: tc-mega-entra 0.2s ease-out;
}

/* ---------- Tarjetas: zoom suave de la foto ---------- */
.woocommerce ul.products li.product {
	overflow: hidden;
}
.woocommerce ul.products li.product img {
	transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.woocommerce ul.products li.product:hover img {
	transform: scale(1.05);
}
.th-categoria__imagen {
	overflow: hidden;
}
.th-categoria__imagen img {
	transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.th-categoria:hover .th-categoria__imagen img {
	transform: scale(1.05);
}
.th-categoria__flecha svg {
	transition: transform 0.2s ease;
}
.th-categoria:hover .th-categoria__flecha svg {
	transform: translateX(2px);
}

/* ---------- Botones: respuesta al pulsar ---------- */
.th-btn:active,
.tienda-comprar-ahora:active,
.single_add_to_cart_button:active,
.tienda-opcion:active {
	transform: scale(0.97);
}
.tienda-opcion {
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

/* ---------- Contador del carrito: rebote al actualizarse ---------- */
@keyframes tc-rebote {
	0% {
		transform: scale(0.4);
	}
	60% {
		transform: scale(1.25);
	}
	100% {
		transform: scale(1);
	}
}
.tc-cart-count:not(.is-vacio) {
	animation: tc-rebote 0.4s ease-out;
}

/* ---------- Ventana del producto destacado ---------- */
@keyframes tc-modal-entra {
	from {
		opacity: 0;
		transform: translateY(18px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
@keyframes tc-fundido {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
.th-modal[open] {
	animation: tc-modal-entra 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.th-modal[open]::backdrop {
	animation: tc-fundido 0.3s ease-out;
}

/* ---------- Reducir movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
	.tc-reveal,
	.tc-reveal.tc-visible {
		opacity: 1;
		transform: none;
		transition: none !important;
	}
	.th-banner.is-activo .th-banner__titulo,
	.th-banner.is-activo .th-banner__sub,
	.th-banner.is-activo .th-btn,
	.tc-nav__item:hover > .tc-mega,
	.tc-nav__item:focus-within > .tc-mega,
	.tc-cart-count:not(.is-vacio),
	.th-modal[open],
	.th-modal[open]::backdrop {
		animation: none;
	}
	.woocommerce ul.products li.product:hover img,
	.th-categoria:hover .th-categoria__imagen img {
		transform: none;
	}
}
