.product-gallery img,
.detail-gallery img,
.detail-image .main-image-box img {
  max-width: 100%;
}

/* Shared gallery rules for both historical product page structures. */
.mn-gallery .mn-main-image,
.product-gallery .detail-main-image,
.detail-gallery .detail-main-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

body[data-page="product-fr"] .mn-thumbnails,
body[data-page="product"] .thumbnail-list,
.detail-gallery .thumbnail-list {
  display: flex;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px;
  scrollbar-width: thin;
}

body[data-page="product-fr"] .mn-thumb,
body[data-page="product"] .thumbnail-image,
.detail-gallery .thumbnail-image {
  flex: 0 0 76px;
  min-width: 0;
}

body[data-page="product"] .thumbnail-image,
.detail-gallery .thumbnail-image {
  aspect-ratio: 1 / 1;
  height: 76px;
}

.mn-thumb[hidden],
.product-thumbnail[hidden],
.thumbnail-image[hidden] {
  display: none;
}

.product-gallery .detail-main-image,
.detail-gallery .detail-main-image,
.main-image-box .detail-main-image,
#main-product-image {
  cursor: zoom-in;
}

.product-thumbnail,
.thumbnail-image,
.product-thumbnails img,
.thumbnail-list img {
  cursor: pointer;
  object-fit: contain;
}

.product-thumbnail.is-selected,
.thumbnail-image.is-selected,
.product-thumbnails img.is-selected,
.thumbnail-list img.is-selected {
  outline: 2px solid #b8486d;
  outline-offset: 2px;
}

.product-image-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 54px 64px;
  border: 0;
  background: #161216;
  color: #fff;
}

.product-image-viewer::backdrop {
  background: rgb(15 12 14 / 92%);
}

.product-viewer-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-image-viewer button {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgb(255 255 255 / 50%);
  border-radius: 50%;
  background: rgb(20 16 18 / 75%);
  color: #fff;
  font: 32px/1 Arial, sans-serif;
  cursor: pointer;
}

.product-viewer-close { top: 16px; right: 18px; }
.product-viewer-previous { top: 50%; left: 12px; transform: translateY(-50%); }
.product-viewer-next { top: 50%; right: 12px; transform: translateY(-50%); }

/* Shared layout and selection states for both product gallery generations. */
.mn-gallery,
.product-gallery,
.detail-gallery {
  min-width: 0;
  max-width: 100%;
}

.mn-main-image,
.detail-main-image,
#mn-main-image,
#main-product-image,
.main-image-box img {
  display: block;
  max-width: 100%;
  object-fit: contain;
}

.mn-main-image.is-image-unavailable,
.detail-main-image.is-image-unavailable,
#mn-main-image.is-image-unavailable,
#main-product-image.is-image-unavailable {
  display: none;
}

.product-image-placeholder {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 24px;
  border: 1px dashed #d8d0cc;
  color: #675d61;
  text-align: center;
}

.mn-thumbnails,
.thumbnail-list,
.product-thumbnails {
  min-width: 0;
  max-width: 100%;
  scrollbar-width: thin;
}

.mn-thumb.is-selected,
.mn-thumb.is-active {
  border-color: #b8486d;
  outline: 2px solid #b8486d;
  outline-offset: 1px;
}

.mn-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.mn-section[hidden],
.product-specifications[hidden],
.specifications[hidden] {
  display: none !important;
}

.mn-table td,
.mn-table th,
.specifications-table td,
.specifications-table th {
  overflow-wrap: anywhere;
  word-break: normal;
}

@media (max-width: 640px) {
  body[data-page="product-fr"] .mn-thumb,
  body[data-page="product"] .thumbnail-image,
  .detail-gallery .thumbnail-image {
    flex-basis: 64px;
    height: 64px;
  }

  .product-image-viewer { padding: 66px 12px; }
  .product-viewer-previous { left: 5px; }
  .product-viewer-next { right: 5px; }
  .product-image-viewer button { width: 40px; height: 40px; }

  .mn-gallery .mn-thumbnails,
  .product-gallery .thumbnail-list,
  .detail-gallery .thumbnail-list,
  .product-gallery .product-thumbnails,
  .detail-gallery .product-thumbnails {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    padding: 3px 2px 8px;
  }

  .mn-gallery .mn-thumb,
  .product-gallery .thumbnail-image,
  .product-gallery .product-thumbnail,
  .detail-gallery .thumbnail-image,
  .detail-gallery .product-thumbnail {
    flex: 0 0 68px;
    width: 68px;
    max-width: 68px;
  }

  .mn-nav-primary,
  .mn-nav-secondary {
    max-width: 100%;
  }

   .mn-page,
  .product-page,
  .product-summary,
  .mn-info {
    min-width: 0;
    max-width: 100%;
  }
}
/* MacNail: smooth product image hover zoom */
@media (hover: hover) and (pointer: fine) {
  .mn-gallery,
  .product-gallery,
  .detail-gallery {
    overflow: hidden;
  }

  .mn-gallery .mn-main-image,
  .product-gallery .detail-main-image,
  .detail-gallery .detail-main-image,
  .product-gallery #main-product-image,
  .detail-gallery #main-product-image,
  .main-image-box img,
  #mn-main-image {
    transform: scale(1);
    transform-origin: center center;
    transition: transform 350ms ease;
    will-change: transform;
  }

  .mn-gallery:hover .mn-main-image,
  .product-gallery:hover .detail-main-image,
  .detail-gallery:hover .detail-main-image,
  .product-gallery:hover #main-product-image,
  .detail-gallery:hover #main-product-image,
  .main-image-box:hover img,
  .mn-gallery:hover #mn-main-image {
    transform: scale(1.08);
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .mn-main-image,
  .detail-main-image,
  #mn-main-image,
  #main-product-image,
  .main-image-box img {
    transition: none !important;
  }
}
 /* Fix: trigger zoom only when hovering the main product image */
@media (hover: hover) and (pointer: fine) {
  .mn-gallery .mn-main-image:hover,
  .product-gallery .detail-main-image:hover,
  .detail-gallery .detail-main-image:hover,
  .product-gallery #main-product-image:hover,
  .detail-gallery #main-product-image:hover,
  #mn-main-image:hover,
  .main-image-box img:hover {
    transform: scale(1.12) !important;
    transform-origin: center center;
    transition: transform 350ms ease !important;
    cursor: zoom-in;
  }

  .mn-gallery .mn-main-image,
  .product-gallery .detail-main-image,
  .detail-gallery .detail-main-image,
  #mn-main-image,
  #main-product-image,
  .main-image-box img {
    transition: transform 350ms ease !important;
  }
}