/* Keep the established product image dimensions and add controls below it. */
.prod-gallery {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  min-width: 0;
}
.prod-gallery .prod-gallery__stage {
  position: relative;
  top: auto;
  width: 100%;
  touch-action: pan-y pinch-zoom;
}
.prod-gallery .prod-gallery__stage--branded { padding-bottom: 56px; }
.prod-gallery__stage > .product-brand-pill {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  max-width: calc(100% - 24px);
  min-height: 32px;
  margin: 0;
  padding: 4px 10px 4px 5px;
  gap: 6px;
  border: 1px solid #aac9e2;
  background: #fff;
  color: #234b70;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(22, 68, 109, .12);
}
.prod-gallery__stage .product-brand-pill__logo { width: 22px; height: 22px; flex-basis: 22px; }
.prod-gallery__viewport {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.prod-gallery__viewport > img {
  min-width: 0;
  min-height: 0;
  animation: product-gallery-appear 160ms ease-out;
}
.prod-gallery__navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}
.prod-gallery__arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 10px;
  border: 1px solid var(--glass-border-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--primary-deep);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.prod-gallery__arrow svg { width: 20px; height: 20px; }
.prod-gallery__arrow:not(:disabled):hover { background: var(--bg); border-color: var(--primary); }
.prod-gallery__arrow:disabled { opacity: .4; cursor: default; }
.prod-gallery__count { min-width: 56px; text-align: center; color: var(--ink-soft); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prod-gallery__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  margin-top: 10px;
  padding: 4px 3px 8px;
}
.prod-gallery__thumb {
  display: grid;
  place-items: center;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  padding: 6px;
  border: 2px solid var(--glass-border-2);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.prod-gallery__thumb[aria-pressed="true"] { border-color: var(--primary-deep); background: var(--bg); }
.prod-gallery__thumb:hover { border-color: var(--primary); }
.prod-gallery__thumb img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.prod-gallery__stage:focus-visible,
.prod-gallery__arrow:focus-visible,
.prod-gallery__thumb:focus-visible { outline: 3px solid var(--primary-deep); outline-offset: 3px; }
.prod-gallery__unavailable { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); }
.prod-gallery__unavailable svg { width: 64px; max-width: 65%; height: auto; }
.prod-gallery__viewport .fallback svg { width: 72px; height: 72px; }
@keyframes product-gallery-appear { from { opacity: .5; } to { opacity: 1; } }
@media (max-width: 820px) {
  .prod-gallery { position: static; }
  .prod-gallery__thumb { flex-basis: 64px; width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .prod-gallery__viewport > img { animation: none; }
  .prod-gallery__arrow, .prod-gallery__thumb { transition: none; }
}
