/* ─────────────────────────────────────────────
   CoinStamps — Product Image Gallery v4.0
   Pan-Zoom handled by Javascript
   ───────────────────────────────────────────── */

.gallery-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden; /* clip zoom overflow */
  background: #f5f0e8 !important;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border: 1px solid var(--parchment);
  user-select: none;
  cursor: zoom-in;
}

.gallery-main img#main-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Keep the original aspect ratio inside the box before zooming */
  display: block;
}

/* Zoom label */
.gallery-main::after {
  content: '🔍 Hover to zoom';
  position: absolute;
  bottom: 10px;
  left: 12px;
  background: rgba(26,26,46,.55);
  color: rgba(255,255,255,.85);
  font-size: .68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  pointer-events: none;
  letter-spacing: .04em;
  opacity: 1;
  transition: opacity .25s;
}
.gallery-main:hover::after {
  opacity: 0;
}

/* ── Prev / Next arrows on main image ─────────── */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(201,168,76,.4);
  color: var(--navy);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 12;
  opacity: 0;
  transition: opacity .18s, background .15s;
  line-height: 1;
}
.gallery-arrow:hover   { background: var(--gold); color: #fff; }
.gallery-arrow.g-prev  { left: 10px; }
.gallery-arrow.g-next  { right: 10px; }
.gallery-main:hover .gallery-arrow { opacity: 1; }

/* ── Image counter badge ──────────────────────── */
.gallery-counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(26,26,46,.6);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  z-index: 11;
  pointer-events: none;
  letter-spacing: .04em;
}

/* ── Thumbnail strip ──────────────────────────── */
.gallery-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, transform .15s, opacity .15s;
  opacity: .75;
  flex-shrink: 0;
}
.gallery-thumb:hover  { opacity: 1; transform: translateY(-1px); }
.gallery-thumb.active { border-color: var(--gold); opacity: 1; }

/* No-image placeholder */
.gallery-placeholder {
  font-size: 6rem;
  opacity: .25;
  pointer-events: none;
  user-select: none;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 900px) {
  .gallery-arrow { opacity: 1; width: 32px; height: 32px; font-size: .9rem; }
  .gallery-thumb { width: 58px; height: 58px; }
  .gallery-main::after { display: none; }
}
