/**
 * Storefront PDP — lightbox gallery (same-page zoom + prev/next + drag-pan).
 */

.pdp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 12, 0.92);
  padding: 16px;
}

.pdp-lightbox.is-open {
  display: flex;
}

.pdp-lightbox__stage {
  position: relative;
  width: min(960px, 100%);
  height: min(88vh, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.pdp-lightbox__img-wrap {
  position: relative;
  max-width: 100%;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  will-change: transform;
}

.pdp-lightbox__img {
  max-width: min(960px, 100vw - 32px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.pdp-lightbox.is-zoomed .pdp-lightbox__img-wrap {
  cursor: grab;
}

.pdp-lightbox.is-dragging .pdp-lightbox__img-wrap {
  cursor: grabbing;
}

.pdp-lightbox__btn {
  position: absolute;
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: background 0.15s ease;
  z-index: 3;
}

.pdp-lightbox__btn:hover,
.pdp-lightbox__btn:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: none;
}

.pdp-lightbox__close {
  top: 8px;
  right: 8px;
}

.pdp-lightbox__prev {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.pdp-lightbox__next {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.pdp-lightbox__counter {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 2;
}

.pdp-lightbox__hint {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

.pdp-lightbox__btn.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

body.pdp-lightbox-open {
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .pdp-lightbox__prev,
  .pdp-lightbox__next {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .pdp-lightbox__stage {
    height: min(82vh, 100%);
  }

  .pdp-lightbox__img-wrap,
  .pdp-lightbox__img {
    max-height: 78vh;
  }

  .pdp-lightbox__hint {
    font-size: 10px;
  }
}

/* Hint that main gallery images are clickable to enlarge */
.tf-product-media-main a.item[data-pdp-lightbox] {
  cursor: zoom-in;
}
