/* ============================================================
   WIDGET FLOTANTE DE WHATSAPP
============================================================ */
.wa-widget {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

/* Botón flotante */
.wa-fab {
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  color: #fff;
  background: #25D366;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.45);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.wa-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.55);
}

.wa-fab svg {
  width: 32px;
  height: 32px;
}

.wa-fab.has-badge::after {
  content: "1";
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dc3545;
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* Pulsación suave recurrente */
@keyframes wa-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45), 0 10px 24px rgba(37, 211, 102, 0.45);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(37, 211, 102, 0), 0 10px 24px rgba(37, 211, 102, 0.45);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0), 0 10px 24px rgba(37, 211, 102, 0.45);
  }
}

.wa-fab {
  animation: wa-pulse 2.8s ease-out infinite;
}

/* Ventana de chat */
.wa-chat {
  width: min(340px, calc(100vw - 48px));
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transform-origin: bottom left;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.wa-chat.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.wa-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #075E54;
  color: #fff;
}

.wa-chat-ava {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-chat-ava svg {
  width: 22px;
  height: 22px;
}

.wa-chat-id {
  flex: 1;
  line-height: 1.2;
}

.wa-chat-id strong {
  display: block;
  font-family: var(--display);
  font-size: 15px;
}

.wa-chat-id span {
  font-size: 12px;
  color: #a8e6c8;
}

.wa-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.wa-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.wa-chat-body {
  padding: 16px;
  background:
    linear-gradient(180deg, #ECE5DD 0%, #E4DDD3 100%);
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.wa-in {
  align-self: flex-start;
  background: #fff;
  color: #111;
  border-bottom-left-radius: 4px;
}

.wa-out {
  align-self: flex-end;
  background: #DCF8C6;
  color: #111;
  border-bottom-right-radius: 4px;
}

.wa-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #F0F0F0;
}

.wa-chat-form input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: #fff;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  color: #111;
  font-family: inherit;
}

.wa-send {
  width: 44px;
  height: 44px;
  flex: none;
  border: none;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.wa-send:hover {
  background: #1fb857;
  transform: scale(1.06);
}

.wa-send svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}