/* -------------------------------------------------------
   Botón flotante de WhatsApp
   Colores por variables CSS desde template.php:
     --wa-bg     -> color de fondo del botón
     --wa-pulse  -> color de los círculos que "respiran"
------------------------------------------------------- */

/* Contenedor fijo: da la posición pero NO escala en hover */
.wa-float {
	position: fixed;
	right: 25px;
	bottom: 25px;
	width: 60px;
	height: 60px;
	z-index: 9999;
}

/* El círculo (enlace): este es el que crece un poco en hover */
.wa-float__btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background-color: var(--wa-bg, #2a2e31);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.3s ease;
	-webkit-tap-highlight-color: transparent;
}

.wa-float__btn:hover {
	transform: scale(1.12);
}

/* Ícono un poco más grande (el botón se mantiene igual) */
.wa-float__icon {
	position: relative;
	z-index: 2;
	width: 74%;
	height: 74%;
	object-fit: contain;
}

/* Los 3 círculos del pulso */
.wa-float__pulse {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background-color: var(--wa-pulse, rgba(92, 98, 104, 0.6));
	z-index: 1;
	opacity: 0; /* Invisible hasta que arranca su turno (evita parpadeo al cargar) */
	animation: wa-breathe 6s ease-out infinite;
}

.wa-float__pulse:nth-child(2) { animation-delay: 0.5s; }
.wa-float__pulse:nth-child(3) { animation-delay: 1s; }

/*
   Ciclo de 6s: la expansión ocurre solo en el primer ~40% (2.4s).
   El resto del tiempo quedan invisibles -> ese es el "respiro".
*/
@keyframes wa-breathe {
	0%   { transform: scale(1);   opacity: 1; }
	40%  { transform: scale(2.2); opacity: 0; }
	100% { transform: scale(2.2); opacity: 0; }
}

/* -------------------------------------------------------
   Tooltip de ayuda (aparece a la izquierda en hover)
------------------------------------------------------- */
.wa-float__tip {
	position: absolute;
	right: 100%;                 /* A la izquierda del botón */
	top: 50%;
	margin-right: 14px;          /* Separación respecto al botón */
	padding: 8px 12px;
	background-color: var(--wa-bg, #2a2e31);
	color: #fff;
	font-size: 14px;
	line-height: 1;
	white-space: nowrap;
	border-radius: 8px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	pointer-events: none;        /* No interfiere con el clic */

	/* Estado oculto + animación de entrada (fade in con leve deslizamiento) */
	opacity: 0;
	visibility: hidden;
	transform: translateY(-50%) translateX(8px);
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

/* Pequeña flecha apuntando al botón */
.wa-float__tip::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 100%;
	transform: translateY(-50%);
	border: 6px solid transparent;
	border-left-color: var(--wa-bg, #2a2e31);
}

/* Al pasar el mouse por el botón, se muestra el tooltip */
.wa-float__btn:hover ~ .wa-float__tip,
.wa-float:hover .wa-float__tip {
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%) translateX(0);
}

/* Ajuste para móviles */
@media (max-width: 480px) {
	.wa-float {
		width: 54px;
		height: 54px;
		right: 18px;
		bottom: 18px;
	}
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
	.wa-float__pulse { animation: none; }
	.wa-float__tip {
		transition: opacity 0.3s ease, visibility 0.3s;
		transform: translateY(-50%);
	}
	.wa-float__btn:hover ~ .wa-float__tip,
	.wa-float:hover .wa-float__tip {
		transform: translateY(-50%);
	}
}
