/* The compact product row (templates/_row_card.html) and the list it sits in.

   Owner, 2026-09-28: "one big card per item on the screen" made a phone
   scroll a product at a time. On a phone each product is a compact row -- a
   small photo and one button on the left, the rows on the right -- three or
   four to a screen; wider screens lay the same card out two or three across.
   Every tap target is at least 44px. Nothing here is about one kind of
   product: a shelf fills the card (a lift kit: api/lift_cards.row_card). */

.row-list { display: grid; grid-template-columns: 1fr; gap: 0 22px; margin-top: 8px; }
@media (min-width: 768px) { .row-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .row-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.row-list-head {
  grid-column: 1 / -1; margin: 18px 0 2px; font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 500; color: var(--text-0); letter-spacing: .01em;
}

.row-card { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.row-card-side { width: 34%; max-width: 150px; flex: none; display: flex; flex-direction: column; gap: 8px; }
.row-card-photo {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3;
  background: #f4f5f7; border-radius: var(--radius); overflow: hidden;
}
.row-card-photo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.row-card-photo .hint { color: #5b626c; font-size: .75rem; text-align: center; padding: 6px; }
.row-card-btn { min-height: 44px; width: 100%; justify-content: center; }

.row-card-body { flex: 1; min-width: 0; font-size: .8125rem; line-height: 1.35; color: var(--text-1); }
.row-card-body p { margin: 0; }
.row-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-card-top .brand-mark { height: 14px; }
.row-card-brand { font-weight: 700; color: var(--text-0); }
.row-card-tag { font-size: .6875rem; color: var(--text-2); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card-name { margin: 2px 0 1px; font-family: var(--font-display); font-weight: 500; font-size: 1.0625rem; line-height: 1.2; }
.row-card-name a { color: var(--text-0); text-decoration: none; }
.row-card-name a:hover { color: var(--volt); }
.row-card-sub { color: var(--text-2); font-size: .75rem; }
.row-card-line { color: var(--text-0); font-weight: 700; }
.row-card-note.is-yes { color: #7ad492; }
.row-card-note.is-check { color: var(--gold-300); }
.row-card-note.is-no { color: var(--danger); }
.row-card-facts { margin: 3px 0 0; }
.row-card-facts > div { display: flex; gap: 8px; }
.row-card-facts dt { width: 48px; flex: none; color: var(--text-2); }
.row-card-facts dd { margin: 0; color: var(--text-0); min-width: 0; }
.row-card-facts i { color: var(--text-2); }
.row-card-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px !important; }
.row-card-price b { font-size: 1rem; color: var(--text-0); }
.row-card-price small { color: var(--text-2); }
.row-card-stock { font-size: .75rem; color: var(--text-2); }
.row-card-stock.is-in { color: #7ad492; }
.row-card.is-dim .row-card-line { color: var(--text-2); font-weight: 400; }

/* Two or three across, the parts of cards side by side line up (the store's
   rule, theme.css `.grid-cards > .card`; tests/layout "cards in a row line
   up"): each card spans seven of the list's rows and re-uses them
   (`subgrid`), and each part names its row. A card with nothing for a row
   leaves it empty rather than pulling everything below it up.
     1 brand line   2 name   3 version   4 line   5 note   6 facts   7 price */
@media (min-width: 768px) {
  .row-list { row-gap: 0; }
  .row-card {
    display: grid; grid-row: span 7; grid-template-rows: subgrid; row-gap: 0;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); column-gap: 12px;
  }
  .row-card-side { grid-column: 1; grid-row: 1 / -1; width: auto; max-width: none; }
  .row-card-body { grid-column: 2; grid-row: 1 / -1; display: grid; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
  .row-card-top { grid-row: 1; }
  .row-card-name { grid-row: 2; }
  .row-card-sub { grid-row: 3; }
  .row-card-line { grid-row: 4; }
  .row-card-note { grid-row: 5; }
  .row-card-facts { grid-row: 6; }
  .row-card-price { grid-row: 7; align-self: start; }
}
