.product-template .product-gallery > * { position: relative; }
.product-template .product-gallery .product-visual__caption,
.product-template .product-gallery .product-gallery__item > figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.product-template .product-gallery .product-visual,
.product-template .product-gallery .product-gallery__item {
  aspect-ratio: 1;
  align-self: start;
}
.product-template .product-gallery img { display: block; }
.product-template .product-gallery > *,
.product-template .product-gallery-controls button,
.product-template .product-lightbox { background: #f4f5f3; }
.product-template .product-lightbox { color: #172b2a; }
.product-template .product-lightbox button {
  color: #172b2a;
  border-color: #69716b;
}
/* Keep the square source and mask aligned inside the responsive viewer. */
.product-lightbox figure img {
  width: min(100%, 78svh);
  height: auto;
  max-height: 100%;
  aspect-ratio: 1;
  align-self: center;
  justify-self: center;
}
.product-template .product-gallery .product-gallery__lifestyle img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: var(--lifestyle-position, 50% 65%);
}
.product-template .product-gallery .product-visual { display: block; }
.product-gallery__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  background: #e9ece8;
  color: #69716b;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
}
.product-template .product-title { max-width: none; }
.product-gallery-controls { min-width: 0; }
.product-gallery-controls button { flex-shrink: 0; }
.product-gallery-controls__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #e9ece8;
  color: #69716b;
  font-family: var(--sans);
  font-size: 8px;
}
@media (min-width: 961px) {
  .product-template .product-page {
    max-width: 1600px;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    column-gap: 40px;
  }
  .product-template .product-gallery,
  .product-template .product-gallery:has(> :nth-child(4)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .product-template .product-gallery > .product-visual { grid-column: auto; }
  .product-template .product-title { font-size: 32px; }
}
@media (max-width: 960px) {
  .product-template .product-gallery { gap: 12px; padding-bottom: 0; }
  .product-gallery-controls { gap: 8px; overflow-x: auto; padding-bottom: 4px; }
  .product-gallery-controls button { width: 44px; height: 44px; }
}
