product-gallery.product-gallery { display:block; min-width:0; }
.product-gallery > .gallery-cover,
.product-gallery > .gallery-empty {
  width:100%; height:auto; aspect-ratio:4/5; padding:0; border:0; border-radius:16px;
  background:var(--h2-mist);
}
.product-gallery .gallery-cover { position:relative; cursor:zoom-in; touch-action:pan-y pinch-zoom; }
.product-gallery .gallery-cover > img { width:100%; height:100%; object-fit:cover; }
.gallery-cover-caption {
  position:absolute; inset:auto 12px 12px; display:flex; align-items:center; justify-content:space-between;
  gap:10px; pointer-events:none;
}
.gallery-cover-caption :is(.gallery-count,.gallery-enlarge) {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-height:30px; margin:0; padding:0 11px; border:1px solid #ffffff3b; border-radius:100px;
  background:rgb(29 27 29 / .75); color:white; font-size:.73rem; font-weight:600; letter-spacing:.02em;
}
.gallery-count,.viewer-count { font-variant-numeric:tabular-nums; }
.gallery-enlarge svg,.photo-viewer svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
.gallery-enlarge svg { width:14px; height:14px; }
.product-gallery > .gallery-thumbs { gap:8px; margin-top:8px; padding:4px; scrollbar-width:thin; }
.product-gallery .gallery-thumb {
  flex:0 0 54px; height:66px; border-radius:7px; opacity:.78; background:var(--h2-mist);
}
.product-gallery .gallery-thumb[aria-pressed="true"] { opacity:1; outline:2px solid var(--accent); outline-offset:2px; }
.photo-viewer {
  position:fixed; inset:0; transform:none; margin:0; width:100%; max-width:none;
  height:100%; height:100dvh; max-height:none; overflow:hidden; padding:0;
  border:0; border-radius:0; color:#fff; background:var(--h2-ink); color-scheme:dark;
}
.photo-viewer[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
.photo-viewer::backdrop { background:var(--h2-ink); }
.viewer-header,.viewer-controls {
  display:flex; align-items:center; justify-content:space-between; gap:16px; min-width:0;
  padding-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right));
}
.viewer-header { padding-top:max(9px,env(safe-area-inset-top)); padding-bottom:9px; }
.viewer-header > div { min-width:0; }
.viewer-header span { display:block; color:var(--h2-silver); font-size:.61rem; font-weight:650; letter-spacing:.18em; }
.viewer-header strong { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:.94rem; font-weight:580; }
.photo-viewer button { display:inline-flex; align-items:center; justify-content:center; flex:none; min-width:44px; height:44px; padding:0; border:1px solid #ffffff35; border-radius:99px; background:#ffffff0c; color:inherit; }
.photo-viewer button:hover { background:#ffffff1d; }
.photo-viewer :focus-visible { outline:2px solid #b8caff; outline-offset:-3px; }
.viewer-stage { min-height:0; min-width:0; overflow:hidden; background:#0c0d12; touch-action:pan-y pinch-zoom; }
.viewer-canvas { display:grid; place-items:center; width:100%; height:100%; }
.viewer-canvas img { display:block; width:100%; height:100%; min-width:0; min-height:0; object-fit:contain; user-select:none; }
.viewer-stage.is-zoomed { overflow:auto; overscroll-behavior:contain; touch-action:pan-x pan-y pinch-zoom; cursor:grab; scrollbar-width:none; }
.viewer-stage.is-zoomed::-webkit-scrollbar { display:none; }
.viewer-stage.is-zoomed:active { cursor:grabbing; }
.viewer-controls { padding-top:9px; padding-bottom:max(10px,env(safe-area-inset-bottom)); }
.viewer-pages { display:flex; align-items:center; gap:8px; }
.viewer-pages button { border-color:transparent; }
.viewer-count { min-width:47px; text-align:center; font-size:.88rem; }
.photo-viewer .viewer-zoom { gap:6px; padding-inline:15px; font-size:.8rem; font-weight:600; }
.viewer-zoom svg { width:15px; height:15px; }
@media (max-width:720px) {
  .product-gallery > .gallery-cover,.product-gallery > .gallery-empty { aspect-ratio:4/5; border-radius:0; }
  .product-gallery > .gallery-thumbs { margin-inline:12px; }
  .product-gallery .gallery-thumb { flex-basis:48px; height:58px; }
}
