/* Contenedor */
#sil-lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  display: flex;
  padding: 20px;
}

/* Inner para centrar y evitar cierre al click en elementos internos */
#sil-lightbox .sil-overlay-inner {
  position: relative;
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-direction: column;
}

/* Media wrap */
#sil-lightbox .sil-media-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

/* Spinner (simple) */
#sil-lightbox .sil-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 5px solid rgba(255,255,255,0.12);
  border-top-color: rgba(255,255,255,0.9);
  animation: sil-spin 1s linear infinite;
  position: absolute;
  z-index: 10002;
  display: none;
}

@keyframes sil-spin {
  to { transform: rotate(360deg); }
}

/* Imagen */
#sil-lightbox img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 0 25px rgba(0,0,0,0.6);
}

/* Flechas y close */
#sil-lightbox .close {
  position: absolute;
  top: 18px;
  right: 28px;
  font-size: 38px;
  color: #fff;
  cursor: pointer;
  z-index: 10003;
}
#sil-lightbox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  color: #fff;
  cursor: pointer;
  z-index: 10003;
  user-select: none;
}
#sil-lightbox .prev { left: 20px; }
#sil-lightbox .next { right: 20px; }

/* Captions */
#sil-lightbox .caption {
  margin-top: 12px;
  color: #fff;
  font-size: 16px;
  text-align: center;
  text-shadow: 0 0 6px rgba(0,0,0,0.9);
  max-width: 90%;
}

/* Evitar que el cursor muestre spinner del sistema (opcional) */
#sil-lightbox, #sil-lightbox * { cursor: default; }



#sil-lightbox.loading img {
  opacity: 0.3;
}

#sil-lightbox.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
/* Responsive */