/* ============================================================
   HUBSYSTEM — WhatsApp directo (reemplaza al HUBBOT)
   Burbuja flotante + panel. Mismo lenguaje visual del sitio.
   ============================================================ */

.wa[hidden] { display: none; }

.wa { transition: opacity 0.5s ease, visibility 0.5s; }

body:not(.site-visible) .wa { opacity: 0; visibility: hidden; }

.wa-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 18px 44px -12px rgba(37, 211, 102, 0.9);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wa-toggle:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 22px 52px -14px rgba(37, 211, 102, 0.95); }
.wa-toggle:focus-visible { outline: 2px solid #25d366; outline-offset: 3px; }
.wa-toggle svg { width: 30px; height: 30px; }

.wa-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.55);
  animation: waPulse 2.8s ease-out infinite;
  pointer-events: none;
}

@keyframes waPulse {
  0% { transform: scale(0.85); opacity: 0; }
  30% { opacity: 0.8; }
  100% { transform: scale(1.25); opacity: 0; }
}

.wa-panel {
  position: fixed;
  right: 22px;
  bottom: 94px;
  z-index: 40;
  width: min(370px, calc(100vw - 44px));
  background: rgba(7, 14, 30, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.wa.open .wa-panel { opacity: 1; transform: none; pointer-events: auto; }

.wa-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 13px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 20, 40, 0.7);
}

.wa-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #25d366, #128c4b);
  flex: none;
}

.wa-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wa-id strong { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.06em; }
.wa-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.wa-status i { width: 7px; height: 7px; border-radius: 50%; background: #25d366; box-shadow: 0 0 8px #25d366; }

.wa-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
}

.wa-close:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.wa-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }

.wa-msg {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: rgba(20, 34, 64, 0.6);
  border: 1px solid var(--line);
  border-radius: 14px;
  border-top-left-radius: 6px;
  padding: 11px 13px;
}

.wa-opt {
  text-align: left;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: #eafff2;
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.45);
  border-radius: 13px;
  padding: 11px 13px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.wa-opt:hover { background: rgba(37, 211, 102, 0.22); transform: translateY(-1px); }

.wa-note {
  margin: 0;
  padding: 0 14px 13px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.wa-note a { color: #25d366; text-decoration: none; }

@media (max-width: 480px) {
  .wa-toggle { right: 14px; bottom: 14px; }
  .wa-panel { right: 10px; left: 10px; width: auto; bottom: 86px; }
}
