/* =========================================================================
   Visor de imágenes a pantalla completa (lightbox.js).
   Autónomo: todas las reglas cuelgan de .lightbox, así sirve igual en el
   catálogo (client.css) y en el panel (admin.css) sin depender de ninguno.
   ========================================================================= */
.lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(30, 28, 38, .94);
  display: flex; align-items: center; justify-content: center;
  padding: 0 8px;
  opacity: 0; transition: opacity 200ms ease;
}
.lightbox.show { opacity: 1; }

.lightbox .lb-close {
  position: absolute; z-index: 3;
  top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px;
  width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox .lb-counter {
  position: absolute; z-index: 3;
  top: calc(env(safe-area-inset-top, 0px) + 22px); left: 16px;
  font-size: .85rem; color: rgba(255, 255, 255, .8);
}
.lightbox svg { width: 22px; height: 22px; display: block; fill: currentColor; }

.lightbox .carousel { position: relative; width: 100%; max-width: 1000px; }
.lightbox .carousel-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.lightbox .carousel-track::-webkit-scrollbar { display: none; }
.lightbox .carousel-slide {
  flex: 0 0 100%; scroll-snap-align: center;
  aspect-ratio: auto; height: min(78vh, 900px); background: transparent;
  display: flex; align-items: center; justify-content: center;
}
.lightbox .carousel-slide img { width: 100%; height: 100%; object-fit: contain; }

.lightbox .carousel-dots {
  display: flex; gap: 5px; justify-content: center; align-items: center; padding-top: 16px;
}
.lightbox .carousel-dots .dot {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .35);
  cursor: pointer; transition: background 150ms ease, width 150ms ease;
}
.lightbox .carousel-dots .dot.active { background: #fff; width: 18px; border-radius: 3px; }

.lightbox .carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox .carousel-arrow.prev { left: 8px; }
.lightbox .carousel-arrow.next { right: 8px; }
/* En pantallas chicas se navega deslizando: las flechas solo estorban. */
@media (max-width: 480px) { .lightbox .carousel-arrow { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox * { transition-duration: .001ms !important; }
}
