/* ==========================================================================
   WhatsApp iOS — capa de componentes para demos de flujos (nativo, sin React)
   Reutiliza el frame, animaciones y tokens del kit vendorizado y añade las
   clases de burbuja / header / compose que en el kit original eran estilos
   inline de los .jsx. Fuente de verdad visual: ui kit de Claude Design.
   ========================================================================== */
@import url("kit.css");   /* importa a su vez colors_and_type.css */

/* Lienzo de incrustación: transparente, dispositivo centrado, sin sombra */
html, body { background: transparent; }
body { padding: 8px; display: grid; place-items: center; align-items: center; min-height: 100%; }
.phone { box-shadow: none; }

/* ----- Header (cápsulas flotantes) -------------------------------------- */
.wa-head { display: flex; align-items: center; gap: 10px; padding: 2px 12px 10px; flex: none; }
.wa-head .back { gap: 2px; padding: 5px 11px 5px 6px; }
.wa-head .acts { gap: 20px; padding: 8px 16px; }
.wa-head .acts .lc { color: var(--capsule-fg); }
.wa-head-info { flex: 1; min-width: 0; padding: 3px 4px; border-radius: 6px; margin-left: -3px; }
.wa-head-name { font: 700 17px/20px var(--font-sans); letter-spacing: -.3px; color: var(--fg-1);
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-head-sub  { font: var(--t-caption); color: var(--fg-2); margin-top: 1px; min-height: 14px;
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----- Filas y burbujas ------------------------------------------------- */
.wa-row { display: flex; padding: 0 9px; margin-top: 7px; }
.wa-row.cont { margin-top: 2px; }
.wa-row.out { justify-content: flex-end; }
.wa-row.in  { justify-content: flex-start; }

.wa-bubble { max-width: 78%; padding: 6px 9px 8px; border-radius: var(--r-bubble);
             box-shadow: var(--sh-bubble); position: relative; color: var(--fg-1); font: var(--t-body); }
.wa-bubble.in  { background: var(--bubble-in); }
.wa-bubble.out { background: var(--bubble-out); }
.wa-row:not(.cont) .wa-bubble.in  { border-top-left-radius: var(--r-bubble-tail); }
.wa-row:not(.cont) .wa-bubble.out { border-top-right-radius: var(--r-bubble-tail); }

.wa-text { white-space: pre-wrap; }
.wa-text strong { font-weight: 600; }
.wa-li { display: flex; gap: 8px; margin: 3px 0; }
.wa-li .mark { flex: none; text-align: right; }
.wa-li.num .mark { font-weight: 600; min-width: 22px; }
.wa-li .body { flex: 1; }

/* Meta (hora + tick) que fluye tras la última línea */
.wa-meta { display: inline-flex; align-items: center; gap: 3px; float: right;
           margin: 4px 0 0 10px; position: relative; top: 4px;
           font: var(--t-caption2); color: var(--fg-2); }
.wa-meta svg { flex: none; }

/* ----- Mensajes de sistema (separador de fecha / cifrado) --------------- */
.wa-sys { display: flex; justify-content: center; margin: 8px 12px; }
.wa-sys .pill { background: var(--pill-bg); color: var(--pill-fg); box-shadow: var(--sh-pill);
                border-radius: 999px; padding: 5px 12px; font: var(--t-footnote); text-align: center; }
.wa-sys.enc .pill { background: #FDF4C9; color: #6B6443; border-radius: 8px; padding: 7px 14px;
                    max-width: 82%; font: var(--t-caption); }

/* ----- Documento (chip con glifo de archivo + caption) ------------------ */
.wa-doc { display: flex; flex-direction: column; }
.wa-doc .chip { display: flex; align-items: center; gap: 12px; border-radius: 10px;
                padding: 9px 12px; min-width: 220px; background: rgba(0,0,0,.045); }
.wa-bubble.out .wa-doc .chip { background: rgba(0,0,0,.05); }
.wa-doc .name { font: var(--t-body); color: var(--fg-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-doc .sub  { font: var(--t-caption); color: var(--fg-2); margin-top: 3px; }
.wa-doc .cap  { margin-top: 6px; }

/* ----- Imagen (foto adjunta, p. ej. ticket) ----------------------------- */
.wa-img { position: relative; border-radius: 9px; overflow: hidden; line-height: 0; margin: -2px 0; }
.wa-img img { width: 100%; display: block; }
.wa-img-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 6px;
              font: var(--t-body); color: #fff; line-height: 1.3;
              background: linear-gradient(transparent, rgba(0,0,0,.45)); }
.wa-img-meta { position: absolute; right: 7px; bottom: 5px; display: inline-flex; align-items: center;
               gap: 3px; padding: 1px 6px; border-radius: 8px; background: rgba(0,0,0,.35);
               font: var(--t-caption2); color: #fff; }
.wa-img-meta svg { flex: none; }

/* ----- Nota de voz ------------------------------------------------------- */
.wa-voice { display: flex; align-items: center; gap: 11px; min-width: 234px; padding: 2px 2px 1px; }
.wa-voice-av { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%;
               display: grid; place-items: center; color: #fff; font: 500 16px/1 var(--font-sans); }
.wa-voice-mic { position: absolute; right: -2px; bottom: -2px; width: 19px; height: 19px; border-radius: 50%;
                background: var(--bubble-in); display: grid; place-items: center; }
.wa-bubble.out .wa-voice-mic { background: var(--bubble-out); }
.wa-voice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wa-voice-track { display: flex; align-items: center; gap: 11px; }
.wa-voice-wave { position: relative; flex: 1; height: 24px; display: flex; align-items: center; }
.wa-voice-dot { position: absolute; left: 0; width: 11px; height: 11px; border-radius: 50%;
                background: var(--fg-1); box-shadow: 0 0 0 2px var(--bubble-in); }
.wa-bubble.out .wa-voice-dot { box-shadow: 0 0 0 2px var(--bubble-out); }
.wa-voice-meta { display: flex; align-items: center; font: var(--t-caption); color: var(--fg-2); }
.wa-voice-time { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font: var(--t-caption2); }
.wa-voice-time svg { flex: none; }

/* ----- Indicador "escribiendo…" ----------------------------------------- */
.wa-typing { display: flex; gap: 5px; padding: 11px 13px; border-radius: 12px; border-top-left-radius: 4px;
             background: var(--bubble-in); box-shadow: var(--sh-bubble); }

/* ----- Compose bar (estado de reposo, replica del InputBar del kit) ----- */
.wa-compose { display: flex; align-items: flex-end; gap: 10px; padding: 7px 10px 8px;
              padding-bottom: calc(var(--homeind-h) + 2px); background: var(--bg-header);
              border-top: 0.5px solid var(--line); flex: none; }
.wa-compose .iconbtn { color: var(--input-icon); }
.wa-field { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--bg-field);
            border: 0.5px solid var(--line-strong); border-radius: 20px; padding: 6px 10px 6px 12px; min-height: 36px; }
.wa-field .txt { flex: 1; min-width: 0; font: var(--t-body); white-space: pre-wrap; word-break: break-word; }
.wa-field .txt.empty { color: var(--fg-3); }
.wa-field .txt.filled { color: var(--fg-1); }
.wa-send { width: 33px; height: 33px; border-radius: 50%; background: var(--tint); margin-bottom: 1px; }

/* Cursor del campo mientras el cliente "escribe" su respuesta */
.caret { display: inline-block; width: 1.5px; height: 1.05em; background: var(--fg-1);
         margin-left: 1px; vertical-align: -2px; animation: caretBlink 1s steps(1) infinite; }
@keyframes caretBlink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
