.wa-widget {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.wa-bubble {
  max-width: 280px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(13, 23, 41, 0.22);
  padding: 14px 16px;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  cursor: pointer;
}
.wa-bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.wa-bubble-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.wa-bubble-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wa-bubble-avatar img { width: 18px; height: 18px; }
.wa-bubble-name {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
}
.wa-bubble-status {
  font-size: 11px;
  color: #25D366;
  display: flex;
  align-items: center;
  gap: 4px;
}
.wa-bubble-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #25D366;
}
.wa-bubble-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 12px;
  margin: -12px -12px -12px 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.wa-bubble-close:hover { background: rgba(13, 23, 41, 0.06); }
.wa-bubble-text {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--navy);
  line-height: 1.5;
}
.wa-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}
.wa-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray);
  animation: waTypingBounce 1.2s infinite ease-in-out;
}
.wa-typing span:nth-child(2) { animation-delay: 0.15s; }
.wa-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes waTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.wa-button {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
  transition: transform 0.15s ease;
  position: relative;
}
.wa-button:hover { transform: scale(1.06); }
.wa-button svg { width: 30px; height: 30px; }

.wa-button-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  opacity: 0;
}
.wa-button.is-pinging .wa-button-ping {
  animation: waPing 1.1s ease-out;
}
@keyframes waPing {
  0% { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.9); }
}

@media (max-width: 640px) {
  .wa-widget { bottom: 16px; right: 16px; }
  .wa-bubble { max-width: calc(100vw - 100px); }
}

/* Barra fija de llamada/WhatsApp — reemplaza el widget flotante en mobile,
   donde el teléfono del header se oculta y si no queda ninguna forma de
   llamar con un toque. */
.mobile-cta-bar { display: none; }

@media (max-width: 900px) {
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }

  .wa-widget { display: none; }

  .mobile-cta-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 16px rgba(13, 23, 41, 0.15);
  }
  .mobile-cta-call,
  .mobile-cta-wa {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    font-family: var(--font-condensed);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--white);
  }
  .mobile-cta-call { background: var(--navy); }
  .mobile-cta-wa { background: #25d366; }
}
