:root {
  --wa-green: #25d366;
  --wa-green-dark: #1ebe57;
}

/* BOTÓN FLOTANTE */
#whatsapp-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--wa-green);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2147483000;
  overflow: visible;
  transition: transform .12s ease;
}
#whatsapp-button:active { transform: scale(.98); }

#whatsapp-button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(37,211,102,0.22);
  z-index: -1;
  animation: wa-pulse 2s ease-in-out infinite;
}

#whatsapp-icon {
  font-size: 30px;
  color: #fff;
  animation: wa-blink 1.2s ease-in-out infinite, wa-sway 1.8s ease-in-out infinite;
  transform-origin: 50% 60%;
}

#whatsapp-button.paused::before { animation: none; }
#whatsapp-button.paused #whatsapp-icon { animation: none; }

/* Animaciones */
@keyframes wa-pulse {
  0%   { transform: translate(-50%,-50%) scale(1); opacity: .7; }
  50%  { transform: translate(-50%,-50%) scale(1.2); opacity: .95; }
  100% { transform: translate(-50%,-50%) scale(1); opacity: .7; }
}
@keyframes wa-sway {
  0% { transform: rotate(-6deg); }
  50%{ transform: rotate(6deg); }
  100%{ transform: rotate(-6deg); }
}
@keyframes wa-blink {
  0%,100%{ opacity: 1; }
  50%{ opacity: .5; }
}

/* POPUP */
#whatsapp-popup {
  position: fixed;
  bottom: 90px;
  left: 20px;
  width: 320px;
  max-width: calc(100% - 40px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
  display: none;
  flex-direction: column;
  z-index: 2147483100;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
  overflow: hidden;
}
#whatsapp-popup.show { display: flex; opacity: 1; transform: translateY(0); }

/* Botón cerrar */
.popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.22);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 9999;
}

/* Header */
.popup-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--wa-green);
  color: white;
  padding: 14px 14px 12px 14px;
  position: relative;
}
.profile-pic {
  width:56px; height:56px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid rgba(255,255,255,0.14);
  flex-shrink:0;
}
.title-block {
  display:flex; flex-direction:column; align-items:flex-start;
}
.title-block h3 { margin:0; font-size:16px; }
.title-block p { margin:3px 0 0; font-size:13px; opacity:.95; }

/* Body */
.popup-body { padding: 14px; background:#fff; }
#chat-box {
  background: #f2f2f2;
  padding: 12px;
  border-radius:10px;
  margin-bottom: 12px;
  font-size:14px;
}
.start-chat {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width: 100%;
  padding:10px 14px;
  border-radius:8px;
  border:none;
  background:var(--wa-green);
  color:#fff;
  font-size:15px;
  cursor:pointer;
}
.start-chat i{ font-size:16px; }
.start-chat:hover { background: var(--wa-green-dark); }

@media (max-width:420px) {
  #whatsapp-popup{ left:12px; right:12px; bottom:84px; width:auto; }
  #whatsapp-button{ left:12px; bottom:16px; }
}
