/* ==========================================================================
   Widget flotante de WhatsApp
   ========================================================================== */

.wa-widget-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ================= BOTÓN PRINCIPAL ================= */
.wa-floating-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  outline: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: waButtonPulse 14s infinite ease-in-out;
}

.wa-floating-btn:hover {
  transform: scale(1.08);
}

.wa-icon {
  width: 32px;
  height: 32px;
  fill: #ffffff;
}

/* ================= PUNTO VERDE CONCÉNTRICO ================= */
.wa-online-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
  background-color: #00e676;
  border: 2px solid #ffffff;
  border-radius: 50%;
  pointer-events: none;
}

.wa-online-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #00e676;
  transform: translate(-50%, -50%) scale(1);
  animation: waDotGlow 2s infinite ease-out;
  box-sizing: content-box;
}

/* ================= VENTANA DE CHAT ================= */
/* Modo oscuro (pedido del usuario, 2026-10-17): la paleta del modo oscuro de WhatsApp */
.wa-card {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 330px;
  max-width: calc(100vw - 32px);
  background: #111b21;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: waPopupIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wa-card[hidden] { display: none; }

.wa-header {
  background: #202c33;
  padding: 14px 16px;
  color: #e9edef;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wa-avatar-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.wa-avatar img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.wa-info h4 {
  margin: 0;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
}

.wa-info p {
  margin: 2px 0 0 0;
  font-size: 11.5px;
  color: #8696a0;
}

.wa-close-btn {
  background: transparent;
  border: none;
  color: #aebac1;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.wa-close-btn:hover { opacity: 1; }

.wa-body {
  background-color: #0b141a;
  background-image: radial-gradient(#1c272d 1px, transparent 1px);
  background-size: 12px 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-message-bubble {
  background: #202c33;
  padding: 10px 14px;
  border-radius: 0 12px 12px 12px;
  max-width: 90%;
  font-size: 13.5px;
  color: #e9edef;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.wa-timestamp {
  display: block;
  font-size: 10px;
  color: #8696a0;
  text-align: right;
  margin-top: 4px;
}

.wa-quick-replies {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wa-quick-btn {
  background: #1f2c34;
  border: 1px solid #25D366;
  color: #e9edef;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wa-quick-btn:hover {
  background-color: #25D366;
  color: #0b141a;
  transform: translateX(3px);
}

.wa-footer {
  padding: 12px 16px;
  background: #111b21;
}

.wa-cta-btn {
  width: 100%;
  background: #25D366;
  color: #0b141a;
  border: none;
  padding: 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.2s;
}

.wa-cta-btn:hover {
  background: #20ba59;
}

@media (max-width: 480px) {
  .wa-widget-container { bottom: 16px; right: 16px; }
  .wa-card { right: 16px; bottom: 76px; }
}
/* En celular el botón más chico (pedido del usuario, 2026-10-18) */
@media (max-width: 768px) {
  .wa-floating-btn { width: 48px; height: 48px; }
  .wa-icon { width: 26px; height: 26px; }
  .wa-online-dot { top: 2px; right: 2px; width: 10px; height: 10px; }
}

/* ================= ANIMACIONES KEYFRAMES ================= */

@keyframes waDotGlow {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.6);
    opacity: 0;
  }
}

@keyframes waButtonPulse {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  }
  3% {
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4), 0 0 0 14px rgba(37, 211, 102, 0);
  }
  6%, 100% {
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4), 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

@keyframes waPopupIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
