/* ==================================================================
   ASISTENTE (FAQ bot) de Fisiokine Vet — estilos de bot.js
   Usa los tokens de estilos.css (se carga después).
   ================================================================== */
.bot { position: fixed; left: 16px; bottom: calc(var(--flotantes-abajo, 16px) + env(safe-area-inset-bottom, 0px)); z-index: 97; }
.bot--abierto { z-index: 130; }
.bot__fab {
  position: relative; display: grid; place-items: center; width: 62px; height: 62px; padding: 0; border-radius: 50%;
  border: 3px solid var(--superficie); background: var(--agua); box-shadow: 0 14px 28px -10px rgba(31, 107, 88, .7);
  transition: transform .35s var(--rebote);
  animation: bot-flota 5s ease-in-out infinite;
}
.bot__fab:hover { transform: scale(1.08) rotate(6deg); }
.bot__fab-logo { width: 100%; height: 100%; }
.bot__fab-punto { position: absolute; right: 0; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #22c55e; border: 2px solid var(--superficie); }
.bot--abierto .bot__fab { animation: none; }
@keyframes bot-flota { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

.bot__saludo {
  position: absolute; left: 0; bottom: 76px; display: flex; align-items: flex-start; gap: 4px; width: max-content; max-width: min(300px, calc(100vw - 32px));
  padding: 6px 6px 6px 4px; border-radius: 20px 20px 20px 6px; background: var(--superficie); border: 1px solid var(--borde); box-shadow: var(--sombra-grande);
  opacity: 0; transform: translateY(12px) scale(.9); transform-origin: bottom left; transition: opacity .3s, transform .45s var(--rebote);
}
.bot__saludo.visible { opacity: 1; transform: none; }
.bot__saludo-texto { border: 0; background: none; text-align: left; padding: 8px 10px; font-weight: 600; font-size: .92rem; line-height: 1.35; color: var(--texto); min-height: 44px; }
.bot__saludo-cerrar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; background: none; color: var(--texto-2); border-radius: 50%; }
.bot__saludo-cerrar .ico { width: 16px; height: 16px; }

.bot__panel {
  position: absolute; left: 0; bottom: 78px; display: flex; flex-direction: column;
  width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100vh - 120px - var(--flotantes-abajo, 16px))); height: min(640px, calc(100dvh - 120px - var(--flotantes-abajo, 16px)));
  border-radius: 26px; overflow: hidden; background: var(--superficie); border: 1px solid var(--borde); box-shadow: var(--sombra-grande);
  opacity: 0; transform: translateY(16px) scale(.96); transform-origin: bottom left; transition: opacity .25s, transform .4s var(--rebote);
}
.bot__panel[hidden] { display: none; }
.bot__panel.abierto { opacity: 1; transform: none; }
.bot__cabeza { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; color: #fff; background: linear-gradient(135deg, #1f6b58 0%, var(--violeta-osc) 100%); }
.bot__cabeza-logo { width: 44px; height: 44px; flex: none; border-radius: 50%; background: #fff; padding: 2px; }
.bot__cabeza-logo .logo-fk { width: 100%; height: 100%; }
.bot__cabeza-texto { flex: 1; min-width: 0; line-height: 1.25; }
.bot__cabeza h2 { font-size: 1.08rem; margin: 0; }
.bot__cabeza p { margin: 0; font-size: .75rem; color: #e7fbf5; }
.bot__icono { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; }
.bot__icono:hover { background: rgba(255, 255, 255, .26); }
.bot__icono .ico { width: 20px; height: 20px; }
.bot__icono:focus-visible { outline-color: #fff; }
.bot__temas { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px; border-bottom: 1px solid var(--borde); background: var(--fondo-lavanda); scrollbar-width: thin; flex: none; }
.bot__tema { display: inline-flex; align-items: center; gap: .35em; flex: none; min-height: 40px; padding: 4px 12px 4px 8px; border-radius: 999px; border: 1.5px solid var(--borde-fuerte); background: var(--superficie); font-size: .8rem; font-weight: 600; color: var(--texto); }
.bot__tema .ico { width: 16px; height: 16px; color: var(--agua-texto); }
.bot__tema:hover { border-color: var(--agua-texto); }
.bot__mensajes { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.bot__msg { max-width: 92%; padding: 10px 14px; border-radius: 18px; font-size: .92rem; line-height: 1.5; animation: bot-msg .35s var(--ease) both; }
.bot__msg p { margin: 0 0 6px; }
.bot__msg p:last-child { margin-bottom: 0; }
.bot__msg--bot { align-self: flex-start; background: var(--fondo-lavanda); border: 1px solid var(--borde); border-bottom-left-radius: 6px; }
.bot__msg--yo { align-self: flex-end; background: var(--violeta-osc); color: #fff; border-bottom-right-radius: 6px; }
@keyframes bot-msg { from { opacity: 0; transform: translateY(8px); } }
.bot__tema-etiqueta { display: inline-flex; align-items: center; gap: .3em; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--agua-texto); }
.bot__tema-etiqueta .ico { width: 14px; height: 14px; }
.bot__q { font-weight: 700; font-family: var(--fuente-titulo); font-size: 1.02rem; }
.bot__acciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bot__accion { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .85rem; text-decoration: none; color: #fff !important; background: var(--violeta-osc); }
.bot__accion .ico { width: 18px; height: 18px; }
.bot__accion--wa { background: #177a44; }
.bot__accion--nutri { background: #1f6b58; }
.bot__accion--mapa { background: #b3164f; }
.bot__accion:hover { filter: brightness(1.1); }
.bot__relacionadas { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--borde-fuerte); }
.bot__relacionadas > p { font-size: .75rem !important; font-weight: 700; color: var(--texto-2); margin-bottom: 4px !important; }
.bot__relacionadas ul, .bot__lista { display: grid; gap: 4px; }
.bot__pregunta { width: 100%; min-height: 44px; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--borde); background: var(--superficie); text-align: left; font-size: .85rem; color: var(--violeta-texto); font-weight: 600; line-height: 1.3; }
.bot__pregunta:hover { border-color: var(--violeta); background: color-mix(in srgb, var(--violeta) 8%, var(--superficie)); }
.bot__lista { margin: 6px 0; }
.bot__ver-mas { min-height: 44px; border: 0; background: none; color: var(--agua-texto); font-weight: 700; text-decoration: underline; padding: 0 4px; }
.bot__escribiendo { display: inline-flex; align-items: center; gap: 4px; }
.bot__escribiendo span { width: 7px; height: 7px; border-radius: 50%; background: var(--agua-texto); animation: bot-punto 1s infinite; }
.bot__escribiendo span:nth-child(2) { animation-delay: .15s; }
.bot__escribiendo span:nth-child(3) { animation-delay: .3s; }
.bot__escribiendo em { margin-left: 6px; font-size: .78rem; color: var(--texto-2); }
@keyframes bot-punto { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.bot__form { display: flex; gap: 6px; padding: 10px 12px 6px; border-top: 1px solid var(--borde); flex: none; }
.bot__form input { flex: 1; min-width: 0; min-height: 46px; padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--borde-fuerte); background: var(--fondo-lavanda); font-size: 16px; }
.bot__form input:focus { outline: none; border-color: var(--violeta); box-shadow: 0 0 0 4px color-mix(in srgb, var(--violeta) 22%, transparent); }
.bot__enviar { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; color: #fff; background: var(--violeta-osc); }
.bot__aviso { margin: 0; padding: 0 12px 10px; font-size: .7rem; color: var(--texto-2); text-align: center; flex: none; }
@media (max-width: 560px) {
  .bot { left: 12px; }
  .bot__fab { width: 56px; height: 56px; }
  /* Pantalla completa. bot.js ajusta alto y posición a lo que deja ver el
     teclado (visualViewport), así el campo para escribir nunca queda tapado. */
  .bot__panel { position: fixed; top: 0; right: 0; bottom: auto; left: 0; width: 100%; height: 100%; border-radius: 0; border: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .bot--abierto .bot__fab { visibility: hidden; }
  .bot__saludo { bottom: 68px; }
}

/* Sección «Preguntale al asistente» */
.seccion--asistente { background: linear-gradient(180deg, var(--fondo), var(--agua-suave)); }
.asistente { display: grid; gap: clamp(30px, 5vw, 56px); align-items: center; }
.asistente__form { position: relative; display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: var(--superficie); border: 1.5px solid var(--borde-fuerte); box-shadow: var(--sombra); max-width: 620px; }
.asistente__form:focus-within { border-color: var(--violeta); box-shadow: 0 0 0 4px color-mix(in srgb, var(--violeta) 20%, transparent), var(--sombra); }
.asistente__lupa { display: grid; place-items: center; padding-left: 10px; color: var(--agua-texto); }
.asistente__form input { flex: 1; min-width: 0; min-height: 46px; border: 0; background: none; font-size: 1rem; }
.asistente__form input:focus { outline: none; }
.asistente__form .boton { min-height: 46px; }
.asistente__contador { margin: 14px 0 10px; font-size: .9rem; color: var(--texto-2); }
.asistente__contador strong { color: var(--agua-texto); font-family: var(--fuente-titulo); font-size: 1.1rem; }
.asistente__temas { display: flex; flex-wrap: wrap; gap: 8px; }
.asistente__tema { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; padding: 6px 14px 6px 10px; border-radius: 999px; border: 1.5px solid var(--borde-fuerte); background: var(--superficie); font-weight: 600; font-size: .88rem; color: var(--texto); transition: transform .3s var(--rebote), border-color .2s; }
.asistente__tema .ico { color: var(--agua-texto); }
.asistente__tema:hover { transform: translateY(-2px); border-color: var(--agua-texto); }
.asistente__tarjeta { position: relative; isolation: isolate; padding: 22px; border-radius: 28px; background: var(--superficie); border: 1px solid var(--borde); box-shadow: var(--sombra-grande); }
.asistente__tarjeta-cabeza { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.asistente__tarjeta-cabeza p { margin: 0; line-height: 1.3; }
.asistente__tarjeta-logo { width: 52px; height: 52px; flex: none; }
.asistente__tarjeta-logo .logo-fk { width: 100%; height: 100%; }
.asistente__online { display: flex; align-items: center; gap: .4em; font-size: .8rem; color: var(--texto-2); }
.asistente__online span { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: pulso-punto 2s infinite; }
.asistente__burbuja { display: inline-block; margin: 0 0 16px; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--agua-suave); font-weight: 600; }
.asistente__populares-titulo { font-size: 1rem; margin-bottom: 8px; }
.asistente__populares { display: grid; gap: 8px; }
.asistente__populares button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px; border-radius: 14px; text-align: left;
  border: 1px solid var(--borde); background: var(--fondo-lavanda); color: var(--texto); font-weight: 600; font-size: .92rem;
  transition: transform .3s var(--rebote), border-color .2s, background-color .2s;
}
.asistente__populares button > span { flex: 1; }
.asistente__populares button .ico:first-child { color: var(--agua-texto); }
.asistente__populares button .ico:last-child { color: var(--violeta-texto); transition: transform .3s var(--rebote); }
.asistente__populares button:hover { border-color: var(--violeta); transform: translateX(4px); }
.anima .asistente__tarjeta.visible .asistente__populares li { animation: entra-der .5s var(--ease) both; animation-delay: calc(.2s + var(--i) * .08s); }
@media (min-width: 960px) { .asistente { grid-template-columns: 1.1fr 1fr; } }
@media (max-width: 480px) {
  .asistente__form { border-radius: 20px; flex-wrap: wrap; }
  .asistente__form .boton { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .bot__fab, .bot__msg, .bot__escribiendo span, .asistente__online span { animation: none !important; }
  .bot__panel, .bot__saludo { transition: none; }
}

/* Letra mínima de 14 px en el asistente (26/9/2026, pasada de celular) */
.bot__cabeza p, .bot__tema, .bot__aviso, .bot__relacionadas > p, .bot__tema-etiqueta, .bot__escribiendo em, .asistente__online { font-size: .875rem !important; }
.bot__pregunta, .bot__accion { font-size: .9rem; }
/* Celular con el teclado abierto (bot.js pone la clase): lo justo */
.bot__panel--teclado .bot__temas, .bot__panel--teclado .bot__aviso, .bot__panel--teclado .bot__cabeza p { display: none; }
.bot__panel--teclado .bot__cabeza { padding-top: 8px; padding-bottom: 8px; }
/* En el celular el globito del saludo no llega a la columna de la derecha
   (WhatsApp y «volver arriba»), así no los tapa */
@media (max-width: 560px) { .bot__saludo { max-width: calc(100vw - 108px); } }
