/* Custom Lightbox Styles */
.custom-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.custom-lightbox.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
}

.lightbox-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Imagem principal */
.lightbox-main-image {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.lightbox-main-image .main-image {
  width: 100%;
  height: 100%;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  object-position: 50% 50%;
  display: block;
  transition: opacity 0.3s ease;
  border-radius: 0;
  box-shadow: none;
}

.image-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}


/* Botão de fechar */
.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: transparent;
  border: none;
  color: #1f2937;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lightbox-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #000;
}

/* Botões de navegação */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background-color: #6b7280;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.lightbox-nav:hover {
  background-color: #4b5563;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

.lightbox-nav svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

/* Responsive */
@media (max-width: 768px) {
  .lightbox-container {
    padding: 1rem;
  }

  .lightbox-main-image {
    max-width: 95vw;
    max-height: 85vh;
  }

  .lightbox-prev {
    left: 1rem;
  }

  .lightbox-next {
    right: 1rem;
  }

  .lightbox-nav {
    width: 48px;
    height: 48px;
  }

  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}

