/*
  Simply LEDs - linen v2 product card (Kate, 29 Nov 2026).
  Scope: ONLY the homepage module "The latest in our range" (section product_list_MLYhNF) and the category grids
  (section main-collection on collection.json and collection.outdoor-master-page.json). Search, recommendations,
  featured-product, cart etc. keep the stock card. Markup is switched on in Liquid by snippets/linen-scope.liquid;
  the same two section names are used as the CSS scope below.
  Tokens: ink #2B2B2B, subtle #6B6862, muted #9C988F, well #FAFAF8, line #E4E2DC, mint #E8F3EA, green-deep #1F6B37, green-action #1F8A45.
*/

:is(
  [id$="__product_list_MLYhNF"],
  [id$="__main-collection"],
  [id$="__product_list_KcyDP3"],
  [id$="__product_recommendations_YYWLzM"]
) {
  --linen-ink: #2b2b2b;
  --linen-subtle: #6b6862;
  --linen-muted: #9c988f;
  --linen-gap: 24px;
  --linen-title: 16px;
  --linen-price: 18px;
  --linen-was: 14px;
  --linen-light: 13px;
  --linen-dot: 11px;
  --linen-body-gap: 6px;
  --linen-body-top: 8px;

  @media (max-width: 989px) {
    --linen-gap: 20px;
  }

  @media (max-width: 749px) {
    --linen-gap: 16px;
    --linen-title: 15px;
    --linen-price: 16px;
    --linen-was: 13px;
    --linen-light: 12px;
    --linen-dot: 10px;
    --linen-body-gap: 5px;
    --linen-body-top: 7px;
  }

  /* ---- card frame ---- */
  & product-card .product-card__content {
    gap: var(--linen-body-gap);
    padding: 0;
  }

  & product-card .card-gallery {
    --gallery-aspect-ratio: 4 / 3 !important;
    margin-bottom: var(--linen-body-top);
    overflow: hidden;
    background: #fafaf8;
    border-radius: 12px;
  }

  & product-card .card-gallery .product-media__image,
  & product-card .card-gallery img {
    object-fit: contain !important;
  }

  & product-card .card-gallery slideshow-arrows {
    display: none !important;
  }

  /* ---- image callout pills ---- */
  & .linen-pills {
    position: absolute;
    left: 0;
    bottom: 10px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    pointer-events: none;
  }

  & .linen-pill {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    font-family: var(--font-body--family);
    font-size: 11px;
    font-weight: 500;
    line-height: 11px;
    color: #2b2b2b;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1px #e4e2dc;
  }

  & .linen-pill--lumens {
    background: #f7f6f2;
  }

  & .linen-pill--soldout {
    background: #f0efec;
  }

  @media (max-width: 749px) {
    & .linen-pills {
      bottom: 8px;
      gap: 4px;
    }

    & .linen-pill {
      height: 20px;
      padding: 0 8px;
      font-size: 10px;
      line-height: 10px;
    }
  }

  /* ---- card body ---- */
  & product-card .group-block {
    padding: 0;
  }

  & product-card .group-block-content {
    gap: var(--linen-body-gap);
  }

  & product-card .text-block.spacing-style,
  & product-card product-price.spacing-style {
    padding: 0;
  }

  & product-card a[ref="productTitleLink"] p {
    margin: 0;
    font-family: var(--font-body--family);
    font-size: var(--linen-title);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    color: var(--linen-ink);
  }

  /* light-type row */
  & .linen-light {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body--family);
    font-size: var(--linen-light);
    font-weight: 400;
    line-height: 1.3;
    color: var(--linen-subtle);
  }

  /* swatch dots: Kate's recommended Soft Daylight set (featured-products-07/remaining-spots) */
  & .linen-light__swatch {
    flex: 0 0 var(--linen-dot);
    width: var(--linen-dot);
    height: var(--linen-dot);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgb(43 43 43 / 0.1);
  }

  & .linen-light__swatch--white {
    background: #f3ede0;
    box-shadow: inset 0 0 0 1px #e4e2dc;
  }

  & .linen-light__swatch--white-ambiance {
    background: linear-gradient(135deg, #e8b86a 0%, #f7f6f2 50%, #c9d7e8 100%);
  }

  & .linen-light__swatch--white-colour {
    background:
      linear-gradient(135deg, #f3ede0 0 40%, transparent 40%),
      conic-gradient(from 90deg, #e25b6d, #e8a04a, #e8c85a, #4db88a, #5b8def, #8b6bc9, #e25b6d);
  }

  & .linen-light__swatch--colour {
    background: conic-gradient(from 90deg, #e25b6d, #e8a04a, #e8c85a, #4db88a, #5b8def, #8b6bc9, #e25b6d);
  }

  & .linen-light__swatch--gradient {
    background: linear-gradient(90deg, #c45ba8 0%, #e25b6d 28%, #e8a04a 55%, #e8c85a 75%, #5b8def 100%);
  }

  /* a card with no light type leaves an empty wrapper from the light-row block: drop it so the card keeps its spacing */
  & product-card :is(.product-card__content, .group-block-content) > div:not(:has(*), .card-gallery) {
    display: none;
  }

  /* price + was-price (strikethrough only, no sale badge) */
  & product-card product-price.text-block.text-block {
    font-family: var(--font-body--family);
    font-size: var(--linen-price);
    font-weight: 600;
    line-height: normal;
    letter-spacing: -0.02em;
    color: var(--linen-ink);
  }

  & product-card product-price.text-block > *,
  & product-card product-price.text-block .price,
  & product-card product-price.text-block bdi {
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    color: inherit;
  }

  & product-card product-price.text-block .compare-at-price {
    margin-inline-start: 8px;
    font-size: var(--linen-was);
    font-weight: 400;
    letter-spacing: 0;
    color: var(--linen-muted);
    text-decoration-color: var(--linen-muted);
  }

  & product-card product-price.text-block .compare-at-price bdi {
    font-size: inherit;
  }
}

/* ======== homepage module 07: The latest in our range ======== */
[id$="__product_list_MLYhNF"] {
  & .section {
    --page-margin: 80px;
    padding-block: 88px 96px;
    row-gap: 32px;
    background: #fff;

    @media (max-width: 989px) {
      --page-margin: 40px;
      padding-block: 56px 64px;
    }

    @media (max-width: 749px) {
      --page-margin: 20px;
      padding-block: 40px 48px;
      row-gap: 24px;
    }
  }

  & .resource-list--grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--linen-gap);

    @media (max-width: 989px) and (min-width: 750px) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    @media (max-width: 749px) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
}

/* ---- module 07 header: Just in pill, H2, subline, View all ---- */
[id$="__product_list_MLYhNF"] .section-resource-list__header {
  & .group-block {
    padding: 0;
  }

  & .group-block-content {
    position: relative;
    align-items: flex-end;
    gap: 24px;
  }

  & .text-block {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    max-width: none;
    padding: 0;
  }

  & .text-block > p:first-child {
    display: inline-flex;
    align-items: center;
    height: 26px;
    margin: 0 0 10px;
    padding: 0 12px;
    border-radius: 999px;
    background: #e8f3ea;
    font-family: var(--font-body--family);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1f6b37;
  }

  & .text-block h2 {
    margin: 0 0 8px;
    font-family: var(--font-body--family);
    font-size: 40px;
    font-weight: 600;
    line-height: normal;
    letter-spacing: -0.03em;
    color: #2b2b2b;
  }

  & .text-block > p:last-child {
    margin: 0;
    max-width: 60ch;
    font-family: var(--font-body--family);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0;
    text-transform: none;
    color: #6b6862;
  }

  & a.button-unstyled {
    flex: none;
    padding: 0;
    font-family: var(--font-body--family);
    font-size: 14px;
    font-weight: 600;
    line-height: normal;
    text-decoration: none;
    white-space: nowrap;
    color: #1f8a45;
  }

  & a.button-unstyled::after {
    content: "\00a0\2192";
  }

  @media (max-width: 989px) {
    & .text-block h2 {
      font-size: 32px;
    }

    & .text-block > p:last-child {
      font-size: 15px;
    }
  }

  @media (max-width: 749px) {
    & .text-block h2 {
      font-size: 28px;
    }

    & .text-block > p:last-child {
      font-size: 14px;
    }

    & .text-block > p:first-child {
      margin-bottom: 8px;
    }

    & a.button-unstyled {
      position: absolute;
      top: 0;
      right: 0;
      line-height: 26px;
    }
  }
}

/* ======== category grids (collection.json + collection.outdoor-master-page.json) ======== */
[id$="__main-collection"] {
  & .product-grid.product-grid--grid[product-grid-view="default"] {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: var(--linen-gap);

    @media (max-width: 989px) and (min-width: 750px) {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    @media (max-width: 749px) {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
  }

  & .main-collection-grid {
    --padding-inline-start: 72px !important;
    --padding-inline-end: 72px !important;

    @media (max-width: 989px) {
      --padding-inline-start: 40px !important;
      --padding-inline-end: 40px !important;
    }

    @media (max-width: 749px) {
      padding-inline: 20px !important;
    }
  }
}

/* ======== shared 4 / 3 / 2 grid for the 404 list and "You may also like" ======== */
:is([id$="__product_list_KcyDP3"], [id$="__product_recommendations_YYWLzM"]) {
  & .resource-list--grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--linen-gap);

    @media (max-width: 989px) and (min-width: 750px) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    @media (max-width: 749px) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  & .resource-list__item {
    min-width: 0;
  }

  & .section-resource-list__content {
    padding: 0;
  }

  & .section-resource-list__content .text-block,
  & .section-resource-list__header .text-block {
    max-width: none;
    padding: 0;
  }

  & .section-resource-list__content .text-block h2,
  & .section-resource-list__header .text-block h2 {
    margin: 0;
    font-family: var(--font-body--family);
    font-weight: 600;
    line-height: normal;
    letter-spacing: -0.03em;
    color: #2b2b2b;
  }
}

/* ======== 404 page: product list (product_list_KcyDP3) ======== */
[id$="__product_list_KcyDP3"] {
  & .section {
    --page-margin: 80px;
    padding-block: 40px 72px;
    row-gap: 24px;
    background: #fff;

    @media (max-width: 989px) {
      --page-margin: 40px;
      padding-block: 32px 56px;
      row-gap: 20px;
    }

    @media (max-width: 749px) {
      --page-margin: 20px;
      padding-block: 28px 48px;
      row-gap: 16px;
    }
  }

  & .section-resource-list__header .group-block,
  & .section-resource-list__header .group-block-content {
    align-items: flex-start;
    padding: 0;
    gap: 0;
    text-align: left;
  }

  & .section-resource-list__header .text-block h2 {
    font-size: 28px;

    @media (max-width: 989px) {
      font-size: 24px;
    }

    @media (max-width: 749px) {
      font-size: 22px;
    }
  }
}

/* ======== 404 page: intro (main-404, only when this page also carries the list above) ======== */
body:has([id$="__product_list_KcyDP3"]) [id$="__main"] {
  & .section {
    --page-margin: 80px;
    min-height: 0;
    padding-block: 64px 8px;
    background: #fff;

    @media (max-width: 989px) {
      --page-margin: 40px;
      padding-block: 48px 8px;
    }

    @media (max-width: 749px) {
      --page-margin: 20px;
      padding-block: 36px 8px;
    }
  }

  & .section-content-wrapper {
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 0;
    gap: 0;
    padding: 0;
    text-align: left;
  }

  & .text-block {
    width: 100%;
    max-width: none;
    padding: 0;
    text-align: left;
    justify-content: flex-start;
  }

  & .text-block h1 {
    margin: 0 0 10px;
    font-family: var(--font-body--family);
    font-size: 40px;
    font-weight: 600;
    line-height: normal;
    letter-spacing: -0.03em;
    text-align: left;
    color: #2b2b2b;
  }

  & .text-block p {
    max-width: 48ch;
    margin: 0 0 20px;
    font-family: var(--font-body--family);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0;
    text-align: left;
    color: #6b6862;
  }

  & a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-height: 0;
    margin: 0;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: #1f8a45;
    box-shadow: none;
    font-family: var(--font-body--family);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    color: #fff;
  }

  @media (max-width: 989px) {
    & .text-block h1 {
      font-size: 32px;
    }

    & .text-block p {
      font-size: 15px;
    }
  }

  @media (max-width: 749px) {
    & .text-block h1 {
      font-size: 28px;
    }

    & .text-block p {
      font-size: 14px;
    }
  }
}

/* ======== product page: You may also like (product_recommendations_YYWLzM) ======== */
[id$="__product_recommendations_YYWLzM"] {
  border-top: 1px solid #e4e2dc;

  & .section {
    --page-margin: 80px;
    padding-block: 24px 80px;
    row-gap: 28px;
    background: #fff;

    @media (max-width: 989px) {
      --page-margin: 40px;
      padding-block: 24px 56px;
      row-gap: 22px;
    }

    @media (max-width: 749px) {
      --page-margin: 20px;
      padding-block: 20px 48px;
      row-gap: 18px;
    }
  }

  & .section-resource-list__content .text-block h2 {
    font-size: 32px;

    @media (max-width: 989px) {
      font-size: 28px;
    }

    @media (max-width: 749px) {
      font-size: 24px;
    }
  }
}
