/* ==========================================================================
   robodatech.com / cnc-machines -- the storefront layer (SPEC-SHOP.md)

   Loaded AFTER cnc.css on every public page. cnc.css owns the tokens, the
   typography and the catalogue components; this sheet owns everything the shop
   adds: the header cart, the cart drawer, the parts catalogue, the profile
   sheet, checkout, the order pages.

   It defines no colour of its own. Every value here is a token from cnc.css,
   so the light default and the dark alternative both come out right without a
   second palette to keep in step.

   No external font, no external asset, no inline style: the CSP is
   `style-src 'self'` and there is no 'unsafe-inline'.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Header additions -- theme toggle and the cart button
   -------------------------------------------------------------------------- */
.site-nav .navspacer { flex: 1 1 auto; }

.themetoggle,
.cartbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: .88rem;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
}
.themetoggle:hover,
.cartbtn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-3); }

.themetoggle svg, .cartbtn svg { display: block; flex: none; }
.themetoggle svg path, .themetoggle svg circle, .themetoggle svg line,
.cartbtn svg path, .cartbtn svg circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.themetoggle .themetoggle__label { white-space: nowrap; }

.cartbtn { border-color: var(--accent-line); color: var(--accent); }
.cartbtn:hover { background: var(--accent-soft); color: var(--accent-hover); }

.cartbtn__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
}
.cartbtn__count[data-empty="1"] { background: var(--surface-3); color: var(--ink-3); }

/* --------------------------------------------------------------------------
   2. The cart drawer
   -------------------------------------------------------------------------- */
/* The page behind an open drawer must not scroll under it. A class, because
   `style-src 'self'` and because every visual state in this project is a class
   name the stylesheet already defines. */
.is-drawer-open, .is-drawer-open body { overflow: hidden; }

.drawer__backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 20, 25, .42);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 91;
  width: min(430px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-3);
}

.drawer__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px var(--gutter) 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-tint);
}
.drawer__head h2 { font-size: 1.05rem; }
.drawer__head .drawer__sub { color: var(--ink-3); font-size: .82rem; }
.drawer__close {
  margin-left: auto;
  flex: none;
  width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}
.drawer__close:hover { background: var(--surface-2); color: var(--ink); }

.drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px var(--gutter);
}

.drawer__foot {
  flex: none;
  border-top: 1px solid var(--line);
  background: var(--bg-tint);
  padding: 12px var(--gutter) 16px;
}
.drawer__foot .btn { width: 100%; }
.drawer__foot .btn + .btn { margin-top: 8px; }

.drawer__empty { color: var(--ink-3); padding: 26px 0; text-align: center; }
.drawer__empty b { display: block; color: var(--ink); margin-bottom: 4px; }

/* One cart line ---------------------------------------------------------- */
.lines { list-style: none; margin: 0; padding: 0; }
.lines > li + li { border-top: 1px solid var(--line); }

.line { display: grid; gap: 6px; padding: 12px 0; }
.line__top { display: flex; gap: 10px; align-items: flex-start; }
.line__title { font-weight: 600; margin: 0; }
.line__code {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-3);
  display: block;
}
.line__kind {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-3);
  vertical-align: 1px;
}
.line__drop {
  margin-left: auto;
  flex: none;
  border: 1px solid transparent;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius);
  font: inherit;
  font-size: .8rem;
}
.line__drop:hover { color: var(--danger); border-color: var(--line-2); background: var(--surface-2); }

.line__money {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1px 12px;
  font-size: .82rem;
  color: var(--ink-2);
}
.line__money .n {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.line__money .is-total { font-weight: 650; color: var(--price-ink); }
.line__money .is-total .n { font-weight: 650; }

.line__unpriced {
  font-size: .82rem;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  padding: 6px 8px;
}

/* Quantity stepper -------------------------------------------------------- */
.qty {
  display: inline-flex;
  align-items: stretch;
  /* `.field` is a grid, and a grid item is blockified and stretched -- which
     turned the stepper into a full-width bar with a stranded input. Pin it to
     its content and start it at the inline edge. */
  width: max-content;
  max-width: 100%;
  justify-self: start;
  align-self: start;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.qty button {
  width: 32px;
  border: 0;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.qty button:hover { background: var(--surface-3); }
.qty button[disabled] { color: var(--ink-3); cursor: not-allowed; }
.qty input {
  width: 54px;
  border: 0;
  border-inline: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
  text-align: center;
  padding: 6px 2px;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Totals block ------------------------------------------------------------ */
.totals { display: grid; gap: 2px; margin-top: 4px; }
.totals__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  font-size: .88rem;
  color: var(--ink-2);
}
.totals__row .n {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.totals__row--grand {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line-2);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--price-ink);
}
.totals__row--grand .n { font-size: 1.15rem; }
.totals__note { font-size: .78rem; color: var(--ink-3); margin-top: 6px; }

/* Shipping / freight callouts --------------------------------------------- */
.shipbox {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  padding: 10px 12px;
  margin: 12px 0;
  font-size: .85rem;
}
.shipbox h3 { font-size: .9rem; margin-bottom: 4px; }
.shipbox dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1px 12px;
  margin: 6px 0 0;
  font-size: .82rem;
}
.shipbox dt { color: var(--ink-3); margin: 0; }
.shipbox dd {
  margin: 0;
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.shipbox--freight { background: var(--warn-soft); border-color: var(--warn); }
.shipbox--freight h3 { color: var(--warn); }
.shipbox--quote { background: var(--info-soft); border-color: var(--accent-line); }
.shipbox--ok { background: var(--good-soft); border-color: var(--good); }
.shipbox ul { margin: 6px 0 0; padding-left: 1.1em; }
.shipbox li { font-size: .82rem; }

/* --------------------------------------------------------------------------
   3. Buttons the storefront adds
   -------------------------------------------------------------------------- */
.btn--buy {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}
.btn--buy:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn--ghost { background: transparent; }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }

.addrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.addrow .btn { flex: 1 1 auto; }

/* The live region that announces every cart change. Visible, small, and it
   holds its space so an announcement does not shift the page. */
.cartsay {
  min-height: 1.25em;
  font-size: .82rem;
  color: var(--good);
  margin-top: 6px;
}
.cartsay:empty { min-height: 0; }
.cartsay[data-tone="warn"] { color: var(--warn); }
.cartsay[data-tone="err"] { color: var(--danger); }

/* --------------------------------------------------------------------------
   4. Storefront hero
   -------------------------------------------------------------------------- */
.storehero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-tint) 100%);
  border-bottom: 1px solid var(--line);
}
.storehero__in { padding: 26px 0 22px; }
.storehero h1 { margin-bottom: 8px; }
.storehero__lede { max-width: 62ch; color: var(--ink-2); }

.storetabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.storetabs a {
  padding: 7px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 550;
}
.storetabs a:hover { border-color: var(--accent); color: var(--accent); }
.storetabs a[aria-current="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   5. Parts catalogue
   -------------------------------------------------------------------------- */
.partgrid {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
}

.partcard {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.partcard__top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.partcard__code {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: .02em;
}
.partcard__hero { border-bottom: 1px solid var(--line); background: var(--surface); }
.partcard__hero .shot { margin: 0; }
.partcard__hero .shot__frame { aspect-ratio: 4 / 3; border: 0; border-radius: 0; }
.partcard__hero .shot__cap { padding: 8px 12px; }
.partcard__body { padding: 12px; display: grid; gap: 8px; }
.partcard__title { font-size: 1rem; margin: 0; }
.partcard__title a { text-decoration: none; }
.partcard__title a:hover { text-decoration: underline; }
.partcard__sub { color: var(--ink-3); font-size: .84rem; margin: 0; }
.partcard__foot {
  margin-top: auto;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-tint);
}

.specrow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
  font-size: .82rem;
}
.specrow dt { color: var(--ink-3); margin: 0; }
.specrow dd {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: .74rem;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill--series { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.pill--quote { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.pill--stock { border-color: var(--good); background: var(--good-soft); color: var(--good); }

.pricetag { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pricetag__main {
  font-family: var(--font-mono);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--price-ink);
  font-variant-numeric: tabular-nums;
}
.pricetag__sub { font-size: .8rem; color: var(--price-sub); }
.pricetag__rate { font-size: .8rem; color: var(--ink-3); font-family: var(--font-mono); }

/* Connector table --------------------------------------------------------- */
.contable { width: 100%; }
.contable .conname { min-width: 190px; }
.contable .conname b { display: block; }
.contable .conkey {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--ink-3);
}
.contable .confits span {
  display: inline-block;
  margin: 2px 4px 0 0;
  padding: 0 7px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-family: var(--font-mono);
}
.contable td.n {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.joint {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.joint:first-of-type { border-top: 0; }
.joint__body h3 { margin-bottom: 4px; }
.joint__steps { counter-reset: step; list-style: none; padding: 0; margin: 8px 0 0; }
.joint__steps li {
  counter-increment: step;
  position: relative;
  padding-left: 28px;
  margin: 5px 0;
  font-size: .88rem;
}
.joint__steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   6. Profile sheet -- section, strength, load chart, cut length
   -------------------------------------------------------------------------- */
.profhead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 24px;
  align-items: start;
  padding: 20px 0 8px;
}

.cutbox {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  padding: 14px;
  position: sticky;
  top: 14px;
  display: grid;
  gap: 10px;
}

.lenpick { display: grid; gap: 8px; }
.lenpick__opts { display: flex; flex-wrap: wrap; gap: 6px; }
.lenopt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font-size: .86rem;
  font-family: var(--font-mono);
}
.lenopt input { position: absolute; opacity: 0; pointer-events: none; }
.lenopt:hover { border-color: var(--accent); }
.lenopt:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.lenopt[data-on="1"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.lenopt[data-quote="1"] { border-style: dashed; }

.cutcalc {
  border-top: 1px dashed var(--line-2);
  padding-top: 10px;
  display: grid;
  gap: 6px;
}
.cutcalc__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cutcalc input[type="number"] {
  width: 108px;
  padding: 7px 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: .92rem;
}
.cutcalc__out { font-size: .84rem; color: var(--ink-2); }
.cutcalc__out b { font-family: var(--font-mono); color: var(--price-ink); }
.tolerance {
  font-size: .78rem;
  color: var(--ink-3);
  border-left: 2px solid var(--line-2);
  padding-left: 8px;
}

.honest {
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin: 16px 0;
}
.honest h3 { font-size: .95rem; margin-bottom: 5px; color: var(--accent); }
.honest p { font-size: .88rem; margin-bottom: .5em; }
.honest p:last-child { margin-bottom: 0; }
.honest code { background: var(--surface); padding: 0 4px; border-radius: 2px; }

.loadchart { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.loadchart .shot__frame { border: 0; border-radius: var(--radius-lg); }

.casetabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.casetab {
  padding: 6px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: .84rem;
  cursor: pointer;
}
.casetab[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

table.loads td.n, table.loads th.n {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
table.loads tr[data-binding="strength"] td.bind { color: var(--warn); font-weight: 600; }

/* --------------------------------------------------------------------------
   7. Checkout
   -------------------------------------------------------------------------- */
.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: 26px;
  align-items: start;
  padding: 18px 0 40px;
}

.summary {
  position: sticky;
  top: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.summary__head {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-tint);
}
.summary__head h2 { font-size: 1rem; }
.summary__body { padding: 12px 14px; }
.summary__foot { padding: 12px 14px 16px; border-top: 1px solid var(--line); background: var(--bg-tint); }
.summary__foot .btn { width: 100%; }
.summary__foot .btn + .btn { margin-top: 8px; }

.summary .lines .line { padding: 9px 0; }
.summary .lines .line__money { font-size: .8rem; }

.fieldset-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 16px;
  margin: 0 0 16px;
}
.fieldset-card > legend {
  padding: 0 8px;
  margin-left: -8px;
  font-weight: 700;
  font-size: .95rem;
}
.fieldset-card .hintline { color: var(--ink-3); font-size: .84rem; margin: -2px 0 12px; }

.formgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.field select,
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="search"],
.field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.paybadge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--ink-3);
  margin-top: 10px;
}
.paybadge svg path { fill: none; stroke: currentColor; stroke-width: 1.7; }
.paybadge b { color: var(--ink-2); }

.testmode {
  border: 1px dashed var(--warn);
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: .82rem;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   8. Order confirmation and status
   -------------------------------------------------------------------------- */
.orderhero {
  border: 1px solid var(--good);
  background: var(--good-soft);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 18px 0;
}
.orderhero--wait { border-color: var(--accent-line); background: var(--accent-soft); }
.orderhero--warn { border-color: var(--warn); background: var(--warn-soft); }
.orderhero h1 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem); margin-bottom: 6px; }
.orderhero__ref {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .04em;
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 6px 0;
}

.track { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 0; }
.track li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  color: var(--ink-3);
  font-size: .9rem;
}
.track li::before {
  content: "";
  width: 13px;
  height: 13px;
  margin: 4px 0 0 6px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--line-2);
  background: var(--surface);
}
.track li[data-done="1"] { color: var(--ink); }
.track li[data-done="1"]::before { border-color: var(--good); background: var(--good); }
.track li[data-now="1"] { color: var(--ink); font-weight: 650; }
.track li[data-now="1"]::before { border-color: var(--accent); background: var(--accent); }

.lookup {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 16px;
  max-width: 520px;
}
.lookup .field { margin-bottom: 10px; }

/* --------------------------------------------------------------------------
   9. Responsive -- 360 px upwards
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .checkout { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .profhead { grid-template-columns: minmax(0, 1fr); }
  .cutbox { position: static; }
  .joint { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .formgrid--3 { grid-template-columns: minmax(0, 1fr); }
  .drawer { width: 100vw; border-left: 0; }
  .partgrid { grid-template-columns: minmax(0, 1fr); }
  .themetoggle .themetoggle__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

@media (max-width: 380px) {
  .specrow { grid-template-columns: minmax(0, 1fr); }
  .qty input { width: 44px; }
  .drawer__head { padding-inline: 14px; }
  .drawer__body { padding-inline: 14px; }
  .drawer__foot { padding-inline: 14px; }
}

/* --------------------------------------------------------------------------
   10. Motion -- the drawer slides only if the reader wants motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .drawer { animation: drawer-in .18s ease-out; }
  .drawer__backdrop { animation: fade-in .18s ease-out; }
  .lenopt, .casetab, .themetoggle, .cartbtn, .partcard {
    transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
  }
  .partcard:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); }
}

@keyframes drawer-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------------------------------------------------
   11. Print
   -------------------------------------------------------------------------- */
@media print {
  .drawer, .drawer__backdrop, .cartbtn, .themetoggle, .addrow,
  .cutbox, .summary__foot, .lookup { display: none !important; }
  .checkout { grid-template-columns: minmax(0, 1fr); }
  .partcard, .joint, .orderhero { break-inside: avoid; box-shadow: none; }
}
