/* The list view on this store (body[data-parts-view="rows"]): each part is its own white card on the cool page. The
   picture on a tinted well at the left, the name as a headline with the brand, the part number and the part's first
   three features under it, and a buy column parted by a hairline at the right: the price in the product page's hand, what
   it saves, the stock line, the stepper and Add. Under the pointer the card lifts. Loaded after parts.css in the same
   layer; it reads the store's own tokens (site.css), since this copy of the kit is the store's. The grid view is
   parts.css's, untouched. */
@layer kit {
:root body[data-parts-view="rows"] {
  --parts-list-pic: 126px;
  --parts-list-buy: 284px;
  --parts-list-line: var(--parts-dove, var(--dove));

  /* the hover peek is for a 44px thumbnail: here the picture is already big, and a click still opens the lightbox */
  & .parts-peek { display: none !important; }

  & .parts-ledger { display: grid; gap: 10px; border: 0; border-radius: 0; background: none; }
  & .parts-ledger__head { display: none; }

  /* ---------- the card ---------- */
  & .parts-row {
    display: grid; grid-template-columns: var(--parts-list-pic) minmax(0, 1fr) var(--parts-list-buy); column-gap: 20px; align-items: stretch;
    min-height: 0; padding: 14px; border: 1px solid var(--parts-list-line); border-radius: 8px; background: var(--parts-bg, var(--white));
    box-shadow: 0 1px 2px rgb(13 21 36 / .04);
    transition: border-color .15s ease-out, box-shadow .15s ease-out, transform .15s ease-out;
  }
  & .parts-row:last-child { border-bottom: 1px solid var(--parts-list-line); border-radius: 8px; }
  & .parts-row:hover { background: var(--parts-bg, var(--white)); }
  @media (hover: hover) {
    & .parts-row:hover { border-color: #b9c2d0; box-shadow: 0 1px 2px rgb(13 21 36 / .05), 0 10px 24px -8px rgb(13 21 36 / .16); }
  }
  & .parts-row.is-added { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--parts-bg, var(--white)); }
  & .parts-row > .parts-row__view { display: none; }

  /* ---------- the picture: a square well in the page's tint, the photo's white melted into it ---------- */
  & .parts-row__img {
    width: var(--parts-list-pic); height: auto; min-height: var(--parts-list-pic); align-self: stretch; padding: 8px;
    border: 0; border-radius: 6px; background: var(--page);
  }
  & .parts-row__img img { width: 100%; height: calc(var(--parts-list-pic) - 16px); object-fit: contain; mix-blend-mode: multiply; }
  /* under the pointer the card itself lifts; the picture stays still */
  @media (hover: hover) and (prefers-reduced-motion: no-preference) {
    & .parts-row:hover { transform: translateY(-3px); }
  }
  & .parts-row__img--none img { opacity: .55; }

  /* ---------- the words ---------- */
  /* one column: the name, the brand and number, then the verdict and the features (the description's box dissolves into it) */
  & .parts-row__words { display: flex; flex-direction: column; align-items: flex-start; gap: 0; align-self: start; min-width: 0; padding-top: 2px; }
  & .parts-row__desc { display: contents; }
  & .parts-row__desc > * { order: 3; }
  & .parts-row__desc > .parts-row__title { order: 1; }
  & .parts-row__words > .parts-row__num { order: 2; }
  & .parts-row__part { display: inline; }
  & .parts-row__hash, & .parts-row__save { display: inline; }
  & .parts-row__title {
    font: 600 17px/23px var(--sans); letter-spacing: -.01em; color: var(--ink);
    -webkit-line-clamp: 2; text-wrap: pretty;
  }
  & .parts-row__title:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
  /* the brand, then the part number, one quiet line */
  & .parts-row__num {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin-top: 6px;
    font: 400 14px/20px var(--sans); color: var(--ink);
  }
  & .parts-row__num > span:not(.parts-row__part) { order: 1; font-size: 14px; font-weight: 600; color: var(--ink); overflow: visible; }
  & .parts-row__part { order: 2; white-space: nowrap; font-size: 14px; color: var(--ink); }
  & .parts-row__part::before { content: ""; display: inline-block; width: 1px; height: 12px; margin: 0 10px 0 4px; background: #b9c2d0; vertical-align: -1px; }
  & .parts-row__part > :is(a, b) {
    font: 500 14px/20px var(--sans); font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--ink);
    word-break: normal; min-height: 0; min-width: 0; display: inline; text-decoration: none;
  }
  & .parts-row__part > a:hover { text-decoration: underline; }
  & .parts-row__meta, & .parts-row__desc > .parts-fit, & .parts-row__alert { margin-top: 10px; font-size: 13.5px; line-height: 18px; }
  & .parts-row__meta { color: var(--ink); }
  & .parts-row__desc > .parts-fit { align-items: flex-start; }
  & .parts-row__desc > .parts-fit svg { margin-top: 2.5px; }
  & .parts-row__alert { margin-top: 4px; }

  /* ---------- the buy column ---------- */
  & .parts-row__side > .parts-row__price { order: 1; }
  & .parts-row__side > .parts-row__stock { order: 2; }
  & .parts-row__side > :is(.parts-row__buy, .parts-row__nudge, .kit-cart-error) { order: 3; }
  & .parts-row__nudge:empty { display: none; }
  & .parts-row__side {
    display: flex; flex-direction: column; align-items: stretch; min-width: 0;
    padding: 0 0 0 20px; border-left: 1px solid var(--parts-list-line);
  }
  & .parts-price { display: block; text-align: left; }
  & .parts-price b {
    display: block; font: 700 25px/28px var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.025em; color: var(--ink);
  }
  & .parts-price--cut b { color: #d1221a; }
  & .parts-price small { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--ink); }
  & .parts-price small .parts-mono { font: 400 13px/18px var(--sans); font-variant-numeric: tabular-nums; letter-spacing: 0; }
  & .parts-row__save { font-weight: 700; color: #d1221a; }
  & .parts-price--none small { font-size: 14px; line-height: 20px; font-weight: 600; }

  & .parts-row__stock { margin-top: 8px; }
  & .parts-stock { font-size: 13.5px; line-height: 18px; }
  & .parts-stock b { align-items: flex-start; gap: 7px; font-weight: 600; }
  & .parts-stock:not(.parts-stock--x) b::before { width: 8px; height: 8px; margin-top: 5px; }
  & .parts-stock--x b::before { width: 14px; height: 14px; margin-top: 2px; }
  & .parts-stock--x b { gap: 6px; }
  & .parts-stock:not(.parts-stock--out) b > span { color: var(--accent-deep); }
  & .parts-stock .parts-stock__ships { display: inline-block; color: var(--ink); font-weight: 400; }
  & .parts-tip { align-self: center; }

  & .parts-row__buy { display: flex; gap: 8px; align-items: stretch; margin-top: auto; padding-top: 12px; }
  & .parts-row__qty { flex: none; }
  & .parts-row__add { flex: 1; min-width: 0; }
  & .parts-stepper--row { height: 40px; border-radius: var(--r); }
  & .parts-stepper--row button { width: 32px; height: 100%; font-size: 17px; font-weight: 500; }
  & .parts-row .parts-stepper--row .parts-qty { width: 40px; height: 100%; font: 600 15px/20px var(--sans); font-variant-numeric: tabular-nums; }
  & .parts-row__buy .parts-btn {
    height: 40px; padding: 0 10px; border-radius: var(--r); font: 700 14.5px/1 var(--sans); letter-spacing: 0;
    background: var(--parts-cta) border-box; color: var(--parts-cta-ink);
  }
  & .parts-row__buy .parts-btn:is(:hover, :active) { background: var(--parts-cta-hover) border-box; }
  & .parts-row__buy .parts-btn[disabled] { background: var(--parts-cta) border-box; color: var(--parts-cta-ink); }

  & .parts-row__nudge { margin-top: auto; padding-top: 14px; justify-self: auto; text-align: left; font-size: 13.5px; line-height: 19px; color: var(--ink); }
  & .parts-row .kit-cart-error { grid-column: 1 / -1; justify-self: end; margin: 10px 0 0; }
  & .parts-row__side .kit-cart-error { margin: 8px 0 0; }
}

/* ---------- the list beside the rail at its narrowest, and a tablet ---------- */
@media (max-width: 1180px) {
  :root body[data-parts-view="rows"] { --parts-list-pic: 116px; --parts-list-buy: 272px; }
  :root body[data-parts-view="rows"] .parts-row { column-gap: 16px; }
  :root body[data-parts-view="rows"] .parts-row__side { padding-left: 16px; }
  :root body[data-parts-view="rows"] .parts-row__title { font-size: 16px; line-height: 22px; }
}

/* ---------- a phone: the picture beside the words, then the buy column as the card's foot ---------- */
@media (max-width: 760px) {
  :root body[data-parts-view="rows"] {
    --parts-list-pic: 96px;
    & .parts-ledger { gap: 8px; }
    & .parts-row {
      grid-template-columns: var(--parts-list-pic) minmax(0, 1fr); grid-template-areas: none; column-gap: 12px; row-gap: 12px; padding: 12px;
    }
    & .parts-row__img { grid-area: auto; padding: 6px; align-self: start; height: var(--parts-list-pic); min-height: 0; }
    & .parts-row__img img { height: 100%; }
    & .parts-row__words { padding-top: 0; }
    & .parts-row__title { font-size: 16px; line-height: 21px; -webkit-line-clamp: 3; min-height: 0; padding-top: 0; }
    & .parts-row__num { grid-area: auto; margin-top: 4px; }
    & .parts-row__num { flex-direction: column; gap: 0; }
    & .parts-row__part::before { content: none; }
    & .parts-row__part > :is(a, b) { display: inline; min-height: 0; }
    & .parts-row__meta, & .parts-row__desc > .parts-fit { margin-top: 6px; }
    & .parts-row__side {
      grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: end;
      padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--parts-list-line);
    }
    & .parts-row__price { grid-area: auto; grid-column: 1; grid-row: 1; justify-self: start; }
    & .parts-price b { font-size: 24px; }
    & .parts-row__stock { grid-area: auto; grid-column: 2; grid-row: 1; margin: 0 0 1px; justify-self: end; }
    & .parts-price small { flex-wrap: nowrap; white-space: nowrap; }
    & .parts-row__buy { grid-column: 1 / -1; grid-row: 2; padding-top: 12px; }
    & .parts-row__qty, & .parts-row__add { grid-area: auto; }
    & .parts-stepper--row { height: 44px; }
    & .parts-stepper--row button { width: 42px; }
    & .parts-row .parts-stepper--row .parts-qty { width: 46px; font-size: 16px; }
    & .parts-row__buy .parts-btn { height: 44px; font-size: 16px; }
    & .parts-row__nudge { grid-area: auto; grid-column: 1 / -1; grid-row: 2; padding-top: 10px; }
  }
}

/* the night theme keeps the photo's own white plate */
:root[data-parts-theme="dark"] body[data-parts-view="rows"] .parts-row__img { background: var(--plate); }
:root[data-parts-theme="dark"] body[data-parts-view="rows"] .parts-row__img img { mix-blend-mode: normal; opacity: 1; }

/* the part's first three features, as short bullets under the brand and number */
:root body[data-parts-view="rows"] .parts-row__features {
  display: grid; gap: 3px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13.5px; line-height: 19px; color: var(--steel);
}
:root body[data-parts-view="rows"] .parts-row__features li { position: relative; padding-left: 14px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
:root body[data-parts-view="rows"] .parts-row__features li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--orange); }
@media (max-width: 760px) {
  :root body[data-parts-view="rows"] .parts-row__features { margin-top: 6px; font-size: 13px; line-height: 18px; }
  :root body[data-parts-view="rows"] .parts-row__features li::before { top: 7px; }
}
}
