/* Galerie secondaire compacte, sans mode zoom. */
.managed-thumbs {
  width: 100%;
  padding-top: 8px;
}

.managed-thumbs > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  overflow: visible;
}

.managed-thumbs button {
  grid-column: auto;
  aspect-ratio: 4 / 3;
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #e6e2da;
  cursor: pointer;
}

.managed-thumbs button:nth-child(7n + 1),
.managed-thumbs button:nth-child(7n + 6) {
  grid-column: auto;
  grid-row: auto;
}

.managed-thumbs button:nth-child(7n + 4) {
  grid-column: auto;
}

.managed-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.managed-thumbs button:hover img {
  transform: scale(1.035);
}

.product-lightbox-stage,
.product-lightbox-stage.is-zoomed {
  display: grid;
  padding: 0;
  overflow: hidden;
  place-items: center;
}

.product-lightbox-stage img,
.product-lightbox-stage.is-zoomed img {
  width: auto;
  min-width: 0;
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  cursor: default;
  transition: none;
}

@media (max-width: 980px) {
  .managed-thumbs > div {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .managed-thumbs {
    padding-top: 24px;
  }

  .managed-thumbs > div {
    display: block;
    columns: 2;
    column-gap: 8px;
  }

  .managed-thumbs button {
    display: block;
    break-inside: avoid;
    width: 100%;
    height: auto;
    margin: 0 0 8px;
    aspect-ratio: 4 / 5;
  }

  .managed-thumbs button:nth-child(3n + 2) {
    aspect-ratio: 1 / 1;
  }

  .managed-thumbs button:nth-child(4n) {
    aspect-ratio: 4 / 3;
  }

  .managed-thumbs button:nth-child(7n + 1),
  .managed-thumbs button:nth-child(7n + 6) {
    grid-column: auto;
  }

  .managed-thumbs button:nth-child(7n + 4) {
    grid-column: auto;
  }
}
