/* Image lightbox — property detail page (.pd-gallery) only */
.pd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.pd-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.pd-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 28, 0.88);
  cursor: pointer;
}

.pd-lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(96vw, 1100px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
}

.pd-lightbox__stage {
  position: relative;
  width: 100%;
  max-height: calc(92vh - 3rem);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.pd-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 3rem);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.pd-lightbox__img.is-visible {
  opacity: 1;
  transform: scale(1);
}

.pd-lightbox__img.is-leaving {
  opacity: 0;
  transform: scale(0.98);
}

.pd-lightbox__close,
.pd-lightbox__nav {
  pointer-events: auto;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.pd-lightbox__close {
  position: absolute;
  top: -0.25rem;
  right: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  z-index: 3;
}

.pd-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.05);
}

.pd-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.75rem;
  z-index: 2;
}

.pd-lightbox__nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
}

.pd-lightbox__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pd-lightbox__nav--prev {
  left: 0.5rem;
}

.pd-lightbox__nav--next {
  right: 0.5rem;
}

.pd-lightbox__counter {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

body.pd-lightbox-open {
  overflow: hidden;
  touch-action: none;
}

/* Detail gallery — click to open lightbox */
.pd-detail-page .pd-gallery__main,
.pd-detail-page .pd-gallery__side img,
.pd-detail-page .pd-gallery__thumb {
  cursor: zoom-in;
}

@media (max-width: 767.98px) {
  .pd-lightbox {
    padding: 0.5rem;
  }

  .pd-lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .pd-lightbox__nav--prev {
    left: 0.25rem;
  }

  .pd-lightbox__nav--next {
    right: 0.25rem;
  }

  .pd-lightbox__close {
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
  }
}
