body {
  margin: 0;
}

/* Base (móvil): vertical, de arriba hacia abajo y más lento */
.carrusel {
  overflow: hidden;
  width: 100%;
  height: 100vh;
  height: 100svh;
}

.pista {
  display: flex;
  flex-direction: column;
  height: max-content;
  animation-name: mover;
  animation-duration: 150s; /* móvil: sube este número para ir más lento */
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-play-state: paused; /* espera a que carguen las imágenes */
}

.pista.listo {
  animation-play-state: running;
}

.pista.listo.pausado {
  animation-play-state: paused;
}

.pista img {
  width: 100%;
  height: auto;
  display: block;
  /* evita el menú de "guardar imagen" y la selección al mantener el dedo */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

@keyframes mover {
  from { transform: translateY(-50%); }
  to   { transform: translateY(0); }
}

@keyframes mover-x {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* Visor con lupa (el JS solo lo abre en desktop) */
.visor {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 10;
  cursor: zoom-out;
}

.visor.activo {
  display: flex;
}

.visor img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.2s ease;
  transform-origin: center center;
}

.visor.con-zoom img {
  cursor: zoom-out;
  transition: none; /* sigue al mouse sin retraso */
}

.visor-cerrar {
  position: absolute;
  top: 16px;
  right: 24px;
  font: 32px/1 sans-serif;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 11;
}

/* Desktop: horizontal, de izquierda a derecha */
@media (min-width: 768px) {
  .pista {
    flex-direction: row;
    width: max-content;
    height: 100%;
    animation-name: mover-x;
    animation-duration: 10s; /* desktop se queda como estaba */
  }

  .pista img {
    width: auto;
    height: 100%;
    flex-shrink: 0;
    cursor: zoom-in;
  }
}