/* Final shared product catalogue layout. Loaded after legacy page styles. */
.collection-gallery-section .shell {
  width: min(1440px, calc(100% - 48px));
}

.product-gallery,
.product-gallery.gallery-european-four-piece,
.product-gallery.gallery-milk-velvet-four-piece,
.product-gallery.gallery-cotton-quilt-comforter-insert,
.product-gallery.gallery-waterproof-bedding,
.product-gallery.gallery-mosquito-net,
.product-gallery.gallery-blanket,
.product-gallery.gallery-pillow {
  align-items: start;
  column-count: auto;
  display: grid;
  gap: 56px;
  grid-template-columns: 1fr;
  max-width: none;
}

.product-gallery.gallery-grouped {
  display: grid;
  gap: 72px;
  grid-template-columns: 1fr;
}

.product-subgroup {
  border-top: 1px solid #d5dad2;
  min-width: 0;
  padding-top: 24px;
  width: 100%;
}

.product-subgroup h3 {
  font: 600 clamp(30px, 2.6vw, 42px) / 1.12 var(--serif);
  hyphens: none;
  letter-spacing: 0;
  margin: 0 0 26px;
  overflow-wrap: normal;
  word-break: normal;
}

.product-subgroup-grid {
  align-items: start;
  display: grid;
  gap: 32px 24px;
  grid-auto-rows: auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  width: 100%;
}

.product-gallery figure,
.product-subgroup-grid .product-image,
.product-subgroup-grid .product-image:first-child,
.product-gallery .product-image:first-child {
  background: #fffdfa;
  border: 1px solid #e3e0d8;
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
}

.product-image-frame {
  aspect-ratio: 1 / 1;
  background: #f5f3ef;
  overflow: hidden;
  width: 100%;
}

.product-gallery img,
.product-subgroup-grid .product-image img,
.product-subgroup-grid .product-image:first-child img,
.product-gallery .product-image:first-child img {
  display: block;
  height: 100%;
  max-height: none;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  transition: transform 300ms ease;
  width: 100%;
}

.product-image figcaption,
.product-gallery .product-image:first-child figcaption,
.product-subgroup-grid .product-image:first-child figcaption {
  align-content: start;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  padding: 18px;
}

.product-image figcaption strong,
.product-gallery .product-image:first-child figcaption strong,
.product-subgroup-grid .product-image:first-child figcaption strong {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--ink);
  display: -webkit-box;
  font: 600 18px / 1.3 var(--sans);
  hyphens: none;
  margin: 0;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
}

.product-image figcaption span,
.product-gallery .product-image:first-child figcaption span,
.product-subgroup-grid .product-image:first-child figcaption span {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  display: -webkit-box;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  overflow: hidden;
}

.product-card-cta {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  gap: 9px;
  margin-top: 10px;
  text-decoration: none;
  white-space: nowrap;
}

.product-card-cta b {
  color: var(--clay);
  font: 16px var(--mono);
}

@media (hover: hover) {
  .product-image:hover {
    border-color: #cbc6bc;
    box-shadow: 0 5px 16px rgba(23, 35, 30, 0.05);
  }

  .product-image:hover img { transform: scale(1.02); }
}

@media (max-width: 1279px) {
  .product-subgroup-grid,
  .product-gallery:not(.gallery-grouped) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .product-subgroup-grid,
  .product-gallery:not(.gallery-grouped) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .collection-gallery-section .shell { width: min(100% - 32px, 1440px); }
  .product-gallery.gallery-grouped { gap: 52px; }
  .product-subgroup-grid,
  .product-gallery:not(.gallery-grouped) { grid-template-columns: 1fr; }
  .product-subgroup h3 { font-size: clamp(28px, 7vw, 34px); }
  .product-image figcaption { padding: 16px; }
}
