/*
 * Patagonia Spa – Animaciones
 *
 * Efectos sutiles, lentos y sin rebote: aparición al hacer scroll, encabezado con desenfoque,
 * subrayado dorado, elevación al pasar el mouse, zoom lento en fotos, línea de los pasos,
 * anillo del WhatsApp y transición al cambiar de modo.
 * La aparición solo se activa si el script agregó .ps-anim a <html>: sin JavaScript, en el editor
 * de Bricks o con «reducir movimiento», todo se ve de inmediato.
 */

:root {
	--ps-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--ps-ease-lenta: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Anclas: desplazamiento suave descontando el encabezado */
html {
	scroll-behavior: smooth;
	scroll-padding-top: 96px;
}

/* 1 · Aparición al hacer scroll (el script marca los elementos con data-ps-reveal) */
.ps-anim [data-ps-reveal] {
	opacity: 0;
	transform: translate3d(0, 16px, 0);
	transition: opacity 0.8s var(--ps-ease), transform 0.9s var(--ps-ease);
	transition-delay: var(--ps-delay, 0ms);
}
.ps-anim [data-ps-reveal="zoom"] {
	transform: scale(0.97);
}
.ps-anim [data-ps-reveal].is-visible {
	opacity: 1;
	transform: none;
}

/* 2 · Encabezado: al bajar, fondo translúcido con desenfoque y sombra tenue */
.ps-header {
	transition: background-color 0.4s var(--ps-ease), box-shadow 0.4s var(--ps-ease);
}
html.ps-scrolled .ps-header {
	background-color: rgba(255, 255, 255, 0.86);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	box-shadow: 0 8px 28px rgba(30, 27, 25, 0.08);
}
html.ps-scrolled:is([data-modo=noche], [data-modo=mixto]) .ps-header {
	background-color: rgba(30, 27, 25, 0.86);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* 3 · Menú: sin cortes de línea y subrayado dorado que se dibuja de izquierda a derecha */
.ps-header .bricks-nav-menu > li > a {
	position: relative;
	white-space: nowrap;
}
.ps-header .bricks-nav-menu > li > a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -4px;
	height: 1px;
	background: var(--ps-oro);
	transform: scaleX(0);
	transform-origin: right center;
	transition: transform 0.5s var(--ps-ease);
}
.ps-header .bricks-nav-menu > li > a:hover::after,
.ps-header .bricks-nav-menu > li > a:focus-visible::after {
	transform: scaleX(1);
	transform-origin: left center;
}
.ps-link {
	text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
	text-underline-offset: 0.3em;
	transition: text-decoration-color 0.4s var(--ps-ease), color 0.4s var(--ps-ease);
}
.ps-link:hover {
	text-decoration-color: var(--ps-oro);
}

/* 4 · Elevación: botones, tarjetas y filas de Enlaces */
.ps-btn {
	transition: background-color 0.4s var(--ps-ease), color 0.4s var(--ps-ease), border-color 0.4s var(--ps-ease), transform 0.5s var(--ps-ease), box-shadow 0.5s var(--ps-ease);
}
.ps-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(30, 27, 25, 0.12);
}
.ps-btn:active {
	transform: translateY(0);
}
.ps-btn :is(i, svg) {
	transition: transform 0.5s var(--ps-ease);
}
.ps-btn:hover :is(i, svg) {
	transform: translateX(3px);
}
.ps-card {
	transition: transform 0.6s var(--ps-ease), box-shadow 0.6s var(--ps-ease), border-color 0.6s var(--ps-ease);
}
.ps-card:hover {
	transform: translateY(-3px);
}

/* 5 · Fotos: zoom muy lento al pasar el mouse */
.ps-media img {
	transition: transform 1.2s var(--ps-ease-lenta);
}
:is(.ps-card, .ps-media):hover .ps-media img,
.ps-media:hover img {
	transform: scale(1.03);
}

/* 6 · Cómo trabajamos: la línea dorada de cada paso se completa al aparecer */
.ps-anim .ps-step {
	position: relative;
	border-top-color: transparent !important;
}
.ps-anim .ps-step::before {
	content: "";
	position: absolute;
	top: -1px;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--ps-oro);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 1.2s var(--ps-ease) calc(var(--ps-delay, 0ms) + 200ms);
}
.ps-anim .ps-step.is-visible::before,
.ps-anim .ps-step:not([data-ps-reveal])::before {
	transform: scaleX(1);
}

/* 7 · WhatsApp flotante: un anillo dorado que se expande una vez cada ~8 s */
.ps-whatsapp::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 1px solid var(--ps-oro);
	opacity: 0;
	pointer-events: none;
	animation: ps-anillo 8s var(--ps-ease) 3s infinite;
}
.ps-whatsapp {
	transition: transform 0.5s var(--ps-ease), box-shadow 0.5s var(--ps-ease);
}
.ps-whatsapp:hover {
	transform: translateY(-2px);
}
@keyframes ps-anillo {
	0% { transform: scale(1); opacity: 0.7; }
	18% { transform: scale(1.55); opacity: 0; }
	100% { transform: scale(1.55); opacity: 0; }
}

/* 8 · Cambio de modo: transición de color en vez de un salto */
html.ps-modo-cambio,
html.ps-modo-cambio *,
html.ps-modo-cambio *::before,
html.ps-modo-cambio *::after {
	transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease, fill 0.45s ease !important;
}

/* Movimiento reducido: nada se mueve */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	.ps-whatsapp::after {
		animation: none;
	}
	.ps-btn:hover,
	.ps-card:hover,
	.ps-whatsapp:hover,
	.ps-btn:hover :is(i, svg) {
		transform: none;
	}
	:is(.ps-card, .ps-media):hover .ps-media img,
	.ps-media:hover img {
		transform: none;
	}
}
