/* =====================================================================
   Mascota 3D de la portada (mejora progresiva sobre la imagen 2D).
   La capa es fija y no captura clics, salvo el botón invisible sobre el cuerpo de la mascota.
   ===================================================================== */
.mascota3d-capa {
  position: fixed; left: 0; top: 0; z-index: 880;
  transform-origin: 0 0; pointer-events: none; contain: layout style;
}
.mascota3d-lienzo { display: block; width: 100%; height: 100%; }
.mascota3d-toque {
  position: absolute; left: 31%; top: 16%; width: 38%; height: 70%;
  border: 0; border-radius: 45%; background: transparent; cursor: pointer; pointer-events: auto;
}
.mascota3d-toque:focus-visible { outline: 3px solid var(--rojo); outline-offset: 4px; }
html:not(.con-mascota3d) .mascota3d-toque { display: none; }
html:not(.mascota3d-en-portada):not(.mascota3d-anclada) .mascota3d-toque { pointer-events: none; }
/* El globo del botón de ayuda no repite lo que está diciendo la mascota 3D. */
html.mascota3d-hablando .lanzador-globo { visibility: hidden; }
/* En el celular la tarjeta del recorrido ya muestra a la mascota: la 3D se aparta. */
@media (max-width: 759px) {
  html.mascota3d-recorrido .mascota3d-capa { opacity: 0; transition: opacity .25s ease; }
  .mascota3d-globo { max-width: min(210px, 62vw); font-size: .82rem; }
}

/* La imagen 2D se oculta solo cuando el modelo 3D ya se dibujó (si falla, vuelve a verse). */
html.con-mascota3d .hero-mascota { visibility: hidden; }

/* Durante «Explora conmigo» la mascota queda sobre el oscurecido, por debajo de la tarjeta. */
html.mascota3d-recorrido .mascota3d-capa { z-index: 905; }

/* Globo con lo que presenta la mascota en cada sección. */
.mascota3d-globo {
  position: fixed; left: 0; top: 0; z-index: 885; margin: 0; max-width: min(250px, 70vw);
  padding: .65rem .9rem; border-radius: 14px; background: #fff; color: var(--grafito);
  font: 600 .9rem/1.35 var(--fuente); box-shadow: 0 10px 28px rgba(33, 34, 36, .16);
  border: 1.5px solid var(--rojo-200); pointer-events: none;
}

/* Minimizar: solo cuando la mascota acompaña fuera de la portada (no en el recorrido guiado). */
.mascota3d-minimizar {
  position: fixed; left: 0; top: 0; z-index: 886; display: none; place-items: center;
  width: 40px; height: 40px; padding: 0; border: 1px solid var(--gris-150); border-radius: 50%;
  background: #fff; color: var(--grafito); box-shadow: 0 8px 20px rgba(33, 34, 36, .18); cursor: pointer;
}
.mascota3d-minimizar:hover { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.mascota3d-minimizar:focus-visible { outline: 3px solid var(--rojo); outline-offset: 3px; }
html.con-mascota3d:not(.mascota3d-en-portada):not(.mascota3d-recorrido)[data-efectos3d="completo"] .mascota3d-minimizar { display: grid; }

/* Control de efectos dentro del panel del asistente. */
.ap-pie { flex-wrap: wrap; row-gap: .5rem; }
.ap-efectos {
  font: inherit; font-size: .8rem; padding: .3rem .5rem; border: 1px solid var(--borde);
  border-radius: 8px; background: #fff; color: var(--grafito); max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .mascota3d-globo { transition: none; }
}
