.gallery-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 28px;
  clip-path: inset(0 round 28px);
  touch-action: pan-y;
  cursor: zoom-in;
}

.gallery-viewport:active { cursor: zoom-in; }

.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  transform: translate3d(0, 0, 0);
}

.gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery {
  position: relative;
  padding: 25px 25px 32px;
}

.gallery-nav {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 20px;
  min-height: 0;
  padding: 10px 18px;
  margin: 0;
  gap: 0;
  border-radius: 999px;
  background: #111111;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  transform: translateX(-50%);
  pointer-events: none;
}

.gallery-nav b {
  display: block;
  color: #fff;
  font-size: inherit;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.gallery-nav button {
  display: grid;
  place-items: center;
  padding: 0 0 5px;
  color: #000;
  line-height: 1;
  width: 47px;
  height: 47px;
  font-size: 27px;
}

.gallery-nav button:active { transform: scale(.94); }

.gallery-nav button { display: none; }

.gallery-edge-controls {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.gallery-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transition: background-color .2s ease, opacity .2s ease;
}

.gallery-edge-prev { left: 0; }
.gallery-edge-next { right: 0; }

.gallery-edge span {
  display: block;
  font-size: 46px;
  font-weight: 300;
  line-height: 1;
  transform: translateX(0);
  transition: transform .2s ease;
}

.gallery-edge:hover,
.gallery-edge:focus-visible {
  opacity: 1;
  background: rgba(0, 0, 0, .38);
  outline: none;
}

.gallery-edge-prev:hover span { transform: translateX(-3px); }
.gallery-edge-next:hover span { transform: translateX(3px); }

@media (max-width: 900px) {
  .gallery { padding: 12px 12px 18px; }
  .gallery-viewport {
    border-radius: 19px;
    clip-path: inset(0 round 19px);
  }
  .gallery-nav { left: 50%; bottom: 14px; min-height: 0; margin: 0; padding: 8px 14px; font-size: 18px; gap: 0; }
  .gallery-nav button { width: 32px; height: 32px; font-size: 20px; }
  .gallery-edge-controls { display: none; }
}

.gallery-viewport > .zoom-cue { display: none; }

.product-preview > .zoom-cue {
  position: absolute;
  z-index: 3;
  top: 22px;
  right: 22px;
  display: block;
  width: 42px;
  height: 42px;
  color: #fff;
  pointer-events: none;
}

.product-preview > .zoom-cue svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
}

.product-preview:has(.size-card:not([hidden])) > .zoom-cue {
  display: none;
}

@media (max-width: 900px) {
  .product-preview > .zoom-cue {
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
  }
}
