.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(var(--preto-rgb), 0.95);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  cursor: default;
}

.lightbox.active {
  display: flex;
}

.lightbox__image-container {
  position: relative;
  width: 90vw;
  height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  touch-action: none;
  z-index: 10000;
  cursor: zoom-in;
}

.lightbox__image-container.can-drag {
  cursor: grab;
}

.lightbox__image-container.dragging {
  cursor: grabbing;
}

.lightbox__image {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
}

.lightbox__image.loaded {
  opacity: 1;
}

/* Botão Fechar */
.lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--roxo);
  color: var(--branco);
  border: none;
  width: 3.125rem;
  height: 3.125rem;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: var(--font-bold);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 10003;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lightbox__close:hover {
  background: var(--lilas);
  transform: scale(1.1);
}

/* Setas de Navegação */
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(168, 108, 224, 0.8);
  color: var(--branco);
  border: none;
  width: 3.125rem;
  height: 3.125rem;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: var(--font-bold);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 10002;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lightbox__nav:hover {
  background: var(--roxo);
  transform: translateY(-50%) scale(1.1);
}

.lightbox__nav--prev {
  left: 1.25rem;
}

.lightbox__nav--next {
  right: 1.25rem;
}

/* Controles de Zoom */
.lightbox__zoom-controls {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.625rem;
  background: rgba(var(--preto-rgb), 0.7);
  padding: 0.625rem;
  border-radius: 1.875rem;
  z-index: 10001;
  backdrop-filter: blur(10px);
}

.lightbox__zoom-btn {
  background: var(--roxo);
  color: var(--branco);
  border: none;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: var(--font-bold);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lightbox__zoom-btn:hover {
  background: var(--lilas);
  transform: scale(1.1);
}

.lightbox__zoom-btn:active {
  transform: scale(0.95);
}

.lightbox__zoom-level {
  background: rgba(255, 255, 255, 0.1);
  color: var(--branco);
  padding: 0 1rem;
  border-radius: 1.25rem;
  font-size: 0.875rem;
  font-weight: var(--font-semibold);
  display: flex;
  align-items: center;
  min-width: 4.375rem;
  justify-content: center;
  white-space: nowrap;
}

/* Legenda */
.lightbox__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(var(--preto-rgb), 0.9));
  color: var(--branco);
  padding: 2.5rem 1.25rem 1.25rem;
  text-align: center;
  font-size: 1rem;
  z-index: 9999;
  pointer-events: none;
}

/* Contador */
.lightbox__counter {
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  background: rgba(var(--preto-rgb), 0.8);
  color: var(--branco);
  padding: 0.5rem 1rem;
  border-radius: 1.25rem;
  font-size: 0.875rem;
  z-index: 10001;
}

/* Imagens na página */
.project__content img {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.project__content img:hover {
  transform: scale(1.02);
}

/* Responsivo */
@media (max-width: 768px) {
  .lightbox__image-container {
    max-width: 95vw;
    max-height: 95vh;
  }

  .lightbox__image {
    max-width: 95vw;
    max-height: 95vh;
  }

  .lightbox__close,
  .lightbox__nav {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    font-size: 1.25rem;
  }

  .lightbox__close {
    top: 0.9375rem;
    right: 0.9375rem;
  }

  .lightbox__nav--prev {
    left: 0.9375rem;
  }

  .lightbox__nav--next {
    right: 0.9375rem;
  }

  .lightbox__zoom-controls {
    bottom: 5.625rem;
    padding: 0.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .lightbox__zoom-btn {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    font-size: 1.125rem;
  }

  .lightbox__zoom-level {
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    min-width: 4.0625rem;
    width: 100%;
    text-align: center;
    margin-top: 0.25rem;
  }

  .lightbox__counter {
    bottom: 0.9375rem;
    left: 0.9375rem;
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
  }

  .lightbox__caption {
    font-size: 0.875rem;
    padding: 2.1875rem 0.9375rem 0.9375rem;
  }
}

/* Mobile landscape */
@media (max-width: 768px) and (orientation: landscape) {
  .lightbox__zoom-controls {
    bottom: 3.75rem;
  }

  .lightbox__caption {
    padding: 1.875rem 0.9375rem 0.625rem;
  }
}
