/* Product card image gallery: reusable listing-card structure and interaction. */
.mt-product-card-gallery {
  width: 100%;
}

.mt-product-card-gallery__stage {
  position: relative;
  aspect-ratio: 3 / 4;
}

.mt-product-card-gallery__viewport {
  height: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.mt-product-card-gallery__viewport::-webkit-scrollbar {
  display: none;
}

.mt-product-card-gallery__track {
  display: grid;
  height: 100%;
  grid-auto-columns: 100%;
  grid-auto-flow: column;
}

.mt-product-card-gallery__slide {
  display: block;
  height: 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.mt-product-card-gallery__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mt-product-card-gallery__arrow {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #111111;
  cursor: pointer;
  font-size: 24px;
  line-height: 24px;
  opacity: .82;
  transition: opacity .2s ease, background-color .2s ease;
}

.mt-product-card-gallery__arrow:hover,
.mt-product-card-gallery__arrow:focus-visible {
  opacity: 1;
  outline: none;
  transform: scale(1.1);
}

.mt-product-card-gallery__arrow--previous {
  left: 8px;
}

.mt-product-card-gallery__arrow--next {
  right: 8px;
}

.mt-product-card-gallery__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 0;
}

.mt-product-card-gallery__dot {
  position: relative;
  width: 18px;
  height: 3px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.mt-product-card-gallery__dot::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: #c7c7c7;
  transform: translateY(-50%);
  transition: background-color .2s ease;
}

.mt-product-card-gallery__dot.is-active::before {
  background: #111111;
}

.mt-product-card-gallery__dot:focus-visible {
  outline: 2px solid #111111;
  outline-offset: 1px;
}

@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  .mt-product-card-gallery__arrow {
    display: none;
  }
}
