/* ── CTA flotante animado: WhatsApp + barra mobile ── */

.wa-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 1200;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  pointer-events: none;
}
.wa-stack > * { pointer-events: auto; }

/* dentro del stack el botón deja de ser fixed y fluye en columna */
.wa-stack .wa-float {
  position: relative; right: auto; bottom: auto;
  animation: waNudge 9s ease-in-out infinite;
}

/* anillo de pulso continuo */
.wa-float::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: #25d366; z-index: -1;
  animation: waPulse 2.4s ease-out infinite;
}
@keyframes waPulse {
  0% { transform: scale(1); opacity: .55; }
  70%, 100% { transform: scale(1.95); opacity: 0; }
}

/* campanada de atención: ~0.6s cada 9s */
@keyframes waNudge {
  0%, 7.5%, 100% { transform: rotate(0deg) scale(1); }
  1.5% { transform: rotate(-9deg) scale(1.07); }
  3%   { transform: rotate(7deg) scale(1.07); }
  4.5% { transform: rotate(-5deg) scale(1.04); }
  6%   { transform: rotate(3deg) scale(1.02); }
}

/* globo invitador */
.wa-bubble {
  position: relative;
  max-width: 232px;
  padding: 10px 34px 10px 14px;
  border-radius: 14px;
  background: var(--bg, #fff); color: var(--fg, #0b1020);
  border: 1px solid var(--line, rgba(11,16,32,.12));
  box-shadow: 0 10px 30px rgba(15,23,42,.16);
  font-size: 14px; font-weight: 600; line-height: 1.4;
  opacity: 0; transform: translateY(6px) scale(.96);
  transition: opacity .25s ease, transform .25s ease;
}
.wa-bubble.show { opacity: 1; transform: none; }
.wa-bubble::after {
  content: ""; position: absolute; right: 22px; bottom: -7px;
  width: 13px; height: 13px;
  background: var(--bg, #fff);
  border-right: 1px solid var(--line, rgba(11,16,32,.12));
  border-bottom: 1px solid var(--line, rgba(11,16,32,.12));
  transform: rotate(45deg);
}
.wa-bubble-close {
  position: absolute; top: 6px; right: 7px;
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted, rgba(11,16,32,.6));
  font-size: 15px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.wa-bubble-close:hover { color: var(--fg, #0b1020); }

/* barra CTA sticky — solo mobile, solo páginas con data-mobile-cta-bar */
.mobile-cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1150;
  display: none; align-items: center; gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg, #fff) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line, rgba(11,16,32,.12));
  box-shadow: 0 -8px 28px rgba(15,23,42,.12);
  transform: translateY(110%);
  transition: transform .28s ease;
}
.mobile-cta-bar.visible { transform: translateY(0); }

.mobile-cta-trial {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 18px; border-radius: 12px;
  background: var(--accent, #2563eb); color: #fff;
  font-weight: 700; font-size: 15px; letter-spacing: -.01em;
  text-decoration: none;
}
.mobile-cta-wa {
  flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 12px;
  background: #25d366; color: #fff;
  display: grid; place-items: center;
}
.mobile-cta-wa svg { width: 27px; height: 27px; fill: currentColor; }

@media (max-width: 768px) {
  .mobile-cta-bar { display: flex; }

  /* cuando la barra está visible, el float standalone se retira:
     el globo queda anclado arriba del ícono WA de la barra */
  html.cta-bar-visible .wa-float { display: none; }
  html.cta-bar-visible .wa-stack {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    right: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wa-float, .wa-float::before { animation: none !important; }
  .wa-bubble, .mobile-cta-bar { transition: none !important; }
}
