/* ═══════════════════════════════════════════════════════════
   hjLabs.in Product Gallery — gallery.css v1.0
   Thumbnail strip · Lightbox overlay · YouTube embed
   ═══════════════════════════════════════════════════════════ */

/* ── Gallery wrapper ────────────────────────────────────── */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* ── Main image area ────────────────────────────────────── */
.gallery-main {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border, rgba(99,102,241,0.18));
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  display: block;
}

.gallery-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.22s ease, transform 0.35s ease;
}

.gallery-main:hover .gallery-main-img {
  transform: scale(1.025);
}

/* ── Zoom button ────────────────────────────────────────── */
.gallery-zoom-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s;
  z-index: 3;
  padding: 0;
}

.gallery-main:hover .gallery-zoom-btn {
  opacity: 1;
}

.gallery-zoom-btn:hover {
  background: rgba(99,102,241,0.7);
}

.gallery-zoom-btn .material-icons {
  font-size: 18px;
}

/* ── Thumbnail strip ────────────────────────────────────── */
.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.5) transparent;
}

.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,0.5);
  border-radius: 2px;
}

.gallery-thumb {
  flex-shrink: 0;
  width: 74px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--bg-card, #0f172a);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s;
}

.gallery-thumb:hover {
  transform: translateY(-2px);
  border-color: rgba(99,102,241,0.5);
}

.gallery-thumb.active {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   Lightbox
   ═══════════════════════════════════════════════════════════ */
.hj-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.hj-lightbox.hj-lb-open {
  opacity: 1;
  pointer-events: all;
}

.hj-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,6,23,0.95);
  backdrop-filter: blur(6px);
}

/* close button */
.hj-lb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
}

.hj-lb-close:hover { background: rgba(239,68,68,0.7); }

/* prev / next */
.hj-lb-prev,
.hj-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  padding: 0;
}

.hj-lb-prev { left: 14px; }
.hj-lb-next { right: 14px; }
.hj-lb-prev:hover { background: rgba(99,102,241,0.6); transform: translateY(-50%) scale(1.05); }
.hj-lb-next:hover { background: rgba(99,102,241,0.6); transform: translateY(-50%) scale(1.05); }

/* image content area */
.hj-lb-content {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 72vh;
}

.hj-lb-img {
  max-width: 88vw;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 10px;
  transition: opacity 0.2s ease;
  display: block;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}

/* loading spinner */
.hj-lb-spinner {
  position: absolute;
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: hj-spin 0.75s linear infinite;
  display: none;
}

@keyframes hj-spin { to { transform: rotate(360deg); } }

/* counter */
.hj-lb-counter {
  position: absolute;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
  z-index: 10;
  pointer-events: none;
}

/* thumbnail strip */
.hj-lb-thumbs {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  max-width: 88vw;
  overflow-x: auto;
  padding: 4px 6px;
  z-index: 10;
  scrollbar-width: none;
}

.hj-lb-thumbs::-webkit-scrollbar { display: none; }

.hj-lb-thumb {
  flex-shrink: 0;
  width: 54px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.5);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, transform 0.15s;
}

.hj-lb-thumb:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.5); }
.hj-lb-thumb.active { border-color: #6366f1; box-shadow: 0 0 6px rgba(99,102,241,0.5); }

.hj-lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   YouTube embed (click-to-play)
   ═══════════════════════════════════════════════════════════ */
.product-video-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border, rgba(99,102,241,0.15));
}

.product-video-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary, #f1f5f9);
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-video-section h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.35rem;
  background: linear-gradient(to bottom, #6366f1, #06b6d4);
  border-radius: 2px;
}

.yt-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000 center / cover no-repeat;
  cursor: pointer;
  border: 1px solid var(--border, rgba(99,102,241,0.18));
}

.yt-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 14px;
}

.yt-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0,0,0,0.38);
  border: none;
  cursor: pointer;
  width: 100%;
  transition: background 0.25s;
  padding: 0;
}

.yt-embed:hover .yt-play-btn { background: rgba(0,0,0,0.22); }

.yt-play-icon {
  width: 68px;
  height: 68px;
  background: #ff0000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(255,0,0,0.5);
  padding-left: 4px; /* optical centering of play triangle */
}

.yt-embed:hover .yt-play-icon {
  transform: scale(1.1);
  box-shadow: 0 6px 32px rgba(255,0,0,0.65);
}

.yt-label {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  margin: 0;
}

/* ── Mobile adjustments ─────────────────────────────────── */
@media (max-width: 768px) {
  .hj-lb-prev { left: 4px; width: 38px; height: 38px; font-size: 16px; }
  .hj-lb-next { right: 4px; width: 38px; height: 38px; font-size: 16px; }
  .gallery-thumb { width: 60px; height: 46px; }
  .hj-lb-counter { bottom: 78px; }
  .yt-play-icon { width: 54px; height: 54px; font-size: 20px; }
}
