.product-gallery {
  width: min(100%, 22rem);
  min-width: 0;
  color: #17283e;
}

.product-gallery [hidden] {
  display: none;
}

.product-gallery-frame {
  position: relative;
  aspect-ratio: 1;
}

.product-gallery .product-gallery-slide {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: zoom-in;
}

.product-gallery .product-gallery-slide[hidden] {
  display: none;
}

.product-gallery .product-gallery-slide img,
.product-gallery .product-gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-gallery button {
  background: #fff;
  color: inherit;
  border: 1px solid #8490a2;
  border-radius: .5rem;
  font: inherit;
  cursor: pointer;
}

.product-gallery button:focus-visible,
.product-gallery-slide:focus-visible {
  outline: 3px solid #225fa0;
  outline-offset: -3px;
}

.product-gallery [data-gallery-prev],
.product-gallery [data-gallery-next] {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.65rem;
}

.product-gallery [data-gallery-prev] { inset-inline-start: 0; }
.product-gallery [data-gallery-next] { inset-inline-end: 0; }

.product-gallery-thumbs {
  display: flex;
  gap: .4rem;
  margin-top: .75rem;
  overflow-x: auto;
  padding: .2rem;
}

.product-gallery-thumbs button {
  flex: 0 0 3.25rem;
  height: 3.25rem;
  padding: .2rem;
}

.product-gallery-thumbs [aria-current="true"] {
  border: 2px solid #225fa0;
}

.product-gallery .product-gallery-play {
  display: block;
  margin: .4rem auto 0;
  padding: .35rem .7rem;
  min-height: 2.75rem;
  font-size: .9rem;
}

.product-gallery .product-gallery-play[hidden] {
  display: none;
}

.product-photo img.product-brand-logo {
  width: 5rem;
  height: 2.25rem;
  object-fit: contain;
  aspect-ratio: auto;
  margin-top: .85rem;
}

.product-gallery-empty {
  color: #49576a;
  text-align: center;
}

html:has(.product-gallery-dialog[open]) {
  overflow: hidden;
}

.product-gallery-dialog {
  width: fit-content;
  box-sizing: border-box;
  max-width: calc(100vw - 1rem);
  max-height: calc(100dvh - 1rem);
  overflow: auto;
  padding: .75rem;
  border: 0;
  border-radius: .75rem;
  background: #fff;
}

a[data-media-viewer="photo"] {
  cursor: zoom-in;
}

.product-gallery-dialog::backdrop {
  background: rgb(0 0 0 / 75%);
}

.media-viewer-controls {
  position: sticky;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  margin-bottom: .75rem;
  background: #fff;
}

.product-gallery-dialog .media-viewer-controls button {
  display: block;
  min-height: 2.75rem;
  max-width: 100%;
  padding: .5rem .75rem;
  border: 1px solid #17283e;
  border-radius: .5rem;
  font: inherit;
  cursor: pointer;
  background: #17283e;
  color: #fff;
  font-weight: 600;
}

.product-gallery-dialog > img {
  width: auto;
  height: auto;
  display: block;
  margin-inline: auto;
  max-width: 100%;
  max-height: calc(100dvh - 7rem);
  aspect-ratio: auto;
  object-fit: contain;
}

.product-gallery-dialog.pdf-viewer {
  width: min(96vw, 75rem);
  height: calc(100dvh - 1rem);
}

.pdf-viewer[open] {
  display: flex;
  flex-direction: column;
}

.media-viewer-controls a {
  color: #17283e;
  text-decoration: underline;
}

.pdf-viewer iframe {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .pickcard .pickvisual,
    .product-gallery-slide {
        overflow: hidden;
    }

    .pickcard :is(.pickvisual > img, .sm-finish-lead img, .sm-heading-photos img),
    .product-gallery-slide > img {
        transition: scale 200ms ease-out;
    }

    .pickcard:hover :is(.pickvisual > img, .sm-finish-lead img, .sm-heading-photos img),
    .product-gallery-slide:hover > img {
        scale: 1.05;
    }
}
