/* Chat FAQ. Solo usa las variables del tema activo (estilos.css), así sigue al estilo Outdoor. */
.chat-boton {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  width: 52px; height: 52px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--tinta); color: var(--sobre-tinta); box-shadow: var(--anillo-alto);
  transition: transform .15s ease, background .15s ease;
}
.chat-boton:hover { background: var(--tinta-hover); transform: translateY(-1px); }
.chat-boton:focus-visible, .chat-cerrar:focus-visible, .chat-chip:focus-visible, .chat-accion:focus-visible,
.chat-enviar:focus-visible { outline: 2px solid var(--tinta); outline-offset: 2px; }
.chat-boton svg { width: 38px; height: 38px; }
.chat-boton[aria-expanded="true"] { display: none; }

.chat-ventana {
  position: fixed; right: 16px; bottom: 16px; z-index: 31;
  width: 340px; max-height: min(540px, calc(100dvh - 32px)); display: flex; flex-direction: column;
  background: var(--superficie); color: var(--texto); font-family: var(--fuente); font-size: 14px;
  border-radius: var(--radio); box-shadow: var(--anillo-alto); overflow: hidden;
  animation: chat-entra .18s ease-out;
}
.chat-cab { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--borde); }
.chat-cab .molly { flex: none; }
.chat-cab b { display: block; line-height: 1.2; }
.chat-cab small { display: block; color: var(--suave); font-size: 12px; line-height: 1.2; }
.chat-cab > div { margin-right: auto; min-width: 0; }
.chat-cerrar { border: 0; background: transparent; color: var(--suave); width: 32px; height: 32px; border-radius: var(--radio-sm); cursor: pointer; font-size: 20px; line-height: 1; }
.chat-cerrar:hover { background: var(--hover); color: var(--texto); }

.chat-mensajes { flex: 1; min-height: 160px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--fondo); overscroll-behavior: contain; }
.chat-fila { display: flex; align-items: flex-end; gap: 6px; align-self: flex-start; max-width: 92%; }
.chat-fila .molly { flex: none; }
.chat-fila .chat-burbuja { max-width: none; min-width: 0; }
.chat-burbuja { max-width: 86%; padding: 9px 12px; border-radius: 14px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; animation: chat-entra .15s ease-out; }
.chat-burbuja.bot { background: var(--superficie); box-shadow: var(--anillo); border-bottom-left-radius: 4px; }
.chat-burbuja.yo { align-self: flex-end; background: var(--tinta); color: var(--sobre-tinta); border-bottom-right-radius: 4px; }
.chat-escribiendo { display: inline-flex; gap: 4px; padding: 12px 14px; }
.chat-escribiendo i { width: 6px; height: 6px; border-radius: 50%; background: var(--suave-2); animation: chat-punto 1s infinite ease-in-out; }
.chat-escribiendo i:nth-child(2) { animation-delay: .15s; }
.chat-escribiendo i:nth-child(3) { animation-delay: .3s; }

.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 100%; }
.chat-chip, .chat-accion {
  border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); cursor: pointer;
  border-radius: 999px; padding: 6px 12px; font-size: 13px; line-height: 1.2; text-align: left;
}
.chat-chip:hover { background: var(--hover); border-color: var(--suave-2); }
.chat-accion { background: var(--tinta); color: var(--sobre-tinta); border-color: var(--tinta); font-weight: 600; }
.chat-accion:hover { background: var(--tinta-hover); }

.chat-pie { padding: 10px 12px 8px; border-top: 1px solid var(--borde); background: var(--superficie); }
.chat-form { display: flex; gap: 8px; }
.chat-form input {
  flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--borde); border-radius: 999px;
  background: var(--campo); color: var(--texto); font-size: 16px;   /* 16px evita el zoom al enfocar en iPhone */
}
.chat-form input:focus { outline: 2px solid var(--tinta); outline-offset: -1px; }
.chat-enviar { border: 0; border-radius: 999px; padding: 0 14px; background: var(--tinta); color: var(--sobre-tinta); font-weight: 600; cursor: pointer; }
.chat-enviar:hover { background: var(--tinta-hover); }
.chat-enviar:disabled { opacity: .5; cursor: default; }
.chat-aviso { margin: 6px 4px 0; color: var(--suave); font-size: 11px; line-height: 1.3; text-align: center; }

@keyframes chat-entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes chat-punto { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .chat-ventana, .chat-burbuja, .chat-boton { animation: none; transition: none; }
  .chat-escribiendo i { animation: none; }
}

/* Móvil: botón más pequeño y ventana a casi todo el ancho; el contenido deja hueco para que el botón
   nunca tape "Add to cart" ni el precio. */
@media (max-width: 600px) {
  .chat-boton { right: 12px; bottom: 12px; width: 48px; height: 48px; }
  .chat-ventana { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: min(520px, calc(100dvh - 16px)); }
  body { padding-bottom: 72px; }
}

/* MOLLY: panel MOLLE con cara. En fondo claro el cuerpo es --tinta y los detalles --superficie;
   sobre el botón (fondo --tinta) se invierten. Nítido a 24, 40 y 56 px. */
.molly { --m-cuerpo: var(--tinta); --m-detalle: var(--superficie); display: block; overflow: visible; }
.chat-boton .molly { --m-cuerpo: var(--sobre-tinta); --m-detalle: var(--tinta); }
.m-cuerpo { fill: var(--m-cuerpo); }
.m-detalle { fill: var(--m-detalle); }
.m-ranura { opacity: .55; }
.m-boca { fill: none; stroke: var(--m-detalle); stroke-width: 3.4; stroke-linecap: round; }
.m-ojos { transform-box: fill-box; transform-origin: center; animation: var(--m-parpadeo, none); }
.molly-cab, .molly-boton { --m-parpadeo: molly-parpadeo 5s infinite; }
.chat-ventana:not([hidden]) .molly-cab { animation: molly-rebote .5s ease-out; }
@keyframes molly-parpadeo { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes molly-rebote { 0% { transform: translateY(6px) scale(.9); } 55% { transform: translateY(-4px) scale(1.06); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .molly-cab, .molly-boton { --m-parpadeo: none; }
  .chat-ventana:not([hidden]) .molly-cab { animation: none; }
}
