/* ==========================================================================
   whatsapp.css — botón flotante "Comprar por WhatsApp"
   PC: botón grande con texto. Móvil: burbuja circular abajo a la derecha.
   El contenedor se desplaza con el scroll (js/whatsapp.js) y el interior
   tiene el efecto de llamada de atención (pulso y sacudida).
   ========================================================================== */

.wa-flotante {
  --wa-verde: #25d366;
  --wa-verde-oscuro: #128c7e;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  transform: translateY(var(--wa-desplaz, 0px));
  will-change: transform;
}

.wa-flotante__boton {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--wa-verde), var(--wa-verde-oscuro));
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px rgba(18, 140, 126, 0.45);
  animation: wa-sacudida 4.5s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Anillo que pulsa alrededor del botón para llamar la atención */
.wa-flotante__boton::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--wa-verde);
  z-index: -1;
  animation: wa-pulso 2s ease-out infinite;
}

.wa-flotante__boton:hover,
.wa-flotante__boton:focus-visible {
  translate: 0 -3px;
  scale: 1.04;
  box-shadow: 0 14px 34px rgba(18, 140, 126, 0.55);
  outline: none;
}

.wa-flotante__icono {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  fill: currentColor;
}

.wa-flotante__texto {
  white-space: nowrap;
}

@keyframes wa-pulso {
  0% { transform: scale(1); opacity: 0.55; }
  80%, 100% { transform: scale(1.35); opacity: 0; }
}

@keyframes wa-sacudida {
  0%, 82%, 100% { transform: rotate(0deg); }
  86% { transform: rotate(-7deg); }
  90% { transform: rotate(7deg); }
  94% { transform: rotate(-4deg); }
  97% { transform: rotate(2deg); }
}

/* Móvil: burbuja circular, solo el ícono */
@media (max-width: 640px) {
  .wa-flotante {
    right: 16px;
    bottom: 16px;
  }
  .wa-flotante__boton {
    width: 62px;
    height: 62px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  .wa-flotante__icono {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
  .wa-flotante__texto {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-flotante { transform: none; }
  .wa-flotante__boton,
  .wa-flotante__boton::before { animation: none; }
}