/* ============================================================
   Botón flotante de WhatsApp
   Solo el botón y su animación, tomados del sitio de SastrerIA.
   ============================================================ */

.sas-wa,
.sas-wa *,
.sas-wa *::before,
.sas-wa *::after,
.sas-sticky,
.sas-sticky *,
.sas-sticky *::before,
.sas-sticky *::after {
	box-sizing: border-box;
}

.sas-wa {
	position: fixed;
	right: clamp(1rem, 2.5vw, 1.75rem);
	bottom: clamp(1rem, 2.5vw, 1.75rem);
	z-index: 96;
	display: grid;
	place-items: center;
	width: 3.625rem;
	height: 3.625rem;
	background: #25d366;
	color: #ffffff;
	border-radius: 50%;
	box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
	animation: sas-wa-pulse 2.5s ease-in-out infinite;
	transition: transform 160ms cubic-bezier(0.2, 0, 0, 1), box-shadow 160ms cubic-bezier(0.2, 0, 0, 1);
	text-decoration: none;
}

.sas-wa svg {
	position: relative;
	z-index: 1;
	width: 1.75rem;
	height: 1.75rem;
}

.sas-wa:hover {
	transform: scale(1.1);
	box-shadow: 0 8px 32px rgba(37, 211, 102, 0.55);
	color: #ffffff;
}

.sas-wa:focus-visible {
	outline: 3px solid rgba(10, 18, 32, 0.85);
	outline-offset: 4px;
}

.sas-wa__ring {
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid #25d366;
	animation: sas-wa-ring 2s ease-out infinite;
	pointer-events: none;
}

.sas-wa__tooltip {
	position: absolute;
	right: calc(100% + 0.75rem);
	top: 50%;
	padding: 0.5rem 0.7rem;
	border-radius: 8px;
	background: #0a1220;
	color: #ffffff;
	font: 500 0.8rem/1 "Inter", "Segoe UI", system-ui, sans-serif;
	white-space: nowrap;
	opacity: 0;
	transform: translateY(-50%) translateX(0.25rem);
	transition: opacity 160ms ease, transform 160ms ease;
	pointer-events: none;
}

.sas-wa:hover .sas-wa__tooltip,
.sas-wa:focus-visible .sas-wa__tooltip {
	opacity: 1;
	transform: translateY(-50%) translateX(0);
}

@keyframes sas-wa-ring {
	0% {
		transform: scale(1);
		opacity: 0.7;
	}
	100% {
		transform: scale(1.6);
		opacity: 0;
	}
}

@keyframes sas-wa-pulse {
	0%,
	100% {
		transform: scale(1);
	}
	10% {
		transform: scale(1.08);
	}
	20% {
		transform: scale(1);
	}
}

@media (max-width: 860px) {
	body.sas-sticky-on .sas-wa {
		bottom: calc(clamp(1rem, 2.5vw, 1.75rem) + 4.6rem);
	}
}

/* Astra: el botón "volver arriba" no debe chocar con WhatsApp. */
#ast-scroll-top {
	bottom: calc(clamp(1rem, 2.5vw, 1.75rem) + 4.4rem) !important;
}

/* En la landing estorba: ya hay navegación y barra de compra. */
body.sas-landing-page #ast-scroll-top {
	display: none !important;
}

@media (max-width: 600px) {
	.sas-wa__tooltip {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sas-wa,
	.sas-wa__ring {
		animation: none !important;
	}
	.sas-wa:hover {
		transform: none;
	}
}
