 /* Estilos para el visor Lightbox mejorado */
.gallery-viewer {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(8, 12, 20, 0.96);
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  z-index: 9999;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.gallery-viewer:not([open]) {
  display: none;
}

/* Barra superior de herramientas */
.viewer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: system-ui, -apple-system, sans-serif;
  flex-shrink: 0;
}

.viewer-count {
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.05em;
}

.viewer-zoom,
.viewer-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.viewer-zoom:hover,
.viewer-close:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Área principal de la fotografía */
.viewer-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  padding: 8px;
}

.viewer-image-area {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.viewer-image {
  max-width: 95%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.viewer-image.zoomed {
  transform: scale(1.5);
  cursor: grab;
}

/* Flechas de navegación */
.viewer-prev,
.viewer-next {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  margin: 0 8px;
  flex-shrink: 0;
}

.viewer-prev:hover,
.viewer-next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

/* Tira inferior de miniaturas */
.viewer-thumbnails {
  display: flex;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  background: rgba(10, 15, 28, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  justify-content: center;
  scroll-behavior: smooth;
  flex-shrink: 0;
}

.viewer-thumbnails img {
  width: 52px;
  height: 38px;
  object-fit: cover;
  border-radius: 4px;
  opacity: 0.4;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.viewer-thumbnails img:hover {
  opacity: 0.8;
}

.viewer-thumbnails img.active {
  opacity: 1;
  border-color: #38bdf8;
  transform: scale(1.05);
}

/* Pie de foto y leyendas */
.viewer-footer {
  text-align: center;
  padding: 8px;
  background: rgba(8, 12, 20, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.viewer-caption {
  margin: 0 0 2px 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: #e2e8f0;
}

.viewer-footer span {
  font-size: 0.78rem;
  color: #64748b;
}

/* Ajustes específicos para móviles */
@media (max-width: 768px) {
  .viewer-toolbar {
    padding: 8px 12px;
  }
  
  .viewer-prev,
  .viewer-next {
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
    margin: 0 4px;
  }

  .viewer-thumbnails img {
    width: 44px;
    height: 32px;
  }

  .viewer-footer {
    padding: 6px 10px;
  }

  .viewer-caption {
    font-size: 0.88rem;
  }
.visor-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  }
.contenedor-visor {
  /* Fallback para navegadores antiguos */
  height: 100vh; 
  
  /* Usa la altura dinámica real del viewport visible en móviles */
  height: 100dvh; 
}

