/* Asistente 100ia — botón con forma de bot + panel de chat. Usa las variables de estilos.css */
.bot-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botón flotante ---------- */
.bot-lanzador {
  position: fixed; right: clamp(14px, 2vw, 24px); bottom: clamp(14px, 2vw, 24px); z-index: 950;
  width: 68px; height: 68px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--rojo-texto, #B3302A); color: #fff;
  border: 3px solid var(--papel, #E6E2DB);
  box-shadow: 0 12px 28px -8px rgba(28,27,26,.55), 0 0 0 1.5px var(--rojo-texto, #B3302A);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), background .2s ease;
  animation: bot-entrar .6s cubic-bezier(.34,1.56,.64,1) .8s both;
}
.bot-lanzador .bot-cara { width: 40px; height: 40px; }
.bot-lanzador:hover, .bot-lanzador:focus-visible { transform: translateY(-4px) rotate(-6deg) scale(1.05); background: var(--tinta, #1C1B1A); }
.bot-lanzador:focus-visible { outline: 3px solid var(--foco, #0B57D0); outline-offset: 4px; }
.bot-lanzador[aria-expanded="true"] { transform: scale(.9); }
.bot-lanzador-txt {           /* etiqueta que aparece al pasar el cursor o con teclado */
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translate(8px, -50%);
  white-space: nowrap; pointer-events: none; opacity: 0;
  background: var(--tinta, #1C1B1A); color: var(--papel, #E6E2DB); font: 700 .85rem/1 var(--sans, system-ui);
  padding: .55rem .8rem; border-radius: 999px; transition: opacity .2s ease, transform .3s ease;
}
.bot-lanzador:hover .bot-lanzador-txt, .bot-lanzador:focus-visible .bot-lanzador-txt { opacity: 1; transform: translate(0, -50%); }
.bot-lanzador[aria-expanded="true"] .bot-lanzador-txt { opacity: 0; }
@keyframes bot-entrar { from { transform: scale(0) rotate(-30deg); opacity: 0; } }

/* La cara del bot */
.bot-cara .bot-visor { fill: var(--papel-claro, #F2EFEA); }
.bot-cara .bot-ojo { fill: var(--tinta, #1C1B1A); transform-box: fill-box; transform-origin: center; animation: bot-pestanear 5s infinite; }
.bot-cara .bot-boca { stroke: var(--tinta, #1C1B1A); }
.bot-cara .bot-antena { transform-box: fill-box; transform-origin: center; animation: bot-antena 2.4s ease-in-out infinite; }
@keyframes bot-pestanear { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes bot-antena { 50% { transform: scale(1.35); } }

/* ---------- Panel ---------- */
.bot-panel[hidden] { display: none !important; }
.bot-panel {
  position: fixed; right: clamp(14px, 2vw, 24px); bottom: calc(clamp(14px, 2vw, 24px) + 80px); z-index: 960;
  width: min(400px, calc(100vw - 28px)); height: min(620px, calc(100vh - 120px));
  display: flex; flex-direction: column;
  background: var(--papel, #E6E2DB); color: var(--tinta, #1C1B1A);
  border: 1.5px solid var(--tinta, #1C1B1A); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(28,27,26,.5);
  font-family: var(--sans, system-ui); font-size: 1rem;
  animation: bot-abrir .35s cubic-bezier(.2,.8,.2,1) both; transform-origin: bottom right;
}
@keyframes bot-abrir { from { opacity: 0; transform: translateY(12px) scale(.96); } }

.bot-cab { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--rojo-texto, #B3302A); color: #fff; }
.bot-avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--rojo-texto, #B3302A); display: grid; place-items: center; }
.bot-avatar .bot-cara { width: 30px; height: 30px; }
.bot-cab-txt { flex: 1; min-width: 0; }
.bot-titulo { margin: 0; font-family: var(--display, sans-serif); font-weight: 900; font-stretch: 78%; font-variation-settings: "wdth" 78; font-size: 1.45rem; line-height: 1; letter-spacing: .01em; }
.bot-sub { margin: 2px 0 0; font-size: .82rem; opacity: .92; }
.bot-icono-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1.5px solid rgba(255,255,255,.7); border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.bot-icono-btn svg { width: 22px; height: 22px; }
.bot-icono-btn:hover { background: rgba(255,255,255,.18); }
.bot-icono-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
#bot-voz[aria-pressed="false"] .bot-ondas { opacity: .25; }
#bot-voz[aria-pressed="true"] { background: #fff; color: var(--rojo-texto, #B3302A); }

.bot-mensajes { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.bot-mensajes:focus-visible { outline: 3px solid var(--foco, #0B57D0); outline-offset: -3px; }
.bot-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; line-height: 1.45; font-size: .97rem; overflow-wrap: anywhere; }
.bot-msg p { margin: 0 0 .45em; } .bot-msg p:last-child { margin-bottom: 0; }
.bot-msg ul { margin: .3em 0; padding-left: 1.1rem; }
.bot-msg a { color: var(--rojo-texto, #B3302A); font-weight: 700; }
.bot-msg-bot { align-self: flex-start; background: var(--papel-claro, #F2EFEA); border: 1px solid var(--linea, #C9C3B9); border-bottom-left-radius: 4px; }
.bot-msg-usuario { align-self: flex-end; background: var(--tinta, #1C1B1A); color: var(--papel, #E6E2DB); border-bottom-right-radius: 4px; }
.bot-msg-acciones { display: flex; gap: 6px; margin-top: 6px; }
.bot-mini { font: inherit; font-size: .78rem; font-weight: 700; min-height: 32px; padding: 0 .7rem; border-radius: 999px; border: 1px solid var(--linea-fuerte, #8F887D); background: transparent; color: var(--tinta-cuerpo, #3A3835); cursor: pointer; }
.bot-mini:hover { border-color: var(--tinta, #1C1B1A); color: var(--tinta, #1C1B1A); }
.bot-sugerencias { display: flex; flex-wrap: wrap; gap: 6px; }
.bot-sugerencias button { font: inherit; font-size: .86rem; text-align: left; min-height: 40px; padding: .4rem .8rem; border-radius: 999px; border: 1.5px solid var(--tinta, #1C1B1A); background: transparent; color: var(--tinta, #1C1B1A); cursor: pointer; }
.bot-sugerencias button:hover { background: var(--tinta, #1C1B1A); color: var(--papel, #E6E2DB); }
.bot-pensando { align-self: flex-start; display: inline-flex; gap: 5px; padding: 12px 14px; border-radius: 14px; background: var(--papel-claro, #F2EFEA); border: 1px solid var(--linea, #C9C3B9); }
.bot-pensando i { width: 7px; height: 7px; border-radius: 50%; background: var(--rojo, #E5483B); animation: bot-punto 1s infinite; }
.bot-pensando i:nth-child(2) { animation-delay: .15s; } .bot-pensando i:nth-child(3) { animation-delay: .3s; }
@keyframes bot-punto { 50% { transform: translateY(-5px); opacity: .5; } }

.bot-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1.5px solid var(--tinta, #1C1B1A); background: var(--papel-claro, #F2EFEA); }
.bot-form textarea { flex: 1; min-width: 0; min-height: 46px; max-height: 120px; resize: none; padding: .7rem .8rem; font: inherit; font-size: 1rem; line-height: 1.35;
  color: var(--tinta, #1C1B1A); background: var(--papel, #E6E2DB); border: 1.5px solid var(--linea-fuerte, #8F887D); border-radius: 12px; }
.bot-form textarea:focus-visible { outline: 3px solid var(--foco, #0B57D0); outline-offset: 1px; }
.bot-btn { flex: none; width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border-radius: 50%; cursor: pointer; border: 1.5px solid var(--tinta, #1C1B1A); }
.bot-btn svg { width: 22px; height: 22px; }
.bot-btn:focus-visible { outline: 3px solid var(--foco, #0B57D0); outline-offset: 2px; }
.bot-mic { background: transparent; color: var(--tinta, #1C1B1A); }
.bot-mic[aria-pressed="true"] { background: var(--rojo-texto, #B3302A); border-color: var(--rojo-texto, #B3302A); color: #fff; animation: bot-escuchando 1.2s ease-in-out infinite; }
@keyframes bot-escuchando { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--rojo, #E5483B) 30%, transparent); } }
.bot-enviar { background: var(--tinta, #1C1B1A); color: var(--papel, #E6E2DB); }
.bot-enviar:hover { background: var(--rojo-texto, #B3302A); border-color: var(--rojo-texto, #B3302A); color: #fff; }
.bot-pie { margin: 0; padding: 6px 14px 10px; font-size: .74rem; color: var(--tinta-suave, #55524D); background: var(--papel-claro, #F2EFEA); }

/* Celular: el panel ocupa toda la pantalla */
@media (max-width: 560px) {
  .bot-panel { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; }
  .bot-lanzador { width: 60px; height: 60px; }
  .bot-lanzador .bot-cara { width: 34px; height: 34px; }
  .bot-abierto .bot-lanzador { display: none; }
}

/* Alto contraste y sin animaciones (opciones del panel de accesibilidad) */
.alto-contraste .bot-lanzador, .alto-contraste .bot-cab { background: #FFEB3B; color: #000; border-color: #000; }
.alto-contraste .bot-cab .bot-icono-btn { color: #000; border-color: #000; }
.alto-contraste .bot-avatar { background: #000; color: #FFEB3B; }
.alto-contraste .bot-msg-usuario { background: #fff; color: #000; }
.acc-sin-animacion .bot-lanzador, .acc-sin-animacion .bot-panel, .acc-sin-animacion .bot-cara * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .bot-lanzador, .bot-panel, .bot-cara * { animation: none !important; } }
@media print { .bot { display: none; } }

/* ---------- Imagen del bot 100ia (reemplaza la cara dibujada) ---------- */
.bot-cara { display: block; }
.bot-cara img { display: block; width: 100%; height: 100%; object-fit: contain; }
.bot-lanzador { background: var(--papel-claro, #F2EFEA); border: 3px solid var(--rojo-texto, #B3302A);
  box-shadow: 0 12px 28px -8px rgba(28,27,26,.55); overflow: visible; }
.bot-lanzador .bot-cara { width: 58px; height: 58px; margin-top: -4px;
  animation: bot-flotar 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
.bot-lanzador:hover, .bot-lanzador:focus-visible { background: #fff; }
.bot-lanzador:hover .bot-cara, .bot-lanzador:focus-visible .bot-cara { animation: bot-saludo .6s ease-in-out 2; }
@keyframes bot-flotar { 50% { transform: translateY(-3px); } }
@keyframes bot-saludo { 25% { transform: rotate(-12deg); } 75% { transform: rotate(10deg); } }
.bot-avatar { background: #fff; }
.bot-avatar .bot-cara { width: 36px; height: 36px; }
@media (max-width: 560px) { .bot-lanzador .bot-cara { width: 50px; height: 50px; } }
.alto-contraste .bot-lanzador { background: #FFEB3B; border-color: #000; }
.alto-contraste .bot-avatar { background: #FFEB3B; }
.acc-sin-animacion .bot-lanzador .bot-cara { animation: none !important; }
.acc-sin-imagenes .bot-cara img { visibility: visible; }   /* el bot es el botón: siempre visible */
@media (prefers-reduced-motion: reduce) { .bot-lanzador .bot-cara { animation: none !important; } }
/* bot más grande: la sirena asoma sobre el borde del círculo */
.bot-lanzador .bot-cara { width: 72px; height: 72px; margin-top: -14px; }
.bot-avatar { overflow: hidden; }
.bot-avatar .bot-cara { width: 42px; height: 42px; margin-top: 2px; }
@media (max-width: 560px) { .bot-lanzador .bot-cara { width: 64px; height: 64px; margin-top: -12px; } }

/* =========================================================
   Botón "Servicios cercanos" (baños accesibles): home y panel de accesibilidad.
   Está aquí porque bot.css se carga en todas las páginas.
   ========================================================= */
.cerca-boton { display: inline-flex; align-items: center; gap: 14px; margin: 0 0 clamp(22px, 3vw, 36px);
  min-height: 64px; padding: 10px 22px 10px 12px; border-radius: 999px; text-decoration: none; box-sizing: border-box;
  background: var(--tinta, #1C1B1A); color: var(--papel, #E6E2DB); border: 2px solid var(--tinta, #1C1B1A);
  font-family: var(--sans, system-ui);
  box-shadow: 0 14px 28px -16px rgba(28,27,26,.6); transition: transform .3s cubic-bezier(.2,.8,.2,1), background .2s ease; }
.cerca-boton:hover, .cerca-boton:focus-visible { transform: translateY(-3px); background: var(--rojo-texto, #B3302A); border-color: var(--rojo-texto, #B3302A); color: #fff; }
.cerca-boton:focus-visible { outline: 3px solid var(--foco, #0B57D0); outline-offset: 3px; }
.cerca-icono { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--rojo-texto, #B3302A); color: #fff; }
.cerca-boton:hover .cerca-icono, .cerca-boton:focus-visible .cerca-icono { background: #fff; color: var(--rojo-texto, #B3302A); }
.cerca-icono svg { width: 24px; height: 24px; position: relative; z-index: 1; }
.cerca-pulso { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--rojo, #E5483B); animation: cerca-pulso 2.2s ease-out infinite; }
@keyframes cerca-pulso { from { transform: scale(1); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
.cerca-textos { display: grid; line-height: 1.15; text-align: left; }
.cerca-textos strong { font-size: 1.1rem; }
.cerca-textos span { font-size: .9rem; opacity: .85; }
.cerca-flecha { font-size: 1.3rem; font-weight: 700; margin-left: auto; padding-left: 4px; transition: transform .3s ease; }
.cerca-boton:hover .cerca-flecha { transform: translateX(4px); }
.cerca-boton[aria-busy="true"] .cerca-textos span::after { content: " · buscando tu ubicación…"; }
/* versión del panel de accesibilidad: ancho completo, arriba de "Tamaño del texto" */
.cerca-panel { display: flex; width: 100%; margin: 0 0 14px; min-height: 58px; padding: 8px 16px 8px 8px; box-shadow: none; }
.cerca-panel .cerca-icono { width: 40px; height: 40px; }
.cerca-panel .cerca-textos strong { font-size: 1rem; }
.cerca-panel .cerca-textos span { font-size: .82rem; }
.acc-sin-animacion .cerca-pulso { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .cerca-pulso { animation: none; opacity: 0; } }
.alto-contraste .cerca-boton { background: #000; color: #FFEB3B; border-color: #FFEB3B; }
.alto-contraste .cerca-icono { background: #FFEB3B; color: #000; }
@media (max-width: 620px) { .cerca-boton { width: 100%; } }
/* versión de la cabecera, al lado del botón Menú: mismo alto que los botones de la barra */
.cerca-cab { margin: 0; min-height: 44px; padding: 3px 16px 3px 3px; gap: 10px; box-shadow: none; }
.cerca-cab .cerca-icono { width: 36px; height: 36px; }
.cerca-cab .cerca-icono svg { width: 20px; height: 20px; }
.cerca-cab .cerca-textos strong { font-size: .92rem; }
.cerca-cab .cerca-textos span { font-size: .74rem; }
@media (max-width: 1100px) {                                                      /* tablet y celular: solo el ícono */
  .cerca-cab { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .cerca-cab .cerca-textos { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cerca-cab .cerca-icono { width: 40px; height: 40px; }
}

/* =========================================================
   Celular y tablet: el botón de accesibilidad flota al centro del costado derecho
   y el del asistente 100ia queda siempre abajo (así nunca se tapan).
   ========================================================= */
@media (max-width: 960px) {
  .acc-ui .acc-flotante {
    position: fixed; right: 10px; left: auto;
    top: calc(50% - 26px); bottom: auto;
    z-index: 940;            /* bajo el panel del bot (960) y sobre el contenido */
  }
  .bot-lanzador { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); right: 14px; }   /* respeta la barra del iPhone */
}
