/* ============================================================
   WHATSAPP FLOATING BUTTON
   Botón flotante de WhatsApp con badge de notificación
   Sin dependencias externas. Estilos aislados sin prefijo
   para no interferir con chatbot ni otros elementos.
   ============================================================ */

.wa-wrapper {
  --wa-green: #25D366;
  --wa-green-hover: #20BD5A;
  --wa-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);

  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 9999;
  opacity: 0;
  transform: scale(0.4);
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s 0.5s;
}

.wa-wrapper.visible {
  opacity: 1;
  transform: scale(1);
  visibility: visible;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s 0s;
}

.wa-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wa-green);
  border: none;
  cursor: pointer;
  padding: 0;
  box-shadow: var(--wa-shadow);
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.wa-button:hover {
  background: var(--wa-green-hover);
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
}

.wa-button:active {
  transform: scale(0.95);
}

.wa-button img {
  display: block;
  pointer-events: none;
}

.wa-button-icon {
  width: 54px;
  height: 54px;
}

/* Badge de notificación */
.wa-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wa-badge.visible {
  opacity: 1;
  transform: scale(1);
}

.wa-badge-bg {
  position: absolute;
  inset: 0;
  display: block;
  width: 20px;
  height: 20px;
}

.wa-badge-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
}

/* Responsive */
@media (max-width: 480px) {
  .wa-wrapper {
    left: 16px;
    bottom: 16px;
  }
  .wa-button {
    width: 50px;
    height: 50px;
  }
  .wa-button-icon {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 360px) {
  .wa-wrapper {
    left: 12px;
    bottom: 12px;
  }
  .wa-button {
    width: 46px;
    height: 46px;
  }
  .wa-button-icon {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-wrapper {
    transition: none;
  }
}
