/* ==========================================================================
   Lightbox — minimal, mobile-friendly
   ========================================================================== */

#zg3-lb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s, visibility 0.25s;
}
#zg3-lb.zg3-lb--open {
  visibility: visible;
  opacity: 1;
}

.zg3-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.94);
  cursor: zoom-out;
}

/* Close button */
.zg3-lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.zg3-lb-close:hover { background: rgba(255,255,255,0.25); }

/* Prev / Next */
.zg3-lb-prev,
.zg3-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.zg3-lb-prev { left: 16px; }
.zg3-lb-next { right: 16px; }
.zg3-lb-prev:hover,
.zg3-lb-next:hover { background: rgba(255,255,255,0.25); }

/* Image body */
.zg3-lb-body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 120px);
  max-height: calc(100dvh - 80px);
}

.zg3-lb-img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 80px);
  object-fit: contain;
  border-radius: 4px;
  transition: opacity 0.2s;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
  user-select: none;
  -webkit-user-drag: none;
}

/* Loader spinner */
.zg3-lb-loader {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: zg3-lb-spin 0.7s linear infinite;
  display: none;
}
@keyframes zg3-lb-spin {
  to { transform: rotate(360deg); }
}

/* Caption */
.zg3-lb-caption {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  text-align: center;
  max-width: 80vw;
  pointer-events: none;
}

/* Mobile */
@media (max-width: 600px) {
  .zg3-lb-body {
    max-width: 100vw;
    max-height: calc(100dvh - 100px);
  }
  .zg3-lb-prev { left: 8px; }
  .zg3-lb-next { right: 8px; }
  .zg3-lb-prev,
  .zg3-lb-next {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
}
