.product-gallery { color: var(--color-ink); }
.gallery-toolbar, .gallery-toolbar [role="tablist"], .gallery-controls,
:is(.gallery-frame, .gallery-live) figcaption, .gallery-lightbox-bar {
  display: flex;
  align-items: center;
}
.gallery-toolbar { justify-content: space-between; gap: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--color-border); }
.gallery-toolbar [role="tablist"] { gap: clamp(12px, 2.8vw, 36px); }
.gallery-toolbar button, .gallery-lightbox button {
  border: 0; background: transparent; font: inherit; color: var(--color-muted);
}
.gallery-toolbar [role="tab"] {
  display: inline-flex; align-items: center; gap: 7px; position: relative;
  min-height: 44px; padding: 0 1px; font-weight: 550; font-size: .875rem; white-space: nowrap;
}
.gallery-toolbar [role="tab"][aria-selected="true"] { color: var(--color-ink); }
.gallery-toolbar [role="tab"][aria-selected="true"]::after {
  content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--color-primary);
}
.gallery-toolbar [role="tab"][aria-selected="true"] .icon { color: var(--color-primary); }
.gallery-toolbar [role="tab"]:hover { color: var(--color-primary); }
.gallery-toolbar .icon, .gallery-enlarge .icon { width: 16px; height: 16px; }
.role-short { display: none; }
.gallery-controls { gap: 2px; }
.gallery-controls button, .gallery-lightbox-bar button {
  display: inline-grid; place-items: center; width: 34px; height: 36px; border-radius: 6px;
}
.gallery-controls button:hover, .gallery-lightbox-bar button:hover { background: var(--color-soft); color: var(--color-ink); }
.gallery-position { margin-inline-end: 7px; color: var(--color-muted); font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
[data-playback]:not([data-paused]) svg:last-child,
[data-playback][data-paused] svg:first-child { display: none; }
.gallery-fallback-title { margin: 24px 0 10px; font-size: 1.125rem; }
.product-gallery.is-ready .gallery-fallback-title { display: none; }
.product-gallery.is-ready .gallery-frames { display: grid; }
.product-gallery.is-ready .gallery-frame { grid-area: 1 / 1; min-width: 0; }
.gallery-live { margin: 0; }
.gallery-original > :is(canvas, img) { display: block; width: 1440px; max-width: none; height: auto; margin-inline: auto; }
.gallery-image {
  position: relative; display: block; background: #f5f7fa; border-radius: 10px;
  overflow: hidden; isolation: isolate; cursor: zoom-in;
}
.gallery-image::after {
  content: ""; pointer-events: none; position: absolute; inset: 0;
  border: 1px solid rgb(23 43 67 / 13%); border-radius: inherit;
}
.gallery-image picture, .gallery-image img, .gallery-original picture, .gallery-original img { display: block; width: 100%; height: auto; }
.gallery-image:focus-visible { outline-offset: 2px; }
.gallery-enlarge {
  position: absolute; bottom: 10px; right: 10px; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 6px;
  background: #fff; color: var(--color-ink); box-shadow: 0 1px 5px #19294324; opacity: 0;
}
.gallery-image:hover .gallery-enlarge, .gallery-image:focus-visible .gallery-enlarge { opacity: 1; }
:is(.gallery-frame, .gallery-live) figcaption {
  justify-content: space-between; gap: 10px; padding: 9px 2px; color: var(--color-muted); font-size: .8125rem;
}
:is(.gallery-frame, .gallery-live) figcaption strong { color: var(--color-text); font-weight: 580; }
.gallery-lightbox {
  position: fixed; inset: 0; max-width: none; max-height: none;
  width: min(1500px, calc(100% - 32px)); padding: 0; border: 0;
  border-radius: 10px; color: var(--color-ink); background: white; overflow: hidden;
}
.gallery-lightbox[open] { display: flex; flex-direction: column; }
.gallery-lightbox::backdrop { background: rgb(10 19 32 / 76%); }
body:has(.gallery-lightbox[open]) { overflow: hidden; }
.gallery-lightbox-bar { justify-content: space-between; gap: 12px; padding: 4px 8px 4px 16px; border-bottom: 1px solid var(--color-border); }
.gallery-lightbox-bar strong { font-size: .875rem; font-weight: 600; }
.gallery-original { overflow: auto; overscroll-behavior: contain; max-height: calc(100dvh - 80px); background: #f5f7fa; }
.gallery-original picture { width: 1440px; margin-inline: auto; }
@media (max-width: 640px) {
  .gallery-toolbar { margin-bottom: 8px; gap: 4px; }
  .gallery-toolbar [role="tablist"] { gap: clamp(8px, 3vw, 18px); }
  .gallery-toolbar [role="tab"] { font-size: .8125rem; }
  .gallery-toolbar [role="tab"] .icon { display: none; }
  .gallery-toolbar:lang(en) { column-gap: 2px; }
  .gallery-toolbar:lang(en) .role-full { display: none; }
  .gallery-toolbar:lang(en) .role-short { display: inline; }
  .gallery-controls { gap: 0; }
  .gallery-controls button, .gallery-lightbox-bar button { width: 44px; height: 44px; }
  .gallery-position { margin-inline-end: 2px; }
  .gallery-image { border-radius: 8px; }
  .gallery-lightbox { width: calc(100% - 12px); }
  .gallery-original picture, .gallery-original > :is(canvas, img) { width: 390px; }
  .gallery-original { max-height: calc(100dvh - 60px); }
}
.gallery-stage { position:relative; isolation:isolate; background:#f4f6f9; border:1px solid var(--color-border); border-radius:10px; overflow:hidden; }
.gallery-stage iframe, .gallery-original iframe { width:100%; display:block; border:0; background:#f4f6f9; }
.gallery-stage iframe { height:clamp(480px,43vw,540px); pointer-events:none; }
.gallery-original iframe { height:min(800px,calc(100dvh - 90px)); }
[data-product-preview] [data-zoom-demo] { flex:none; display:grid;
  place-items:center; width:34px; height:34px; padding:0; color:var(--color-text); background:white;
  border:1px solid var(--color-border); border-radius:6px; cursor:zoom-in; }
[data-product-preview] [data-zoom-demo] .icon { width:17px; height:17px; }
[data-product-preview] [data-zoom-demo]:hover { color:var(--color-primary); }
.product-gallery [hidden] { display:none !important; }
@media (max-width:640px) { .gallery-stage iframe { height:540px; } }
.gallery-live figcaption span { margin-inline-start:auto; white-space:nowrap; }
.gallery-live figcaption { min-height:44px; padding:4px 2px; }
.gallery-loading .gallery-image { max-height:clamp(480px,43vw,540px); }
.gallery-loading .gallery-image img { object-fit:cover; object-position:top; }
@media (max-width:640px) { .gallery-loading .gallery-image { max-height:540px; } }
.gallery-stage.has-plots iframe { pointer-events:auto; }
.gallery-live .chapter-caption { position:absolute; width:1px; height:1px; min-height:0; padding:0; overflow:hidden; clip-path:inset(50%); }
.gallery-footer,.gallery-chapters,.gallery-tools { display:flex; align-items:center; gap:6px; }
.gallery-footer { justify-content:space-between; flex-wrap:wrap; padding:8px 0 4px; }
.gallery-chapters { flex-wrap:wrap; gap:3px; }
.gallery-chapters button { font:inherit; font-weight:550; font-size:.8125rem; border:0; padding:6px 10px;
  background:transparent; color:var(--color-muted); border-radius:6px; cursor:pointer; }
.gallery-chapters button:hover { background:var(--color-soft); }
.gallery-chapters [aria-pressed="true"] { background:#eaf0fd; color:#214caa; }
.gallery-tools { gap:10px; color:var(--color-muted); font-size:.8125rem; margin-inline-start:auto; }
@media (max-width:520px) {
  .gallery-chapters button { padding:6px; min-height:44px; }
  .gallery-tools { gap:4px; }
}
@media (max-width:640px) {
  [data-product-preview] [data-zoom-demo] { width:44px; height:44px; }
  .gallery-toolbar [role="tab"], .gallery-chapters button { min-width:44px; min-height:44px; }
}
@media (max-width:370px) {
  .gallery-toolbar .role-full { display:none; }
  .gallery-toolbar .role-short { display:inline; }
}
