.pc-gallery-viewer {
  /* Stable image stage prevents layout jumps while product photos load. */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f3f4f6;
  border-radius: 8px;
  padding: var(--pc-space-3);
  min-height: clamp(220px, 34vw, 320px);
}

.pc-gallery-image {
  display: block;
  max-width: 100%;
  max-height: clamp(220px, 34vw, 320px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  cursor: zoom-in;
}

.pc-gallery-button,
.pc-zoom-nav {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  background: rgba(0, 0, 0, .45);
  border: 0;
  border-radius: 6px;
  transform: translateY(-50%);
}

.pc-gallery-button {
  width: var(--pc-icon-lg);
  height: var(--pc-icon-lg);
  font-size: var(--pc-text-lg);
}

.pc-gallery-single .pc-gallery-button,
.pc-gallery-single .pc-gallery-indicators,
.pc-gallery-single .pc-zoom-nav,
.pc-gallery-single .pc-zoom-indicators {
  display: none;
}

.pc-gallery-button-left {
  left: 8px;
}

.pc-gallery-button-right {
  right: 8px;
}

.pc-gallery-indicators,
.pc-zoom-indicators {
  display: flex;
  gap: var(--pc-space-1);
  margin-top: var(--pc-space-2);
  margin-left: auto;
  width: fit-content;
  margin-right: auto;
  margin-bottom: var(--pc-space-2);
}

.pc-gallery-indicator,
.pc-zoom-indicator {
  width: 10px;
  height: 10px;
  cursor: pointer;
  background: #e5e7eb;
  border: 0;
  border-radius: 50%;
}

.pc-gallery-indicator.active,
.pc-zoom-indicator.active {
  background: #111827;
}

.pc-zoom-overlay {
  /* Full-screen image zoom stays outside the product card flow. */
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 28px);
  background: rgba(0, 0, 0, .72);
}

.pc-zoom-overlay.active {
  display: flex;
}

.pc-zoom-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(100%, 1180px);
  max-height: calc(100dvh - 28px);
}

.pc-zoom-image {
  max-width: 100%;
  max-height: calc(100dvh - 120px);
  padding: clamp(8px, 2vw, 18px);
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}

.pc-zoom-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
  width: 44px;
  height: 44px;
  color: #fff;
  font-size: var(--pc-text-lg);
  line-height: 1;
  background: #111827;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.pc-zoom-close:hover,
.pc-zoom-close:focus-visible {
  background: #1f2937;
  transform: translateY(-1px);
}

.pc-zoom-nav {
  position: fixed;
  z-index: 2;
  width: 44px;
  height: 44px;
  font-size: var(--pc-text-lg);
  line-height: 1;
}

.pc-zoom-prev {
  left: clamp(14px, 4vw, 36px);
}

.pc-zoom-next {
  right: clamp(14px, 4vw, 36px);
}

@media (max-width: 640px) {
  .pc-gallery-viewer {
    min-height: 220px;
    padding: var(--pc-space-2);
  }

  .pc-gallery-image {
    max-height: 260px;
    height: auto;
  }

  .pc-zoom-overlay {
    padding: 54px 10px 14px;
  }

  .pc-zoom-image {
    max-height: calc(100dvh - 150px);
    padding: 8px;
  }

  .pc-zoom-close {
    width: 40px;
    height: 40px;
  }

  .pc-zoom-prev {
    left: 10px;
  }

  .pc-zoom-next {
    right: 10px;
  }
}
