/* Hollrock Parts Table — mobile-first, cards -> table at 880px. Scoped to .hpt. */
.hpt{
  --hpt-accent:#3E7D34;
  --hpt-accent-bright:#5FA34E;
  --hpt-ink:#232823;
  --hpt-soft:#5a635a;
  --hpt-steel:#7C857A;
  --hpt-line:#e2e7dc;
  --hpt-surface:#ffffff;
  --hpt-surface-2:#f7f9f5;
  --hpt-amber:#a8681a;
  --hpt-mono:ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  color:var(--hpt-ink);
  font-size:16px;
  line-height:1.45;
  margin:0 0 1.5rem;
}
.hpt *{box-sizing:border-box}

/* toolbar */
.hpt-toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.hpt-search{flex:1;min-width:200px;display:flex;align-items:center;gap:9px;background:var(--hpt-surface);
  border:1px solid var(--hpt-line);border-radius:10px;padding:9px 13px}
.hpt-search svg{width:16px;height:16px;stroke:var(--hpt-steel);fill:none;stroke-width:1.7;flex:none}
.hpt-search input{border:0;outline:0;background:transparent;color:var(--hpt-ink);font:inherit;width:100%}
.hpt-search input::placeholder{color:var(--hpt-steel)}
.hpt-count{font-family:var(--hpt-mono);font-size:.78rem;color:var(--hpt-steel);white-space:nowrap}

.hpt-vh{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hpt-notice{padding:12px 14px;background:#fff6e9;border:1px solid #e6d3a8;border-radius:8px;color:#7a5a12}
.hpt-caption{text-align:left;font-family:var(--hpt-mono);text-transform:uppercase;letter-spacing:.09em;
  font-size:.66rem;color:var(--hpt-steel);padding:0 0 10px}

/* shared cell atoms */
.hpt-img{width:100%;height:100%;object-fit:cover;display:block;border-radius:8px}
.hpt-td-img{overflow:hidden}
.hpt-name{font-weight:640;line-height:1.25;display:block}
.hpt-desc{color:var(--hpt-soft);font-size:.86rem;line-height:1.35;display:block;margin-top:2px}
.hpt-sku{font-family:var(--hpt-mono);font-size:.78rem;color:var(--hpt-soft);background:var(--hpt-surface-2);
  border:1px solid var(--hpt-line);border-radius:6px;padding:2px 7px;white-space:nowrap;display:inline-block}
.hpt-price{font-family:var(--hpt-mono);font-variant-numeric:tabular-nums;font-weight:600;color:var(--hpt-ink);white-space:nowrap}
.hpt-price del{color:var(--hpt-steel);font-weight:400;margin-right:.4em}
.hpt-stock{display:inline-flex;align-items:center;gap:6px;font-size:.8rem;color:var(--hpt-soft)}
.hpt-stock::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--hpt-accent-bright);flex:none}
.hpt-stock.out{color:var(--hpt-amber)}
.hpt-stock.out::before{background:var(--hpt-amber)}

/* stepper */
.hpt-stepper{display:inline-flex;align-items:center;border:1px solid var(--hpt-line);border-radius:8px;
  background:var(--hpt-surface);overflow:hidden}
.hpt-step{width:34px;height:36px;border:0;background:transparent;color:var(--hpt-ink);font-size:1.15rem;
  cursor:pointer;line-height:1;display:flex;align-items:center;justify-content:center}
.hpt-step:hover{background:var(--hpt-surface-2);color:var(--hpt-accent)}
.hpt-qty{width:38px;height:36px;border:0;border-left:1px solid var(--hpt-line);border-right:1px solid var(--hpt-line);
  text-align:center;font-family:var(--hpt-mono);font-size:.9rem;background:transparent;color:var(--hpt-ink);-moz-appearance:textfield}
.hpt-qty::-webkit-outer-spin-button,.hpt-qty::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}

/* add button */
.hpt-add-form{margin:0}
.hpt-add{display:inline-flex;align-items:center;justify-content:center;gap:7px;background:var(--hpt-accent);
  color:#fff;border:0;border-radius:8px;padding:0 16px;height:38px;font:inherit;font-size:.9rem;font-weight:600;
  cursor:pointer;white-space:nowrap;transition:background .15s,transform .06s;width:100%}
.hpt-add:hover{background:var(--hpt-accent-bright)}
.hpt-add:active{transform:translateY(1px)}
.hpt-add[disabled]{background:var(--hpt-surface-2);color:var(--hpt-steel);cursor:not-allowed;box-shadow:inset 0 0 0 1px var(--hpt-line)}
.hpt-add svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.9}
.hpt-add.is-added{background:#eaf3e6;color:var(--hpt-accent);box-shadow:inset 0 0 0 1px var(--hpt-accent)}

.hpt-empty{padding:26px 10px;text-align:center;color:var(--hpt-steel)}

/* ---------- MOBILE (default): each row is a card ---------- */
.hpt-tablewrap{overflow:visible}
.hpt-table{width:100%;border-collapse:collapse}
.hpt-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hpt-table tbody{display:block}
.hpt-row{
  display:grid;
  grid-template-columns:60px auto auto 1fr;
  grid-template-areas:
    "img  name   name   name"
    "img  sku    stock  price"
    "qty  qty    add    add";
  gap:6px 10px;
  align-items:center;
  background:var(--hpt-surface);
  border:1px solid var(--hpt-line);
  border-radius:12px;
  padding:12px;
  margin-bottom:10px;
}
.hpt-row>td{padding:0;border:0}
.hpt-row>td:nth-child(1){grid-area:img;width:60px;height:60px;align-self:start}
.hpt-row>td:nth-child(2){grid-area:name;align-self:end}
.hpt-row>td:nth-child(3){grid-area:sku;justify-self:start;align-self:center}
.hpt-row>td:nth-child(4){grid-area:stock;justify-self:start;align-self:center;white-space:nowrap}
.hpt-row>td:nth-child(5){grid-area:price;justify-self:end;align-self:center;font-size:1.05rem}
.hpt-row>td:nth-child(6){grid-area:qty;justify-self:start;padding-top:6px}
.hpt-row>td:nth-child(7){grid-area:add;justify-self:stretch;align-self:center;padding-top:6px}

/* filtered-out rows: must beat the .hpt-row display:grid/table-row rules */
.hpt-row[hidden]{display:none!important}

/* cross-highlight from the parts diagram (and :target from no-JS callout anchors) */
.hpt-row.is-hl,.hpt-row:target{background:#eaf3e6!important;box-shadow:inset 3px 0 0 var(--hpt-accent)}
.hpt-row:target{scroll-margin-top:90px}

/* ---------- discontinued subsection ---------- */
.hpt-stock.disc{color:var(--hpt-steel)}
.hpt-stock.disc::before{background:var(--hpt-steel)}
.hpt-disc{margin-top:26px}
.hpt-disc[hidden]{display:none!important}
.hpt-disc-title{font-size:1.15rem;line-height:1.3;margin:0 0 4px;color:var(--hpt-ink)}
.hpt-disc-note{color:var(--hpt-soft);font-size:.9rem;margin:0 0 12px}
.hpt-row--disc .hpt-name{color:var(--hpt-soft);font-weight:500}
.hpt-img--none{display:block;border-radius:8px;background:var(--hpt-surface-2);border:1px dashed var(--hpt-line);width:100%;height:100%}
.hpt-row--disc{ /* 4-cell card: no qty/add row, so no phantom grid track */
  grid-template-areas:
    "img name name name"
    "img sku  stock stock";
}

/* ---------- DESKTOP: real table at >=880px ---------- */
@media (min-width:880px){
  .hpt-tablewrap{overflow-x:auto;border:1px solid var(--hpt-line);border-radius:14px;background:var(--hpt-surface)}
  .hpt-table{display:table;min-width:680px}
  .hpt-table thead{display:table-header-group;position:static;width:auto;height:auto;clip:auto}
  .hpt-table tbody{display:table-row-group}
  .hpt-caption{caption-side:top;display:table-caption;padding:14px 16px 0}
  .hpt-table thead th{position:sticky;top:0;background:var(--hpt-surface);z-index:1;text-align:left;
    font-family:var(--hpt-mono);text-transform:uppercase;letter-spacing:.08em;font-size:.64rem;color:var(--hpt-steel);
    font-weight:600;padding:13px 16px;border-bottom:1px solid var(--hpt-line);white-space:nowrap}
  .hpt-table th.hpt-num,.hpt-table td.hpt-num{text-align:right}
  .hpt-row{display:table-row;background:transparent;border:0;border-radius:0;padding:0;margin:0}
  .hpt-row:hover{background:var(--hpt-surface-2)}
  .hpt-row>td{display:table-cell;vertical-align:middle;padding:11px 16px;border-bottom:1px solid var(--hpt-line);
    width:auto;height:auto;grid-area:auto!important;justify-self:auto;align-self:auto;font-size:1rem}
  .hpt-table tbody tr:last-child>td{border-bottom:0}
  .hpt-th-img,.hpt-td-img{width:56px}
  .hpt-td-img{height:auto}
  .hpt-row>td:nth-child(1){width:56px;height:auto}
  .hpt-img{width:48px;height:48px}
  .hpt-add{width:auto}
  .hpt-stepper{margin-left:auto}
}

@media (prefers-reduced-motion:reduce){.hpt *{transition:none!important}}
