/* ═══════════════════════════════════════════════════════════════════
   HALYON — wa-demo.css
   Demo de WhatsApp Business: celular realista + notas de lo que hace el bot.
   Se ve desde el celular del cliente (sus mensajes a la derecha, en verde).
   ═══════════════════════════════════════════════════════════════════ */

.wa-demo { width: 100%; max-width: 640px; }
/* la fila de WhatsApp le da más lugar a la demo */
.cap-row.cap-row--wa { grid-template-columns: 0.8fr 1.2fr; }

/* Casos para probar: pestañas de texto, sin píldoras */
.wa-casos { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin-bottom: 22px; }
.wa-casos-lbl { font-size: 15.5px; color: var(--ink-faint); }
.wa-caso {
  position: relative; padding: 6px 0; font-size: 15.5px; font-weight: 500; color: var(--ink-faint);
  transition: color 0.3s var(--ease);
}
.wa-caso::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--gradient); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease);
}
.wa-caso:hover { color: var(--ink-dim); }
.wa-caso[aria-selected="true"] { color: var(--ink); }
.wa-caso[aria-selected="true"]::after { transform: scaleX(1); }

.wa-cuerpo { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 26px; align-items: center; }

/* ─── Celular ───────────────────────────────────────────────────── */
.wa-tel {
  position: relative; width: 300px; height: 612px;
  border-radius: 48px; padding: 11px;
  background: linear-gradient(145deg, #2b2b30, #0c0c0f 60%);
  box-shadow:
    0 0 0 1.5px #3a3a40 inset,
    0 50px 90px -40px rgba(26,23,18,0.55),
    0 30px 60px -30px rgba(138,92,255,0.45);
}
.wa-isla { position: absolute; top: 20px; left: 50%; translate: -50% 0; width: 92px; height: 26px; border-radius: 20px; background: #000; z-index: 3; }
.wa-pantalla {
  position: relative; height: 100%; border-radius: 38px; overflow: hidden;
  display: flex; flex-direction: column;
  background: #efeae2;
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  color: #111b21; font-size: 13.5px; line-height: 1.32;
}

.wa-estado { display: flex; justify-content: space-between; align-items: center; padding: 14px 26px 4px 30px; background: #f6f6f6; font-size: 13px; font-weight: 600; }
.wa-estado-ic { display: flex; gap: 5px; }

.wa-ic {
  display: inline-block; flex: none; width: 17px; height: 17px;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
  background: currentColor;
}
.wa-estado .wa-ic { width: 14px; height: 14px; }

.wa-cabecera {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px 10px 8px; background: #f6f6f6;
  border-bottom: 1px solid rgba(0,0,0,0.06); color: #007aff;
}
.wa-cabecera .wa-ic { width: 22px; height: 22px; }
.wa-av {
  width: 34px; height: 34px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px;
  background: var(--gradient);
}
.wa-av img { width: 100%; height: 100%; object-fit: cover; }
.wa-quien { display: flex; flex-direction: column; min-width: 0; flex: 1; color: #111b21; }
.wa-quien b { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.wa-verif { width: 14px; height: 14px; flex: none; }
.wa-quien small { font-size: 11.5px; color: #667781; transition: color 0.2s; }
.wa-quien small.escribiendo { color: #008069; }
.wa-cabecera .wa-acciones { display: flex; gap: 16px; }

/* Chat */
.wa-chat {
  flex: 1; min-height: 0; overflow: hidden; padding: 10px 10px 8px;
  display: flex; flex-direction: column; gap: 6px;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(0,0,0,0.035) 1px, transparent 1.2px);
  background-size: 14px 14px;
  scroll-behavior: smooth;
}
.wa-chat > :first-child { margin-top: auto; }   /* como en WhatsApp: los mensajes arrancan abajo */
.wa-dia { align-self: center; margin: 2px 0 6px; padding: 4px 10px; border-radius: 8px; background: #fff; color: #54656f; font-size: 11.5px; box-shadow: 0 1px 0 rgba(0,0,0,0.06); }

.wa-msj {
  position: relative; max-width: 80%; padding: 6px 8px 6px 9px; border-radius: 9px;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
  animation: waEntra 0.32s var(--ease-out) both;
  white-space: pre-line; overflow-wrap: anywhere;
}
.wa-msj.negocio { align-self: flex-start; background: #fff; border-top-left-radius: 2px; }
.wa-msj.cliente { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 2px; }
.wa-meta { display: flex; justify-content: flex-end; align-items: center; gap: 3px; margin: 2px -2px -2px 12px; float: right; font-size: 10.5px; color: #667781; }
.wa-meta .wa-ic { width: 15px; height: 15px; color: #53bdeb; }
@keyframes waEntra { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Producto de catálogo dentro del mensaje */
.wa-prod { margin: -2px -4px 6px -5px; border-radius: 7px; overflow: hidden; background: #f0f2f5; }
.wa-prod img { width: 100%; aspect-ratio: 1.25; object-fit: cover; display: block; }
.wa-prod div { padding: 7px 9px 8px; }
.wa-prod b { display: block; font-size: 13.5px; }
.wa-prod span { color: #667781; font-size: 12.5px; }

/* Botones de respuesta rápida y de pago (debajo del mensaje del negocio) */
.wa-botones { align-self: flex-start; width: 80%; display: grid; gap: 4px; margin-top: -2px; animation: waEntra 0.32s var(--ease-out) both; }
.wa-boton {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 10px; border-radius: 9px; background: #fff; color: #008069;
  font-weight: 500; font-size: 13.5px; box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
  transition: background-color 0.2s, transform 0.2s;
}
.wa-boton img { width: 18px; height: 18px; }
.wa-boton.tocado { background: #e7f3ef; transform: scale(0.97); }
.wa-botones.usados .wa-boton:not(.tocado) { opacity: 0.55; }

/* Aviso de pago aprobado */
.wa-sistema { align-self: center; display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 8px; background: #fff7d6; color: #54656f; font-size: 11.5px; animation: waEntra 0.32s var(--ease-out) both; }
.wa-sistema img { width: 16px; height: 16px; }

/* Escribiendo… */
.wa-tipeo { align-self: flex-start; display: flex; gap: 3px; padding: 10px 12px; border-radius: 9px; border-top-left-radius: 2px; background: #fff; box-shadow: 0 1px 0.5px rgba(11,20,26,0.13); }
.wa-tipeo span { width: 6px; height: 6px; border-radius: 50%; background: #8696a0; animation: waTipeo 1.1s infinite ease-in-out; }
.wa-tipeo span:nth-child(2) { animation-delay: 0.16s; }
.wa-tipeo span:nth-child(3) { animation-delay: 0.32s; }
@keyframes waTipeo { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* Barra para escribir */
.wa-escribir { display: flex; align-items: center; gap: 9px; padding: 8px 10px 22px; background: #f6f6f6; color: #007aff; }
.wa-escribir .wa-ic { width: 21px; height: 21px; }
.wa-campo { flex: 1; padding: 7px 12px; border-radius: 18px; background: #fff; color: #8696a0; font-size: 13px; border: 1px solid rgba(0,0,0,0.06); }
.wa-mic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #25d366; color: #fff; }
.wa-mic .wa-ic { width: 17px; height: 17px; }

/* ─── Notas: qué hizo el bot en cada paso ───────────────────────── */
.wa-notas { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; align-content: start; align-self: stretch; padding-top: 64px; }
.wa-nota {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start;
  padding: 14px 16px; border-radius: 16px;
  background: var(--bg-card); border: 1px solid var(--line-soft);
  box-shadow: 0 18px 36px -26px rgba(26,23,18,0.35);
  font-size: 14.5px; line-height: 1.4; color: var(--ink);
  animation: notaEntra 0.55s var(--ease-out) both;
}
.wa-nota-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-2); }
.wa-nota-ic i {
  width: 18px; height: 18px;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
  background: var(--gradient);
}
.wa-nota small { display: block; color: var(--ink-faint); font-size: 12.5px; margin-top: 2px; }
.wa-nota.destacada { background: var(--night); color: #fff; border-color: transparent; box-shadow: 0 24px 46px -24px rgba(138,92,255,0.7); }
.wa-nota.destacada .wa-nota-ic { background: rgba(255,255,255,0.08); }
.wa-nota.destacada small { color: var(--night-dim); }
@keyframes notaEntra { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }

.wa-repetir {
  margin-top: 18px; font-size: 14px; font-weight: 500; color: var(--ink-dim);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-bright);
}
.wa-repetir:hover { color: var(--ink); }

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .wa-cuerpo { grid-template-columns: 1fr; justify-items: center; }
  .wa-notas { width: 100%; max-width: 420px; padding-top: 0; }
}
@media (max-width: 860px) {
  .cap-row.cap-row--wa { grid-template-columns: 1fr; }
  .wa-casos { justify-content: center; }
  .wa-casos-lbl { flex-basis: 100%; text-align: center; }
}
@media (max-width: 380px) {
  .wa-tel { width: 280px; height: 580px; }
}
@media (prefers-reduced-motion: reduce) {
  .wa-msj, .wa-botones, .wa-sistema, .wa-nota { animation: none; }
  .wa-tipeo span { animation: none; }
}
