/* Product-only repair: one clear main image, remaining source images as thumbnails. */
body.single-product .atlas-pdp-media {
  display: block !important;
  min-width: 0;
  width: 100% !important;
}

body.single-product .atlas-reference-product__gallery {
  display: block !important;
  min-width: 0;
  width: 100% !important;
}

body.single-product .atlas-pdp-media > .atlas-pdp-shot {
  aspect-ratio: 4 / 3;
  background: #f3f1ed;
  display: none !important;
  margin: 0 !important;
  overflow: hidden;
  place-items: center;
  width: 100% !important;
}

body.single-product .atlas-reference-product__gallery > .atlas-reference-product__media {
  aspect-ratio: 4 / 3;
  background: #f3f1ed;
  display: none !important;
  margin: 0 !important;
  min-height: 0 !important;
  overflow: hidden;
  place-items: center;
  width: 100% !important;
}

body.single-product .atlas-pdp-media > .atlas-pdp-shot.is-active {
  display: grid !important;
}

body.single-product .atlas-reference-product__gallery > .atlas-reference-product__media.is-active {
  display: grid !important;
}

body.single-product .atlas-pdp-media > .atlas-pdp-shot img {
  display: block;
  height: 100% !important;
  max-height: none !important;
  max-width: 100% !important;
  object-fit: contain;
  width: 100% !important;
}

body.single-product .atlas-reference-product__gallery > .atlas-reference-product__media img {
  display: block;
  height: 100% !important;
  max-height: none !important;
  max-width: 100% !important;
  object-fit: contain;
  padding: 0 !important;
  width: 100% !important;
}

.atlas-pdp-gallery-thumbs {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 12px;
}

.atlas-pdp-gallery-thumb {
  appearance: none;
  aspect-ratio: 1;
  background: #f3f1ed;
  border: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: border-color 160ms ease, opacity 160ms ease;
}

.atlas-pdp-gallery-thumb:hover {
  opacity: .82;
}

.atlas-pdp-gallery-thumb.is-active,
.atlas-pdp-gallery-thumb:focus-visible {
  border-color: #171717;
  outline: none;
}

.atlas-pdp-gallery-thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

@media (max-width: 900px) {
  body.single-product .atlas-pdp-media > .atlas-pdp-shot {
    aspect-ratio: 1 / 1;
  }

  body.single-product .atlas-reference-product__gallery > .atlas-reference-product__media {
    aspect-ratio: 1 / 1;
  }

  .atlas-pdp-gallery-thumbs {
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
