/* ===== WhatsApp real, recreado para la demo de presupuestos ===== */
:root {
  --wa-verde: #00a884;
  --wa-verde-osc: #008069;
  --wa-verde-claro: #25d366;
  --wa-fondo: #efeae2;
  --wa-panel: #111b21;
  --wa-burbuja-cli: #d9fdd3;
  --wa-burbuja-bot: #ffffff;
  --wa-check: #53bdeb;
  --tinta: #111b21;
  --gris: #667781;
  --texto: #e9edef;
  --texto-suave: #8696a0;
  --linea: rgba(134, 150, 160, .22);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  height: 100dvh;
  min-height: 548px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(1100px 620px at 50% -12%, #14453a 0%, rgba(11, 20, 26, 0) 62%),
    radial-gradient(900px 500px at 92% 108%, rgba(0, 168, 132, .18) 0%, rgba(11, 20, 26, 0) 60%),
    #0b141a;
  color: var(--texto);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- cabecera de la página ---------- */
.cabecera {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(11, 20, 26, .55);
  backdrop-filter: blur(6px);
}
.marca { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.marca strong { font-weight: 700; }
.wa-logo { width: 21px; height: 21px; fill: var(--wa-verde-claro); flex: none; }
.cabecera-derecha { display: flex; align-items: center; gap: 18px; }
.senal { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--texto-suave); }
.senal i { width: 7px; height: 7px; border-radius: 50%; background: var(--wa-verde-claro); box-shadow: 0 0 0 3px rgba(37, 211, 102, .15); }
.tel { color: var(--texto); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.tel:hover { color: var(--wa-verde-claro); }

.aviso {
  flex: none;
  background: #3a2a12;
  color: #f1d9a8;
  font-size: 12.5px;
  padding: 8px 28px;
  border-bottom: 1px solid rgba(241, 217, 168, .18);
}

/* ---------- escena: casos + dos móviles ---------- */
.escena {
  flex: 1;
  min-height: 0;
  max-height: 800px;
  margin: auto 0;
  width: 100%;
  display: grid;
  grid-template-columns: 268px 348px 348px;
  grid-auto-rows: auto;
  gap: 34px;
  justify-content: center;
  align-items: start;
  padding: 18px 24px 10px;
}

.casos { align-self: start; padding-top: 25px; }
.casos h1 {
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.16;
  letter-spacing: -.02em;
  color: #fff;
  text-wrap: balance;
}
.casos p { margin: 0 0 16px; font-size: 12.5px; line-height: 1.5; color: #a8b8bf; }

.escenarios { display: flex; flex-direction: column; gap: 7px; }
.caso {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  color: var(--texto);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.caso:hover { background: rgba(0, 168, 132, .16); border-color: rgba(0, 168, 132, .6); transform: translateX(2px); }
.caso.activo { background: rgba(0, 168, 132, .2); border-color: var(--wa-verde-claro); }
.caso.activo .flecha { stroke: var(--wa-verde-claro); }
.caso:active { transform: scale(.99); }
.caso .ico {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(0, 168, 132, .18);
  color: var(--wa-verde-claro);
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.caso .txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.caso b { font-size: 12.8px; font-weight: 600; }
.caso small { font-size: 10.8px; color: var(--texto-suave); margin-top: 2px; }
.caso .flecha { width: 14px; height: 14px; margin-left: auto; fill: none; stroke: var(--texto-suave); stroke-width: 2; stroke-linecap: round; flex: none; }
.caso:hover .flecha { stroke: var(--wa-verde-claro); }

.reiniciar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  padding: 8px 10px;
  border: 1px solid rgba(239, 68, 68, .5);
  border-radius: 12px;
  background: rgba(239, 68, 68, .13);
  color: #fca5a5;
  font-size: 12.8px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.reiniciar .ico {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(239, 68, 68, .22);
  color: #fecaca;
}
.reiniciar .ico svg { width: 16px; height: 16px; fill: currentColor; }
.reiniciar:hover { background: rgba(239, 68, 68, .24); border-color: #ef4444; color: #fecaca; }
.reiniciar:active { transform: scale(.99); }

/* ---------- teléfono ---------- */
.telefono {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
}
.rol {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--texto-suave); font-weight: 600;
}
.movil {
  width: 340px;
  max-width: 100%;
  height: min(660px, calc(100dvh - 186px));
  min-height: 420px;
  background: #090e11;
  border-radius: 42px;
  padding: 8px;
  box-shadow:
    0 34px 70px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 255, 255, .1),
    inset 0 0 0 2px #1b2226;
}
.pantalla {
  position: relative;
  height: 100%;
  border-radius: 35px;
  overflow: hidden;
  background: var(--wa-fondo);
  color: var(--tinta);
  display: flex;
  flex-direction: column;
}

/* barra de estado */
.estado {
  flex: none;
  height: 26px;
  background: var(--wa-verde-osc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 14px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.estado-iconos { display: flex; align-items: center; gap: 4px; }
.estado-iconos svg { width: 12px; height: 12px; fill: currentColor; opacity: .95; }

/* cabecera del chat */
.wa-cab {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 8px;
  background: var(--wa-verde-osc);
  color: #fff;
}
.wa-cab .atras { width: 19px; height: 19px; fill: currentColor; flex: none; opacity: .95; }
.avatar {
  width: 35px; height: 35px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex: none;
}
.avatar-negocio { background: linear-gradient(145deg, #ff7a45, #e8410c); }
.avatar-bot { background: linear-gradient(145deg, #25d366, #008069); }
.quien { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.quien strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quien small { font-size: 10.5px; color: rgba(255, 255, 255, .82); }
.wa-acciones { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.wa-acciones svg { width: 17px; height: 17px; fill: currentColor; opacity: .95; }

/* ---------- chat ---------- */
.chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px 12px;
  background-color: var(--wa-fondo);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'><g fill='none' stroke='%23000' stroke-opacity='0.055' stroke-width='1.8' stroke-linecap='round'><path d='M14 30c7-10 22-8 25 3s-10 17-18 11'/><circle cx='150' cy='28' r='8'/><path d='M44 92l7 8 14-18'/><path d='M164 88c-6 11-19 11-23 0'/><path d='M22 150c9 0 14 8 12 15'/><path d='M116 144l8 8 8-8'/><rect x='78' y='20' width='24' height='16' rx='3'/><path d='M170 156l-8 14h16z'/><path d='M96 96c7-5 15 0 13 8'/><circle cx='52' cy='50' r='5'/><path d='M128 60h16v11h-16z'/><path d='M30 108c4 6 0 12-6 12'/><path d='M146 118l6-6 6 6-6 6z'/></g></svg>");
  background-size: 180px 180px;
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 27, 33, .25) transparent;
}
.chat::-webkit-scrollbar { width: 4px; }
.chat::-webkit-scrollbar-thumb { background: rgba(17, 27, 33, .22); border-radius: 4px; }

.burbuja {
  position: relative;
  max-width: 86%;
  padding: 5px 7px 6px;
  border-radius: 8px;
  font-size: 12.8px;
  line-height: 1.36;
  color: var(--tinta);
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .16);
  flex: none;
}
.burbuja.bot { align-self: flex-start; background: var(--wa-burbuja-bot); border-top-left-radius: 0; }
.burbuja.bot::before {
  content: ""; position: absolute; left: -7px; top: 0;
  border-style: solid; border-width: 0 8px 8px 0;
  border-color: transparent var(--wa-burbuja-bot) transparent transparent;
}
.burbuja.cliente { align-self: flex-end; background: var(--wa-burbuja-cli); border-top-right-radius: 0; }
.burbuja.cliente::after {
  content: ""; position: absolute; right: -7px; top: 0;
  border-style: solid; border-width: 8px 0 0 8px;
  border-color: transparent transparent transparent var(--wa-burbuja-cli);
}
.burbuja.sistema {
  align-self: center;
  max-width: 92%;
  background: #e1dbd0;
  color: #54656f;
  font-size: 10.8px;
  text-align: center;
  box-shadow: none;
  border-radius: 7px;
  padding: 4px 9px;
}
.burbuja.cifrado {
  align-self: center;
  max-width: 92%;
  background: #ffeecd; color: #54656f;
  font-size: 10.4px; line-height: 1.35; text-align: center;
}
.burbuja.cifrado b { color: #3b4a54; }
.burbuja img { max-width: 100%; border-radius: 6px; display: block; margin-bottom: 3px; }
.burbuja .hora {
  float: right;
  margin: 3px -1px -2px 8px;
  font-size: 9.8px;
  color: rgba(17, 27, 33, .45);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}
.burbuja .hora svg { width: 14px; height: 10px; fill: var(--wa-check); }

.escribiendo { display: inline-flex; gap: 4px; align-items: center; height: 15px; padding: 2px 2px; }
.escribiendo i { width: 6px; height: 6px; border-radius: 50%; background: #9aa3ad; animation: punto 1.1s infinite ease-in-out; }
.escribiendo i:nth-child(2) { animation-delay: .15s; }
.escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes punto { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

/* enlace al PDF dentro del chat */
.pdf {
  display: flex; align-items: center; gap: 7px;
  margin-top: 4px; padding: 7px 8px;
  background: #f0f2f5; border-radius: 7px;
  color: #027eb5; font-size: 12px; font-weight: 600; text-decoration: none;
}
.pdf:hover { background: #e7eaee; }
.pdf svg { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* ---------- redactor (cliente) ---------- */
.redactor {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px 8px;
}
.campo {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 44px;
  background: #fff;
  border-radius: 22px;
  padding: 0 4px;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13);
}
.campo input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 13.5px; color: var(--tinta);
  padding: 10px 3px;
  font-family: inherit;
}
.campo input::placeholder { color: #8a9297; }
.campo button {
  width: 32px; height: 32px; flex: none;
  border: 0; background: transparent; color: #54656f;
  display: grid; place-items: center; cursor: pointer; border-radius: 50%;
}
.campo button:hover { color: #111b21; }
.campo svg { width: 21px; height: 21px; fill: currentColor; }
.enviar {
  width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 50%;
  background: var(--wa-verde);
  color: #fff; display: grid; place-items: center;
  cursor: pointer; transition: background .15s;
}
.enviar svg { width: 20px; height: 20px; fill: currentColor; }
.enviar .ico-enviar { display: none; }
.enviar.con-texto .ico-mic { display: none; }
.enviar.con-texto .ico-enviar { display: block; }
.enviar:disabled { opacity: .55; cursor: default; }

/* barra del móvil del dueño: igual que la del cliente, sin escritura */
.redactor-dueno { opacity: .92; }
.redactor-dueno .campo input { color: #8a9297; }
.redactor-dueno .enviar { background: var(--wa-verde-osc); opacity: .8; }

/* indicador de gestos, como un Android real */
.gestos {
  flex: none;
  height: 15px;
  display: grid;
  place-items: center;
  background: var(--wa-fondo);
}
.gestos i { width: 96px; height: 3px; border-radius: 2px; background: rgba(17, 27, 33, .38); display: block; }

/* ---------- tarjeta del presupuesto (chat del dueño) ---------- */
.tarjeta {
  align-self: flex-start;
  max-width: 96%;
  background: #fff;
  border-radius: 9px;
  border-top-left-radius: 0;
  padding: 8px 9px 9px;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .16);
  flex: none;
  position: relative;
}
.tarjeta::before {
  content: ""; position: absolute; left: -7px; top: 0;
  border-style: solid; border-width: 0 8px 8px 0;
  border-color: transparent #fff transparent transparent;
}
.tp-cab { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.tp-cab .tp-ico {
  width: 24px; height: 24px; border-radius: 6px; flex: none;
  background: #e7f8f1; color: #008069; display: grid; place-items: center;
}
.tp-cab .tp-ico svg { width: 14px; height: 14px; fill: currentColor; }
.tp-cab b { font-size: 12.5px; }
.tp-cab em {
  margin-left: auto; font-style: normal;
  font-size: 8.8px; letter-spacing: .1em; text-transform: uppercase;
  color: #8a5300; background: #ffe6bd; border-radius: 4px; padding: 2px 6px;
}
.tp-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; margin-bottom: 7px; }
.tp-datos div { font-size: 9.8px; color: #4a5a63; line-height: 1.25; }
.tp-datos b { display: block; color: var(--tinta); font-size: 11px; font-weight: 600; }

.tabla { width: 100%; border-collapse: collapse; font-size: 11.2px; table-layout: fixed; }
.tabla col.c-nom { width: auto; }
.tabla col.c-cant { width: 26px; }
.tabla col.c-pre { width: 58px; }
.tabla col.c-imp { width: 66px; }
.tabla th {
  text-align: left; color: #3b4a54; font-weight: 600; font-size: 9px;
  text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid #e9edef; padding: 0 3px 4px;
}
.tabla td { padding: 5px 3px; border-bottom: 1px solid #f1f3f4; vertical-align: middle; }
.tabla td.num, .tabla th.num { text-align: right; }
.tabla td.imp { border-left: 1px solid #f1f3f4; padding-left: 5px; }
.tabla td.nom { line-height: 1.3; }
.tabla input {
  width: 56px; text-align: right;
  border: 1px solid #d7dde1; border-radius: 5px;
  padding: 3px 4px; font-size: 11.2px; color: var(--tinta);
  background: #fbfcfc; font-family: inherit;
}
.tabla input:focus { outline: 2px solid rgba(0, 168, 132, .3); border-color: var(--wa-verde); }

.totales { margin-top: 7px; font-size: 11.4px; }
.totales div { display: flex; justify-content: space-between; padding: 1.5px 0; color: var(--gris); }
.totales .total { color: var(--tinta); font-weight: 700; font-size: 13px; border-top: 1px solid #e9edef; margin-top: 3px; padding-top: 4px; }
.totales .total span:last-child { color: #008069; }

.nota {
  margin-top: 6px; background: #fff8e8; border: 1px solid #f0dca8; color: #6b4e12;
  font-size: 10.2px; padding: 5px 7px; border-radius: 6px; line-height: 1.35;
}

.acciones { display: flex; gap: 6px; margin-top: 9px; }
.principal {
  flex: 1; border: 0; border-radius: 18px;
  background: var(--wa-verde-osc); color: #fff;
  padding: 8px 10px; font-size: 11.6px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.principal:hover { filter: brightness(1.08); }
.principal:disabled { opacity: .55; cursor: default; }
.corregir {
  border: 1px solid #008069; background: #fff; color: #008069;
  border-radius: 18px; padding: 8px 11px; font-size: 11.2px; font-weight: 600;
  cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 4px;
}
.corregir svg { width: 12px; height: 12px; fill: currentColor; }
.corregir:hover { border-color: #8696a0; color: var(--tinta); }
.hora-tarjeta { display: block; text-align: right; font-size: 9.8px; color: rgba(17, 27, 33, .45); margin-top: 5px; }

.enviado { text-align: center; padding: 2px 0 0; }
.enviado .sello {
  width: 34px; height: 34px; border-radius: 50%;
  background: #e7f8f1; color: #008069; display: grid; place-items: center;
  margin: 0 auto 5px; font-size: 17px;
}
.enviado h3 { margin: 0 0 2px; font-size: 12.5px; }
.enviado p { margin: 0 0 6px; color: var(--gris); font-size: 10.8px; }
.enviado .pdf { justify-content: center; }

.lead { margin-top: 8px; border-top: 1px solid #e9edef; padding-top: 7px; text-align: left; }
.lead p { margin: 0 0 5px; font-size: 10.5px; color: var(--gris); }
.lead .legal { margin: 2px 0 4px; font-size: 9px; line-height: 1.3; }
.lead .legal a { color: var(--wa-verde-osc); }
.pie a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.lead input {
  width: 100%; border: 1px solid #d7dde1; border-radius: 6px;
  padding: 6px 7px; font-size: 11px; margin-bottom: 5px;
  background: #fbfcfc; color: var(--tinta); font-family: inherit;
}
.lead button {
  width: 100%; background: #111b21; color: #fff; border: 0; border-radius: 6px;
  padding: 7px; font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit;
}

/* ---------- pie ---------- */
.pie {
  flex: none;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 0 28px 14px;
  color: #5f6f76; font-size: 10.5px;
}

/* ---------- adaptación ---------- */
@media (max-width: 1120px) {
  .escena { grid-template-columns: 240px 320px 320px; gap: 22px; }
  .movil { width: 320px; }
}
@media (max-width: 980px) {
  html, body { height: auto; }
  body { display: block; min-height: 100dvh; overflow-x: hidden; overflow-y: auto; }
  .escena { display: block; height: auto; min-height: 0; max-height: none; margin: 0; padding: 18px 16px 8px; }
  .casos { max-width: 560px; width: 100%; margin: 0 auto 22px; padding-top: 0; }
  .escenarios { display: grid; grid-template-columns: 1fr 1fr; }
  .casos h1 { font-size: 22px; }
  .telefono { height: auto; margin: 0 auto 22px; }
  .movil { height: min(600px, 68dvh); min-height: 360px; }
  .cabecera { padding: 10px 16px; }
  .senal { display: none; }
  .pie { flex-direction: column; padding: 0 16px 16px; }
}
@media (max-width: 560px) {
  .marca .sufijo { display: none; }
  .marca { font-size: 13px; }
  .tel { font-size: 12px; white-space: nowrap; }
  .cabecera { gap: 10px; }
}
@media (max-width: 420px) {
  .movil { width: 100%; height: 72dvh; border-radius: 30px; padding: 6px; }
  .pantalla { border-radius: 26px; }
  .escenarios { grid-template-columns: 1fr; }
}
