/* cl-home.css: BMR Suspension's home (templates/home.html), from their measurements: sections of 90px top
   and 60px bottom space under a red 60px bar and a black uppercase 34px heading, dark photo tiles, white
   product cards and the black assurance bar. Square boxes (one radius, 0).
   Every rule sits in @layer site (cl-site.css: the layer order). */
@layer base, kit, site;

@layer site {

.cl-hero { display: block; background: var(--site-ink); border-top: 3px solid var(--site-ink); }
.cl-hero img { width: 100%; height: auto; aspect-ratio: 1548 / 446; object-fit: cover; }

/* a section and its head */
.cl-sec { padding: 90px 0 60px; }
.cl-sec--grey { background: linear-gradient(#FAFAFA, #F5F5F5); border-top: 1px solid rgba(0, 0, 0, .04); border-bottom: 1px solid rgba(0, 0, 0, .04); }
.cl-sec__in { max-width: calc(var(--site-max) + 2 * var(--site-gutter)); margin: 0 auto; padding: 0 var(--site-gutter); }
.cl-sec__head { min-height: 85px; }
.cl-sec__head::before { content: ""; display: block; width: 60px; height: 3px; background: var(--site-accent); }
.cl-sec__title { margin-top: 14px; font: 900 34px/37.4px var(--site-font-heading); text-transform: uppercase; color: var(--site-fg); }
.cl-sec__text { max-width: 680px; margin-top: 8px; font: 400 15px/22.5px var(--site-font-body); color: var(--site-fg); }

/* the dark tiles: Shop by Make, Shop by Category */
.cl-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px 30px; margin: 34px 0 24px; }
.cl-tile { position: relative; display: block; height: 240px; overflow: hidden; background: #0B0B0B; border: 1px solid rgba(255, 255, 255, .08); color: #FFFFFF; }
.cl-tile__img { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); max-width: none; object-fit: cover; filter: saturate(1.05) contrast(1.05); transition: transform .4s ease; }
.cl-sec--makes .cl-tile__img { object-fit: contain; }
.cl-tile::after { content: ""; position: absolute; inset: 0; background: radial-gradient(700px 240px at 20% 80%, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, 0) 60%), linear-gradient(rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, .7) 100%); }
.cl-tile:hover .cl-tile__img { transform: scale(1.04); }
.cl-tile__body { position: absolute; z-index: 1; left: 17px; right: 17px; bottom: 29px; display: grid; gap: 6px; justify-items: start; }
.cl-tile__name { font: 900 28px/30.8px var(--site-font-heading); }
.cl-tile__link { font: 800 15.2px/22px var(--site-font-body); color: var(--site-accent); border-bottom: 3px solid var(--site-accent); line-height: 19px; }

/* the product cards: New Products and the row of parts */
.cl-cards { display: grid; gap: 31px 30px; margin-top: 34px; }
.cl-cards--new { grid-template-columns: repeat(2, 360px); justify-content: center; column-gap: 18px; }
.cl-cards--more { grid-template-columns: repeat(4, 288px); justify-content: center; margin-bottom: 40px; }
.cl-sec--more .cl-sec__head { min-height: 130px; }
.cl-sec--more { padding-top: 92px; }
.cl-sec--new { padding-bottom: 50px; }
.cl-card { display: flex; flex-direction: column; background: #FFFFFF; border: 1px solid rgba(0, 0, 0, .08); transition: border-color .3s; }
.cl-card:hover { border-color: var(--site-accent); }
.cl-card__media { display: block; aspect-ratio: 1; padding: 18px; background: linear-gradient(rgba(0, 0, 0, .02), rgba(0, 0, 0, 0)); }
.cl-card__media img { width: 100%; height: 100%; object-fit: contain; }
.cl-card__body { min-height: 127px; padding: 14px 16px; }
.cl-card__meta { display: flex; justify-content: space-between; gap: 8px; font: 700 12px/22px var(--site-font-body); }
.cl-card__sku { padding-left: 8px; border-left: 3px solid var(--site-accent); font-weight: 800; }
.cl-card__title { display: -webkit-box; margin-top: 8px; font: 700 14px/17.5px var(--site-font-body); -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cl-card__title:hover { color: var(--site-accent); }

/* the assurance bar */
.cl-assure { background: var(--site-ink); color: var(--site-ink-fg); padding: 29px 0; }
.cl-assure__in { max-width: calc(var(--site-max) + 2 * var(--site-gutter)); margin: 0 auto; padding: 0 var(--site-gutter); display: grid; grid-template-columns: repeat(4, 1fr); }
.cl-assure__item { display: flex; align-items: flex-start; justify-content: center; gap: 16px; min-height: 102px; padding: 18px 16px; }
.cl-assure__item + .cl-assure__item { border-left: 1px solid var(--site-ink-line); }
.cl-assure__icon { flex: none; margin-top: 2px; }
.cl-assure__title { display: block; font: 600 14px/22px var(--site-font-body); }
.cl-assure__text { display: block; margin-top: 4px; font: 400 14.4px/20.16px var(--site-font-body); }
.cl-assure__item:hover .cl-assure__title { color: var(--site-accent); }

/* the night theme (cl-site.css): the grey sections a step up from the page, the white cards on the card colour with
   their photos on a white plate; the dark photo tiles and the black assurance bar are dark in both themes */
:root[data-parts-theme="dark"] .cl-sec--grey { background: var(--site-card); border-color: var(--site-line); }
:root[data-parts-theme="dark"] .cl-card { background: var(--site-card); border-color: var(--site-line); }
:root[data-parts-theme="dark"] .cl-card__media { background: #FFFFFF; }

@media (max-width: 979.98px) {
  /* their phone home shows the hero first and the vehicle search under it: the page's flow puts the kit's
     band (the one section outside main) after the hero, without moving it in the markup */
  .cl-home-page { display: flex; flex-direction: column; }
  .cl-home-page > * { order: 4; }
  .cl-home-page > .cl-hd { order: 0; }
  .cl-home-page > main { display: contents; }
  .cl-hero { order: 1; border-top: 0; }
  .cl-home-page > section { order: 2; }
  .cl-home > :not(.cl-hero) { order: 3; }
  .cl-sec--makes { padding-top: 104px; }
  .cl-sec--cats .cl-sec__head { min-height: 98px; }
  .cl-sec--new { padding-bottom: 54px; }
  .cl-sec__head { min-height: 0; text-align: center; }
  .cl-sec__head::before { margin: 0 auto; }
  .cl-sec__title { font-size: 24px; line-height: 26.4px; }
  .cl-sec__text { margin: 10px auto 0; }
  .cl-tiles { grid-template-columns: 1fr; }
  .cl-cards--new { grid-template-columns: 1fr; row-gap: 18px; }
  .cl-cards--new .cl-card__body { min-height: 127px; }
  .cl-cards--more { grid-template-columns: none; grid-template-rows: auto auto; grid-auto-flow: column; grid-auto-columns: 260px; justify-content: start; gap: 30px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 34px calc(-1 * var(--site-gutter)) 44px; padding: 0 50px; scroll-padding: 0 50px; }
  .cl-cards--more .cl-card { scroll-snap-align: start; }
  .cl-sec--more .cl-sec__head { min-height: 143px; }
  .cl-assure__in { grid-template-columns: 1fr; }
  .cl-assure__item { justify-content: flex-start; min-height: 0; padding: 23px 16px 23px 48px; }
  .cl-assure__item + .cl-assure__item { border-left: 0; border-top: 1px solid var(--site-ink-line); }
}

}
