/* BORRADOR — chat de Morsi (asistente de NJ3D) */
.bot { position: fixed; right: 20px; bottom: 20px; z-index: 90; font-family: var(--sans); }
.bot__boton {
  position: relative; width: 68px; height: 68px; border-radius: 50%; padding: 0; cursor: pointer;
  background: #fff; border: 2px solid var(--verde);
  box-shadow: 0 12px 30px -8px rgba(13, 47, 26, .45);
  transition: transform .25s, box-shadow .25s;
}
.bot__boton:hover { transform: scale(1.07); }
.bot__boton img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.bot__boton::after { /* puntito de "en línea" */
  content: ""; position: absolute; right: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--lima); border: 2px solid #fff;
}
.bot__globo {
  position: absolute; right: 74px; top: 50%; translate: 0 -50%; white-space: nowrap;
  padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--profundo); color: #fff;
  font-size: .9rem; font-weight: 700; opacity: 0; scale: .9; pointer-events: none;
  transition: opacity .3s, scale .3s;
}
.bot.saluda:not(.abierto) .bot__globo { opacity: 1; scale: 1; }

.bot__panel {
  position: absolute; right: 0; bottom: 78px; width: min(370px, calc(100vw - 32px)); height: min(560px, calc(100vh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--fondo); border: 1px solid var(--borde); border-radius: 22px;
  box-shadow: 0 30px 70px -20px rgba(13, 47, 26, .5);
  animation: bot-entra .3s cubic-bezier(.2, .8, .2, 1);
}
.bot__panel[hidden] { display: none; }
@keyframes bot-entra { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.bot__cabeza { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--profundo); color: #fff; }
.bot__cabeza img { width: 42px; height: 42px; border-radius: 50%; background: #fff; padding: 0; object-fit: contain; }
.bot__cabeza div { flex: 1; display: grid; line-height: 1.2; }
.bot__cabeza b { font-family: var(--display); font-size: 1.05rem; }
.bot__cabeza small { font-size: .78rem; color: #bcd6bd; display: flex; align-items: center; gap: 6px; }
.bot__cabeza small i { width: 7px; height: 7px; border-radius: 50%; background: var(--lima); }
.bot__cabeza button {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.15rem; line-height: 1;
}
.bot__cabeza button:hover { background: rgba(255, 255, 255, .22); }
.bot__cabeza .bot__reiniciar { display: grid; place-items: center; }

.bot__mensajes { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.bot__msj { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: .93rem; line-height: 1.45; animation: bot-entra .25s; }
.bot__msj--bot { align-self: flex-start; background: #fff; color: var(--texto); border: 1px solid var(--borde); border-bottom-left-radius: 4px; }
.bot__msj--yo { align-self: flex-end; background: var(--oscuro); color: #fff; border-bottom-right-radius: 4px; }
.bot__tipeando { display: inline-flex; gap: 4px; padding: 2px 0; }
.bot__tipeando i { width: 7px; height: 7px; border-radius: 50%; background: var(--verde); animation: bot-punto 1s infinite; }
.bot__tipeando i:nth-child(2) { animation-delay: .15s; }
.bot__tipeando i:nth-child(3) { animation-delay: .3s; }
@keyframes bot-punto { 50% { transform: translateY(-4px); opacity: .4; } }

.bot__opciones { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; }
.bot__opciones:empty { display: none; }
.bot__opciones button, .bot__adjuntar {
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  font: 700 .88rem var(--sans); color: var(--acento);
  background: #fff; border: 1.5px solid var(--verde);
  transition: background .2s, color .2s;
}
.bot__opciones button:hover, .bot__adjuntar:hover { background: var(--oscuro); border-color: var(--oscuro); color: #fff; }
.bot__opciones--fila { flex-wrap: nowrap; gap: 6px; }
.bot__opciones--fila button { flex: 1 1 auto; min-width: 0; padding: 9px 10px; white-space: nowrap; }
@media (max-width: 640px) {
  .bot__opciones--fila { gap: 5px; padding-inline: 10px; }
  .bot__opciones--fila button { padding: 8px 6px; font-size: .8rem; }
}

.bot__escribir { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--borde); background: #fff; }
.bot__escribir[hidden] { display: none; }
.bot__escribir input { flex: 1; border: 1.5px solid var(--borde); border-radius: 999px; padding: 10px 14px; font: inherit; font-size: .93rem; }
.bot__escribir input:focus { outline: none; border-color: var(--verde); }
.bot__escribir button { width: 42px; border-radius: 50%; border: 0; background: var(--oscuro); color: #fff; cursor: pointer; }
.bot button:focus-visible { outline: 3px solid var(--verde); outline-offset: 2px; }

@media (max-width: 640px) {
  .bot { right: 14px; bottom: 14px; }
  .bot__panel { height: min(520px, calc(100vh - 110px)); }
}

/* modo oscuro */
:root[data-tema="oscuro"] .bot__msj--bot { background: var(--superficie); }
:root[data-tema="oscuro"] .bot__msj--yo, :root[data-tema="oscuro"] .bot__escribir button { background: #1f7a3c; }
:root[data-tema="oscuro"] .bot__opciones button, :root[data-tema="oscuro"] .bot__adjuntar { background: var(--superficie); }
:root[data-tema="oscuro"] .bot__opciones button:hover, :root[data-tema="oscuro"] .bot__adjuntar:hover { background: #1f7a3c; border-color: #1f7a3c; color: #fff; }
:root[data-tema="oscuro"] .bot__escribir { background: var(--superficie); }
:root[data-tema="oscuro"] .bot__escribir input { background: var(--fondo); color: var(--texto); }
:root[data-tema="oscuro"] .bot__panel { box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8); }
.bot__adjuntar { display: inline-flex; align-items: center; } /* label con el selector de archivos del comprobante */

/* ---------- PANTALLA COMPLETA (como un checkout): el chat tapa toda la página, en la compu y en el celular ---------- */
html.bot-abierto, html.bot-abierto body { overflow: hidden; }
.bot.abierto { inset: 0; right: 0; bottom: 0; z-index: 200; }
.bot.abierto .bot__boton { display: none; }
.bot.abierto .bot__panel {
  position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh;
  border: 0; border-radius: 0; box-shadow: none; animation: bot-pantalla .25s ease-out;
  --columna: max(14px, calc((100% - 720px) / 2)); /* en la compu el chat va en una columna centrada */
}
@keyframes bot-pantalla { from { opacity: 0; } }
.bot.abierto .bot__cabeza { padding: 14px var(--columna); padding-top: max(14px, env(safe-area-inset-top)); }
.bot.abierto .bot__mensajes { padding: 22px var(--columna); }
.bot.abierto .bot__opciones { padding: 0 var(--columna) 16px; }
.bot.abierto .bot__escribir { padding: 12px var(--columna); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.bot.abierto .bot__cerrar { font-size: 1.4rem; }
@media (min-width: 641px) {
  .bot.abierto .bot__msj { font-size: 1rem; max-width: 78%; }
  .bot.abierto .bot__cabeza img { width: 48px; height: 48px; }
}

/* ---------- MORSAS A LOS COSTADOS del chat en pantalla completa (solo en pantallas anchas, donde sobra lugar) ---------- */
.bot__decor { display: none; }
@media (min-width: 1100px) {
  .bot.abierto .bot__decor {
    display: block; position: absolute; top: 50%; pointer-events: none; user-select: none;
    width: min(300px, calc((100% - 720px) / 2 - 48px)); height: auto;
  }
  .bot.abierto .bot__decor--izq { left: calc((100% - 720px) / 4); translate: -50% -40%; width: min(220px, calc((100% - 720px) / 2 - 80px)); animation: bot-flota 3.6s ease-in-out infinite reverse; }
  .bot.abierto .bot__decor--der { right: calc((100% - 720px) / 4); translate: 50% -40%; width: min(220px, calc((100% - 720px) / 2 - 80px)); animation: bot-flota 3.2s ease-in-out infinite; }
}
@keyframes bot-flota { 50% { transform: translateY(-12px) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .bot.abierto .bot__decor { animation: none; } }
@media (min-width: 1100px) { .bot.abierto .bot__decor--izq, .bot.abierto .bot__decor--der { width: auto; height: min(240px, 30vh); } } /* mismo alto: las dos morsas se ven del mismo tamaño */
