/* Simulador de WhatsApp (marco de teléfono). Colores propios de la simulación; no usa la marca ni
   el logo de WhatsApp. Contraste AA en texto y metadatos. */
/* ── Marco del teléfono (estilo iPhone moderno): canto metálico, bisel negro fino, botones laterales,
      isla dinámica con cámara, barra de estado con hora, señal, wifi y batería, e indicador de inicio ── */
.wa-device {
  --dev-r: 62px;      /* radio exterior */
  --dev-metal: 6px;   /* grosor del canto metálico */
  --dev-bezel: 7px;   /* bisel negro alrededor de la pantalla */
  --btn: #8d9196;
  position: relative; isolation: isolate;
  width: 100%; max-width: 404px; margin-inline: auto;
  padding: var(--dev-metal);
  border-radius: var(--dev-r);
  background: linear-gradient(135deg, #f4f5f7 0%, #bcbfc4 11%, #70747a 29%, #3a3d41 47%, #7b7f84 63%, #c6c9cd 83%, #f1f2f4 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(255, 255, 255, .7), inset 0 0 0 2.5px rgba(0, 0, 0, .16),
    0 30px 50px -20px rgba(0, 0, 0, .45), 0 10px 18px -10px rgba(0, 0, 0, .3);
}
/* Botones laterales: acción + volumen a la izquierda, encendido a la derecha (se ven asomar del canto) */
.wa-device::before, .wa-device::after { content: ""; position: absolute; z-index: -1; width: 5px; border-radius: 3px; }
.wa-device::before {
  left: -3px; top: 12%; height: 28%;
  background: linear-gradient(to bottom, var(--btn) 0 14%, transparent 14% 30%, var(--btn) 30% 58%, transparent 58% 66%, var(--btn) 66% 94%, transparent 94%);
  border-radius: 3px 0 0 3px;
}
.wa-device::after { right: -3px; top: 25%; height: 14%; background: var(--btn); border-radius: 0 3px 3px 0; }

.wa-phone {
  --wa-head: #0b5f55;
  --wa-chat: #ece7de;
  --wa-out: #d9f6cf;
  --wa-in: #ffffff;
  --wa-ink: #111b21;
  --wa-meta: #4b5b64;
  width: 100%;
  height: var(--phone-h, 700px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto auto;
  background: var(--wa-chat);
  border: var(--dev-bezel, 7px) solid #050505;
  border-radius: calc(var(--dev-r, 62px) - var(--dev-metal, 6px));
  overflow: hidden;
  position: relative;
  color: var(--wa-ink);
}
.wa-status { position: relative; display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 4px 30px 0 34px; background: var(--wa-head); color: #fff; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.wa-status__icons { display: inline-flex; gap: 6px; align-items: center; }
/* Isla dinámica: pastilla negra con el punto de la cámara a la derecha */
.wa-island { position: absolute; left: 50%; top: var(--isl-top, 12px); width: var(--isl-w, 112px); height: var(--isl-h, 32px); transform: translateX(-50%); background: #000; border-radius: 999px; }
.wa-island::after { content: ""; position: absolute; right: 11%; top: 50%; width: 26%; aspect-ratio: 1; max-width: 12px; transform: translateY(-50%); border-radius: 50%; background: radial-gradient(circle at 35% 35%, #2b3a63 0 18%, #0d1226 45%, #05070f 75%); box-shadow: 0 0 0 1.5px #0b0b0d; }
.wa-home { display: grid; place-items: center; height: 22px; background: #f0ede6; }
.wa-home::after { content: ""; width: 34%; height: 5px; border-radius: 3px; background: #111; opacity: .85; }
.wa-head { display: flex; align-items: center; gap: 11px; padding: 8px 14px 11px; background: var(--wa-head); color: #fff; }
.wa-avatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; overflow: hidden; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.wa-avatar svg { width: 100%; height: 100%; }
.wa-head__txt { display: grid; min-width: 0; line-height: 1.2; }
.wa-head__title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-head__sub { font-size: 14px; color: #d4efe9; }

.wa-chat {
  overflow-y: auto; padding: 12px 10px 8px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain;
  background-image: radial-gradient(rgba(11, 95, 85, .06) 1.2px, transparent 1.4px); background-size: 20px 20px;
}
.wa-sys { display: flex; justify-content: center; margin: 6px 0; }
.wa-sys span { background: #fff6d6; color: #4a3b00; font-size: 14px; padding: 5px 11px; border-radius: 9px; text-align: center; max-width: 92%; box-shadow: 0 1px 0 rgba(0, 0, 0, .06); font-weight: 550; }
.wa-sys--note span { background: #e0efec; color: #1b4a44; display: inline-flex; gap: 6px; align-items: center; }

.wa-row { display: flex; }
.wa-row--out { justify-content: flex-end; }
.wa-row--new .wa-bubble { animation: wa-pop .24s var(--ease, ease-out); }
@keyframes wa-pop { from { transform: translateY(6px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.wa-bubble { max-width: 84%; padding: 7px 9px 4px 10px; border-radius: 12px; background: var(--wa-in); box-shadow: 0 1px 1px rgba(0, 0, 0, .1); font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.wa-row--out .wa-bubble { background: var(--wa-out); border-top-right-radius: 3px; }
.wa-row--in .wa-bubble { border-top-left-radius: 3px; }
.wa-text { margin: 0; white-space: pre-wrap; }
.wa-who { display: block; font-size: 14px; font-weight: 700; color: #0b5f55; margin-bottom: 1px; }
.wa-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 13px; color: var(--wa-meta); margin-top: 1px; }
.wa-file { display: flex; gap: 8px; align-items: center; padding: 6px; background: rgba(0, 0, 0, .06); border-radius: 9px; margin-bottom: 4px; }
.wa-file__ico { background: #0b5f55; color: #fff; border-radius: 7px; font-size: 13px; font-weight: 700; padding: 6px 7px; }
.wa-file__name { display: grid; font-size: 14px; min-width: 0; }
.wa-file__name small { color: var(--wa-meta); font-size: 13px; }
.wa-typing { display: inline-flex; gap: 4px; padding: 11px 13px; }
.wa-typing i { width: 7px; height: 7px; border-radius: 50%; background: #7d8b93; animation: wa-dot 1s infinite ease-in-out; }
.wa-typing i:nth-child(2) { animation-delay: .15s; } .wa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes wa-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Respuestas rápidas: una sola fila que se desplaza de lado a lado (no le quita alto al chat) */
.wa-chips { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; padding: 8px 10px; background: color-mix(in srgb, var(--wa-chat) 70%, #fff); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 10px; scrollbar-width: none; border-top: 1px solid rgba(0, 0, 0, .06); }
.wa-chips::-webkit-scrollbar { display: none; }
.wa-chips.has-more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent); }
.wa-chips.has-less { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 34px), transparent); }
.wa-chips.has-more.has-less { -webkit-mask-image: linear-gradient(to right, transparent, #000 34px, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to right, transparent, #000 34px, #000 calc(100% - 34px), transparent); }
.wa-chips[hidden] { display: none; }
.wa-chips__sep { flex: none; width: 1px; height: 22px; background: rgba(0, 0, 0, .18); margin-inline: 2px; }
.wa-chip { flex: none; scroll-snap-align: start; white-space: nowrap; font: inherit; font-size: 14px; font-weight: 650; color: #0b5f55; background: #fff; border: 1px solid #b6d6d0; border-radius: 999px; padding: 6px 13px; cursor: pointer; min-height: 34px; box-shadow: 0 1px 1px rgba(0, 0, 0, .05); transition: background .15s, border-color .15s; }
.wa-chip:hover { background: #eef8f6; border-color: #0b5f55; }
.wa-chip--day { background: #f4f8f7; border-style: dashed; }
.wa-chip--warn { color: #8a1c1c; border-color: #ebb9b9; }
.wa-chip--warn:hover { background: #fdf1f1; border-color: #8a1c1c; }

.wa-human { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; background: #f7f4ec; border-top: 1px solid rgba(0, 0, 0, .08); font-size: 12.5px; color: #3c4750; }
.wa-human__note { display: inline-flex; gap: 6px; align-items: center; line-height: 1.25; }
.wa-human__btn { font: inherit; font-size: 13px; font-weight: 700; color: #0b5f55; background: #fff; border: 1px solid #8fc3ba; border-radius: 9px; padding: 6px 9px; cursor: pointer; white-space: nowrap; min-height: 32px; transition: background .15s; }
.wa-human__btn:hover { background: #eef8f6; }

.wa-input { display: flex; align-items: center; gap: 6px; padding: 8px; background: #f0ede6; }
.wa-input__field { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 10px 15px; border-radius: 24px; border: 1px solid #d3cec3; background: #fff; color: var(--wa-ink); min-height: 44px; }
.wa-input__field:focus-visible { outline: none; border-color: #0b5f55; box-shadow: 0 0 0 3px rgba(11, 95, 85, .2); }
.wa-input__btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: #4b5b64; cursor: pointer; transition: background .15s; }
.wa-input__btn:hover { background: rgba(0, 0, 0, .06); }
.wa-input__btn--send { background: #0b5f55; color: #fff; }
.wa-input__btn--send:hover { background: #094a42; }

@media (max-width: 520px) {
  /* En un teléfono real no se dibuja otro teléfono: la pantalla ocupa todo el ancho, sin marco */
  .wa-device { --dev-r: 20px; --dev-metal: 0px; --dev-bezel: 0px; max-width: none; padding: 0; background: none; box-shadow: var(--sh-2, 0 10px 30px -14px rgba(10, 20, 30, .5)); }
  .wa-device::before, .wa-device::after { display: none; }
  .wa-status, .wa-home { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wa-row--new .wa-bubble, .wa-typing i { animation: none; }
}
