/* Visor de fotos (lightbox) del sitio público.
   PRIMERA PARTE — el motor (visor.js): vale para cualquier contenedor al que
   visor.js le ponga la clase rv-visor (portada, mercados, galería de clientes y
   galería en vivo). */
.rv-visor { overflow: hidden; touch-action: pinch-zoom; overscroll-behavior: contain; transition: background-color 0.3s ease; }
.rv-visor.open { display: block; }
/* Pista con tres hojas (anterior, actual, siguiente) que arma visor.js: la pista
   sigue al dedo y así se ve cómo una foto sale y la otra entra. */
.rv-pista { position: absolute; inset: 0; will-change: transform; }
.rv-hoja { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.rv-hoja img { object-fit: contain; display: block; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
/* Abrir y cerrar: mientras la foto "vuela" entre su miniatura y el visor, el fondo
   y los botones aparecen o se desvanecen ("velado"). */
.rv-visor .rv-fantasma { position: absolute; left: 50%; top: 50%; max-width: none !important; max-height: none !important; transform-origin: 0 0; pointer-events: none; will-change: transform, clip-path; }
.rv-visor.rv-velado { background-color: transparent !important; }
.rv-visor.rv-velado > :not(.rv-pista):not(.rv-fantasma) { opacity: 0 !important; }   /* botones, contador, barra: todo lo que no es la foto */

/* Mientras el dedo arrastra la foto hacia abajo para salir, los botones se desvanecen. */
.rv-visor.rv-arrastre > :not(.rv-pista):not(.rv-fantasma) { opacity: 0 !important; transition: opacity 0.2s; }

/* Videos: el reproductor va montado exactamente sobre la portada (visor.js le da su lugar). */
.rv-hoja .rv-video { position: absolute; background: #000; outline: none; object-fit: contain; }
/* Miniatura de un video en la cuadrícula: botón de play al centro y su duración.
   Mientras la portada vuela al visor (su <img> se esconde un instante), se esconden con ella. */
.rv-play { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(20,18,18,0.55); border: 1.5px solid rgba(255,252,232,0.85); display: flex; align-items: center; justify-content: center; z-index: 2; pointer-events: none; transition: background 0.25s, transform 0.25s; }
.rv-play svg { width: 22px; height: 22px; fill: #fffce8; margin-left: 3px; }
:hover > .rv-play { background: #a9170b; transform: scale(1.08); }
.rv-dur { position: absolute; right: 10px; bottom: 10px; z-index: 2; font-family: 'Space Mono', monospace; font-size: 10px; letter-spacing: 1px; color: #fffce8; background: rgba(20,18,18,0.6); padding: 2px 7px; pointer-events: none; }
:has(> img[style*="visibility: hidden"]) > .rv-play, :has(> img[style*="visibility: hidden"]) > .rv-dur { visibility: hidden; }
@media (max-width: 768px) {
    .rv-play { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
    .rv-play svg { width: 18px; height: 18px; }
}

/* SEGUNDA PARTE — el aspecto del visor de la portada y las páginas de mercado. */
.lightbox { display: none; position: fixed; inset: 0; z-index: 2000; background-color: rgba(20,18,18,0.97); }
.lightbox-img { max-width: 90vw; max-height: 88vh; }
.lightbox-cerrar { position: fixed; top: 20px; right: 24px; background: none; border: none; color: rgba(255,252,232,0.6); font-size: 32px; cursor: pointer; line-height: 1; transition: color 0.2s, opacity 0.2s; z-index: 2001; }
.lightbox-cerrar:hover { color: var(--crema); }
.lightbox-prev, .lightbox-next { position: fixed; top: 50%; transform: translateY(-50%); background: none; border: none; color: rgba(255,252,232,0.6); width: 48px; height: 48px; font-size: 32px; cursor: pointer; transition: color 0.2s, opacity 0.2s; display: flex; align-items: center; justify-content: center; z-index: 2001; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover, .lightbox-next:hover { color: var(--crema); }
.lightbox-counter { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); font-family: 'Space Mono', monospace; font-size: 11px; color: rgba(255,252,232,0.45); letter-spacing: 2px; z-index: 2001; white-space: nowrap; transition: opacity 0.2s; }
.lightbox-counter::before { content: '●'; color: var(--rojo); animation: rv-pulso 1.5s infinite; display: inline-block; margin-right: 10px; }
@keyframes rv-pulso { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (max-width: 768px) {
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .lightbox-counter::before { animation: none; }
}
