/* ── Gallery Lightbox Viewer ── */

#glb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

#glb.glb-open {
  visibility: visible;
  opacity: 1;
}

.glb-backdrop {
  position: absolute;
  inset: 0;
  background: #0c0c0c;
}

.glb-ui {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* ── Top bar ── */
.glb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  flex-shrink: 0;
}

.glb-counter {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.5px;
}

.glb-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.glb-close:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

/* ── Stage (image + arrows) ── */
.glb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 0;
  position: relative;
}

.glb-img-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 80px;
  min-height: 0;
}

.glb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  transition: opacity 0.18s ease;
  user-select: none;
  pointer-events: none;
  display: block;
}

/* ── Navigation arrows ── */
.glb-prev,
.glb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.8);
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  z-index: 2;
  flex-shrink: 0;
}

.glb-prev { left: 14px; }
.glb-next { right: 14px; }

.glb-prev:hover,
.glb-next:hover {
  background: #ff7300;
  border-color: #ff7300;
  color: #fff;
  transform: translateY(-50%) scale(1.08);
}

/* ── Thumbnail strip ── */
.glb-thumbs {
  flex-shrink: 0;
  padding: 10px 14px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.glb-thumbs::-webkit-scrollbar {
  height: 3px;
}

.glb-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
}

.glb-thumb-track {
  display: flex;
  gap: 6px;
  width: max-content;
}

.glb-thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.4;
  border: 2px solid transparent;
  transition: opacity 0.15s, transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.glb-thumb:hover {
  opacity: 0.75;
}

.glb-thumb.glb-active {
  opacity: 1;
  border-color: #ff7300;
  transform: scale(1.08);
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .glb-img-wrap {
    padding: 0 54px;
  }

  .glb-prev {
    left: 6px;
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .glb-next {
    right: 6px;
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .glb-thumb {
    width: 46px;
    height: 46px;
  }

  .glb-topbar {
    padding: 10px 12px;
  }
}
