/* Product listings: the category page (Figma L3 - Hose 466:9124) and the subcategory page (L4 466:10264). Sizes and colours only
   from tokens (npm run lint:tokens). Collapse rules follow docs/responsive-spec.md section B (rows 3 and 4: 4 / 3 / 2 per row);
   the places that differ are logged in docs/decision-log.md. Plan: docs/listings-plan.md. Shares home.css (section header, card
   grid, cards, Popular carousel) and product.css (breadcrumbs, item card). */
.listing__sections { padding-inline: var(--gutter); }

/* Products page bands: the cards start 48 under the section headers (Figma L2: Container y 48 under the header), and Product
   Categories ends 60 under its cards. The bands themselves are the Home blocks. */
.listing--products .listing-categories .section-header,
.listing--products .home-featured .section-header { margin-bottom: var(--space-gap-2xl); }
.listing-categories { padding-block-end: var(--space-inset-3xl); }
/* The Featured Products cards on this page use the frame's 300 x 247.6 image box (Figma L2 ProductFeatureCard 387.6 high); the Home cards
   keep their own. */
.listing--products .product-card__media .media-contain { aspect-ratio: 300 / 247.555; }

/* The 12px rule under the title band (Header Bar 466:9172) opens the content. */
.listing-body {
  margin-top: var(--space-gap-2xl);
  border-top: var(--border-12-pixel) solid var(--color-border-rule);
}

/* Intro (Product Image 2107:16485): image and copy in two equal halves from 1024; stacked below. */
.listing-intro {
  display: grid;
  gap: var(--space-gap-2xl);
  align-items: center;
  padding-block: calc(var(--space-inset-3xl) + var(--border-2-pixel)) var(--space-section-md); /* Figma: the intro starts 62 under the rule (title frame 62 high) */
}
.listing-intro__media { aspect-ratio: 636 / 411; overflow: hidden; background: var(--color-bg-surface); }
.listing-intro__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.listing-intro__copy { display: grid; row-gap: var(--space-inset-md); padding-inline: var(--space-gap-md) var(--space-gap-2xl); }
.listing-intro--text .listing-intro__copy { padding-inline: 0; max-width: var(--measure-text); }
.listing-intro__title { margin: 0; text-box: trim-both cap alphabetic; }
.listing-intro__body { color: var(--color-text-primary); }
.listing-intro__body > * { margin: 0; }
.listing-intro__body > * + * { margin-top: var(--space-gap-xs); }
.listing-intro__body ul,
.listing-intro__body ol { padding-inline-start: var(--type-paragraph-large-regular-line-height, var(--space-gap-lg)); }
.listing-intro__body ul { list-style: disc; }
.listing-intro__body ol { list-style: decimal; }
.listing-intro__body li + li { margin-top: 0; }
.listing-intro__body a { color: inherit; text-underline-offset: var(--space-gap-5xs); }

/* Tiles and product grid: 4 per row from 1024, 3 from 768, 2 below (spec B-3 and B-4). The first block after the rule starts
   60 below it (Figma: rule at 48 to 60, content at 120); after the intro the gap is the intro's bottom padding plus this. */
.listing-tiles,
.listing-products,
.listing-empty { padding-top: var(--space-inset-3xl); }
.listing-intro + .listing-tiles { padding-top: var(--space-section-md); }
.listing-tiles { padding-bottom: var(--space-inset-3xl); } /* Figma: 60 under the last row, before the next band's 75 */
.listing-grid { margin: 0; padding: 0; list-style: none; }
.listing-tiles .card-grid--four,
.listing-products .card-grid--four,
.listing-related .card-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.listing-products { padding-bottom: var(--space-section-md); } /* Figma: 75 under the grid or the Load More block, then the next band's own 75 */

/* Counter and Load More (Load more button 2080:16381): 32 above, the counter (Paragraph/small, centred), 18 down to a large black button. */
.listing-more { display: flex; flex-direction: column; align-items: center; gap: calc(var(--space-gap-xs) + var(--border-2-pixel)); padding-top: var(--space-gap-lg); }
.listing-more__count { margin: 0; text-align: center; }
.listing-more .btn[aria-disabled="true"] { pointer-events: none; opacity: 0.6; }

/* Empty category: a clear message and the way back. */
.listing-empty { display: grid; justify-items: start; gap: var(--space-gap-lg); padding-bottom: var(--space-section-md); }
.listing-empty__text { margin: 0; }

/* The Popular and Expert Advice bands are the Home blocks; the tiles end flush, so the band's own top padding is the gap. */
.listing-advice,
.listing-related { padding-block-end: var(--space-section-lg); }
.listing-related .section-header { margin-bottom: calc(var(--space-gap-3xl) + var(--space-gap-3xs)); } /* Figma: the cards start 70 under the header */
/* Product image box: Figma's ProductItemCard in L4 is 300 x 247.6 (the category card's ratio), a closer fit for the wide hose photos
   than a square (Lance, 2026-11-20). The image keeps `contain`, so the whole product shows. */
.listing-products .item-card__media,
.listing-related .item-card__media { aspect-ratio: 300 / 247.555; }
.listing-products .item-card__media .media-contain,
.listing-related .item-card__media .media-contain { aspect-ratio: auto; height: 100%; object-fit: contain; }
.listing-advice .section-header { margin-bottom: var(--space-inset-2xl); }

@media (min-width: 768px) {
  .listing-tiles .card-grid--four,
  .listing-products .card-grid--four,
  .listing-related .card-grid--four { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .listing-intro { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-gap-2xl); }
  .listing-tiles .card-grid--four,
  .listing-products .card-grid--four,
  .listing-related .card-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
