.do-gallery-rail {
  position: relative;
  min-width: 0;
  width: 100%;
}
.do-product-page .do-product .do-gallery-strip,
.do-gallery-strip {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x;
}
.do-gallery-strip::-webkit-scrollbar { display: none; }
.do-gallery-strip > button {
  flex-shrink: 0;
  scroll-snap-align: center;
}
.do-gallery-rail__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  background: #fff;
  color: #2c2b2a;
  font: 400 26px/1 Arial,sans-serif;
  box-shadow: 0 2px 8px #0002;
  transform: translateY(-50%);
  cursor: pointer;
}
.do-gallery-rail.has-overflow > .do-gallery-rail__arrow { display: flex; }
.do-gallery-rail.has-overflow { box-sizing: border-box; padding-inline: 40px; }
.do-gallery-rail__arrow:nth-last-child(2) { left: 4px; }
.do-gallery-rail__arrow:last-child { right: 4px; }
.do-gallery-rail__arrow:disabled { visibility: hidden; }
.do-gallery-rail__arrow:nth-last-child(2):disabled { visibility: visible; opacity: .4; cursor: default; box-shadow: none; }
.do-gallery-rail button:focus-visible { outline: 2px solid #ba0f26; outline-offset: -3px; }

dialog[data-gallery-viewer][open] {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(1280px, calc(100vw - 32px));
  height: min(900px, calc(100dvh - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  padding: 52px 24px 16px;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: #fff;
  overscroll-behavior: contain;
}
.do-gallery-viewer__frame {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}
.do-gallery-zoom__layer,
.do-gallery-zoom__layer > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.do-gallery-zoom__layer { transform-origin: center; }
.do-gallery-viewer__frame.is-zoomed { cursor: grab; touch-action: none; }
.do-gallery-viewer__frame.is-zoomed:active { cursor: grabbing; }
.do-gallery-zoom__toggle {
  position: absolute; top: 8px; right: 8px; z-index: 4;
  display: grid; place-items: center; width: 44px; height: 44px;
  padding: 0; border: 1px solid #e0e0e0; border-radius: 50%;
  background: #fff; color: #2c2b2a; cursor: pointer;
  box-shadow: 0 2px 8px #0002;
}
.do-gallery-zoom__toggle:hover,
.do-gallery-zoom__toggle[aria-pressed="true"] { color: #ba0f26; border-color: #ba0f26; }
.do-gallery-zoom__toggle:focus-visible { outline: 2px solid #ba0f26; outline-offset: 2px; }
.do-gallery-standalone { position: relative; }
.do-gallery-standalone__open {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  border: 0; padding: 0; background: transparent; cursor: zoom-in;
}
.do-gallery-standalone__open > span {
  position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center;
  width: 44px; height: 44px; border: 1px solid #e0e0e0; border-radius: 50%;
  background: #fff; color: #2c2b2a;
}
.do-gallery-standalone__open:focus-visible { outline: 2px solid #ba0f26; outline-offset: -3px; }
.do-gallery-viewer__close {
  position: absolute; top: 8px; right: 16px; min-height: 44px; padding: 8px;
  border: 0; background: transparent; color: #2c2b2a; font: inherit; cursor: pointer;
}
dialog[data-gallery-clinical] .do-gallery-viewer__frame { width: 100%; height: 100%; }
dialog[data-gallery-clinical] .do-gallery-zoom__layer > img { max-height: 100%; }
dialog[data-gallery-clinical] .do-gallery-zoom__toggle { min-width: 44px; min-height: 44px; background: white; color: #2c2b2a; padding: 0; }
@media (max-width: 640px) {
  dialog[data-gallery-clinical] .do-gallery-viewer__frame { grid-column: 1 / -1; grid-row: 1; }
}
dialog[data-gallery-viewer] > .do-gallery-rail { flex: 0 0 auto; }
dialog[data-gallery-viewer] :is(.do-product__lightbox-controls, .do-photo-library__controls) {
  flex: 0 0 auto;
  justify-content: center;
  gap: 24px;
  padding: 0;
}
dialog[data-gallery-viewer] > p {
  flex: 0 0 auto;
  max-height: 44px;
  margin: 0;
  overflow: auto;
  font-size: 13px;
}
.do-gallery-viewer__thumbs { margin: 0; padding: 3px 0; }
dialog:is([data-gallery-viewer], [data-gallery-clinical]) .do-gallery-viewer__thumb {
  display: block;
  width: 80px;
  height: 64px;
  padding: 4px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
dialog:is([data-gallery-viewer], [data-gallery-clinical]) .do-gallery-viewer__thumb[aria-pressed="true"] { border-color: #ba0f26; }
dialog[data-gallery-clinical] > .do-gallery-rail { flex: 0 0 auto; }
dialog[data-gallery-clinical] .do-gallery-rail__arrow {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  color: #2c2b2a;
  background: white;
}
.do-gallery-viewer__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
[data-gallery-hero] [data-do-stage] { touch-action: pan-y; }
@media (max-width: 700px) {
  dialog[data-gallery-viewer][open] {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 52px 12px 12px;
    gap: 10px;
  }
  dialog:is([data-gallery-viewer], [data-gallery-clinical]) .do-gallery-viewer__thumb { width: 64px; height: 56px; }
}
