/* asistente.css — chat flotante del Rotary. Usa los tokens de rotary.css (que ya cambian
   con html[data-theme="dark"]); los valores tras la coma son respaldo.
   Capas: barra de accesibilidad 9998/9999; el chat va encima (10000). */

/* Botón: esquina inferior derecha, sobre el contenido y bajo el lightbox (9999) */
.asi-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 500;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--azure, #0050a2);
  color: #fff;
  font: 600 15px/1 var(--font, system-ui, sans-serif);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 80, 162, .4), 0 2px 6px rgba(0, 0, 0, .2);
  transition: transform .18s ease, background .2s ease;
}
.asi-fab[hidden] { display: none; }
.asi-fab:hover { background: var(--azure-700, #003f80); transform: translateY(-2px); }
.asi-fab:focus-visible { outline: 3px solid var(--gold, #f7a81b); outline-offset: 3px; }
.asi-fab-ico { margin-right: 4px; }
.asi-fab-acento { color: var(--gold, #f7a81b); font-weight: 800; }
/* En modo oscuro el azul se pierde contra el fondo navy: un borde claro lo separa */
html[data-theme="dark"] .asi-fab { box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 6px 20px rgba(0, 0, 0, .5); }

/* Panel */
.asi-panel {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--white, #fff);
  color: var(--ink, #14233b);
  font-family: var(--font, system-ui, sans-serif);
  font-size: 16px;
  line-height: 1.45;
}
.asi-panel[hidden] { display: none; }
@supports (height: 100dvh) {
  .asi-panel { height: 100dvh; bottom: auto; }
}
@media (min-width: 641px) {
  .asi-panel {
    left: auto;
    width: 400px;
    max-width: 100vw;
    border-left: 1px solid var(--line, #dde4ee);
    box-shadow: -12px 0 40px rgba(20, 35, 59, .22);
  }
}
html.asi-bloqueo, html.asi-bloqueo body { overflow: hidden; }

.asi-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--azure, #0050a2);
  color: #fff;
}
html[data-theme="dark"] .asi-cab { background: var(--azure-900, #002a57); }
.asi-titulo { margin: 0; color: #fff; font-size: 17px; font-weight: 700; line-height: 1.2; }
.asi-cerrar, .asi-visor-cerrar {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.asi-cerrar:hover, .asi-visor-cerrar:hover { background: rgba(255, 255, 255, .3); }
.asi-cerrar:focus-visible, .asi-visor-cerrar:focus-visible { outline: 3px solid var(--gold, #f7a81b); outline-offset: 2px; }

/* Mensajes */
.asi-mensajes {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--paper, #f6f8fb);
}
.asi-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  overflow-wrap: anywhere;
}
.asi-texto { white-space: pre-wrap; }
.asi-bot {
  align-self: flex-start;
  background: var(--paper-2, #eef2f7);
  color: var(--ink, #14233b);
  border: 1px solid var(--line, #dde4ee);
  border-bottom-left-radius: 4px;
}
.asi-user {
  align-self: flex-end;
  background: var(--azure, #0050a2);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.asi-bot a { color: var(--azure, #0050a2); text-decoration: underline; font-weight: 600; }
html[data-theme="dark"] .asi-bot a { color: var(--gold, #f7a81b); }
.asi-escribiendo { color: var(--muted, #6b7c93); font-style: italic; }
.asi-escribiendo[hidden] { display: none; }

/* Chips */
.asi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 0;
  background: var(--paper, #f6f8fb);
}
.asi-chips[hidden] { display: none; }
.asi-chip {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--azure, #0050a2);
  border-radius: 999px;
  background: var(--white, #fff);
  color: var(--azure, #0050a2);
  font: 600 14px/1.2 var(--font, system-ui, sans-serif);
  cursor: pointer;
}
html[data-theme="dark"] .asi-chip { border-color: var(--gold, #f7a81b); color: var(--gold, #f7a81b); }
.asi-chip:hover { background: var(--paper-2, #eef2f7); }
.asi-chip:focus-visible { outline: 3px solid var(--gold, #f7a81b); outline-offset: 2px; }

/* Entrada */
.asi-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px 6px;
  background: var(--paper, #f6f8fb);
}
.asi-input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line, #dde4ee);
  border-radius: 12px;
  background: var(--white, #fff);
  color: var(--ink, #14233b);
  font: 16px var(--font, system-ui, sans-serif); /* 16px evita el zoom de iOS */
}
.asi-input:focus-visible { outline: 3px solid var(--azure, #0050a2); outline-offset: 1px; }
html[data-theme="dark"] .asi-input:focus-visible { outline-color: var(--gold, #f7a81b); }
.asi-enviar {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--azure, #0050a2);
  color: #fff;
  font: 700 15px var(--font, system-ui, sans-serif);
  cursor: pointer;
}
.asi-enviar:focus-visible { outline: 3px solid var(--gold, #f7a81b); outline-offset: 2px; }
.asi-enviar:disabled, .asi-input:disabled { opacity: .6; cursor: not-allowed; }
.asi-aviso {
  margin: 0;
  padding: 4px 16px 12px;
  background: var(--paper, #f6f8fb);
  color: var(--muted, #6b7c93);
  font-size: 12.5px;
  text-align: center;
}

/* Imágenes y ubicación */
.asi-imagenes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.asi-mini {
  padding: 0;
  border: 1px solid var(--line, #dde4ee);
  border-radius: 10px;
  background: none;
  overflow: hidden;
  cursor: zoom-in;
}
.asi-mini img { display: block; width: 96px; height: 72px; object-fit: cover; }
.asi-mini:focus-visible { outline: 3px solid var(--gold, #f7a81b); outline-offset: 2px; }
.asi-ubicacion { margin-top: 8px; }
.asi-ruta { margin: 0 0 8px; white-space: pre-wrap; }
.asi-mapas { display: flex; flex-wrap: wrap; gap: 8px; }
.asi-bot a.asi-mapa {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--azure, #0050a2);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}
html[data-theme="dark"] .asi-bot a.asi-mapa { background: var(--gold, #f7a81b); color: #14233b; }
.asi-bot a.asi-mapa:focus-visible { outline: 3px solid var(--gold, #f7a81b); outline-offset: 2px; }

/* Visor a pantalla completa con zoom (pellizco) */
.asi-visor {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(8, 20, 38, .95);
}
.asi-visor[hidden] { display: none; }
.asi-visor-cerrar { position: absolute; top: 12px; right: 12px; z-index: 1; background: rgba(255, 255, 255, .25); }
.asi-visor-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
  display: flex;
  touch-action: pinch-zoom;
  -webkit-overflow-scrolling: touch;
}
.asi-visor-img {
  display: block;
  margin: auto;
  max-width: none;   /* tamaño natural: se recorre con scroll y se amplía con el pellizco */
}

/* En celular la pestaña de accesibilidad (56px) baja a la esquina: el chat va a su izquierda */
@media (max-width: 560px) {
  .asi-fab { right: 72px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .asi-fab { transition: none; }
}

/* Páginas de la rifa: el modal de reserva (z-index 200) queda debajo del botón (501) y sus botones
   de abajo a la derecha quedarían tapados en el celular; se oculta el botón mientras el modal está abierto. */
body:has(.modal-wrap) .asi-fab { display: none; }
