/* ══════════════════════════════════════════════════════════════
   FiberOpticsTools — WooCommerce CART PAGE styles
   Ported from docs/drafts/cart-concept.html. Contains ONLY the
   cart-page-specific composition. Tokens, base/reset, header,
   footer, shared components (.card/.chip/.add/.tolist) and the
   docked contextual right-rail (.cart-scrim/.cartdrawer/.cd-*)
   live in frame.css — do not duplicate them here.
   Loaded only on the WooCommerce cart page. Single light theme.
   ══════════════════════════════════════════════════════════════ */

.cart-head { padding: 34px 0 8px; }
.cart-head .eyebrow { color: var(--accent); }
.cart-head h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 820; margin-top: 6px; }
.cart-head .meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  margin-top: 8px; font-variant-numeric: tabular-nums; }

/* small caption noting this deep page vs the quick docked rail */
.deep-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; max-width: 66ch;
  font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.deep-note svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.deep-note b { color: var(--ink-dim); font-weight: 650; }

.cart-layout { display: grid; grid-template-columns: 1.65fr 1fr; gap: 28px;
  align-items: start; padding: 12px 0 64px; }

/* left column — items + tools */
.cart-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.items { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.items-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line); }
.items-head .t { font-weight: 700; font-size: 14px; }
.items-head .clear { font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  background: none; border: 0; cursor: pointer; letter-spacing: 0.03em; }
.items-head .clear:hover { color: var(--accent); }

.citem { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px;
  padding: 16px 18px; border-top: 1px solid var(--line); align-items: start; }
.citem:first-of-type { border-top: 0; }
.cthumb { width: 56px; height: 56px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; overflow: hidden;
  display: grid; place-items: center; color: var(--accent); flex-shrink: 0; }
.cthumb svg { opacity: 0.9; }
.cthumb img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.cbody { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cbody .nm { font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.cbody .nm a:hover { color: var(--accent); }
.cbody .sku { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; }
.cbody .spec { font-family: var(--mono); font-size: 11px; color: var(--ink-dim);
  display: flex; gap: 7px; flex-wrap: wrap; }
.cbody .stock { margin-top: 1px; }

/* qty stepper */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong);
  border-radius: 8px; overflow: hidden; height: 34px; }
.qty button { width: 32px; height: 100%; border: 0; background: transparent; color: var(--ink-dim);
  font-family: var(--mono); font-size: 16px; cursor: pointer; display: grid; place-items: center; }
.qty button:hover { background: var(--surface-2); color: var(--accent); }
.qty input { width: 40px; height: 100%; border: 0; border-left: 1px solid var(--line);
  border-right: 1px solid var(--line); background: var(--ground); color: var(--ink);
  text-align: center; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

/* right side of each item: prices + remove */
.cprices { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.cprices .line { font-family: var(--mono); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.cprices .unit { font-family: var(--mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cprices .ctrls { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
/* move-to-list: one click removes the line (to the most-recent list) and updates totals; dropdown re-targets; Undo reverts */
.lineacts { display: flex; align-items: center; gap: 12px; }
.movelist { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); background: none;
  border: 1px solid var(--line-strong); border-radius: 7px; padding: 5px 9px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; }
.movelist:hover { border-color: var(--accent); color: var(--accent); }
.movelist svg { width: 12px; height: 12px; }
.citem.moved { display: none; }
.moved-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 13px 0;
  border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--ink-dim); }
.moved-bar .ok { color: var(--good); font-weight: 700; }
.moved-bar select { font-family: var(--sans); font-size: 12px; border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 3px 6px; background: var(--surface); color: var(--ink); }
.moved-bar .undo { color: var(--accent); cursor: pointer; text-decoration: underline; margin-left: auto; }
.remove { font-family: var(--mono); font-size: 11px; color: var(--muted); background: none; border: 0;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px; letter-spacing: 0.03em; padding: 4px; }
.remove:hover { color: var(--signal); }

/* signature tools row: quick add by SKU + save as list */
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tool { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px; }
.tool .th { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.tool .th svg { color: var(--accent); flex-shrink: 0; }
.tool .th b { font-weight: 700; font-size: 13.5px; }
.tool p { margin: 0 0 13px; color: var(--muted); font-size: 12.5px; max-width: 40ch; }
.qa-row { display: flex; gap: 8px; }
.fld { height: 40px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--ground);
  color: var(--ink); padding: 0 12px; font-size: 13px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.fld::placeholder { color: var(--muted); font-family: var(--mono); }
.fld:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.qa-row .sku-in { flex: 1; min-width: 0; }
.qa-row .qty-in { width: 62px; text-align: center; }
.btn-line { height: 40px; padding: 0 16px; border-radius: 8px; border: 0; background: var(--accent);
  color: var(--on-accent); font-weight: 700; font-size: 12.5px; font-family: var(--sans); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0; }
.btn-line:hover { background: var(--accent-deep); }
.save-row { display: flex; gap: 8px; }
.save-row .fld { flex: 1; min-width: 0; font-family: var(--sans); }
.btn-out { height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink-dim); font-weight: 650; font-size: 12.5px; font-family: var(--sans);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex-shrink: 0; }
.btn-out:hover { border-color: var(--accent); color: var(--accent); }

/* right column — sticky order summary */
.summary-col { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 14px; }
.summary { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface);
  overflow: hidden; box-shadow: 0 24px 60px -34px rgba(0,0,0,0.5); }
.summary .sh { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.sbody { padding: 16px 18px; display: flex; flex-direction: column; gap: 11px; }
.srow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.srow .k { color: var(--ink-dim); font-size: 13px; }
.srow .k small { display: block; color: var(--muted); font-size: 11px; font-family: var(--mono); }
.srow .v { font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.srow .v.free { color: var(--good); font-weight: 700; }
.srow.grand { border-top: 1px solid var(--line); padding-top: 13px; margin-top: 2px; align-items: baseline; }
.srow.grand .k { font-size: 14px; color: var(--ink); font-weight: 650; }
.srow.grand .v { font-size: 20px; font-weight: 800; }

.sactions { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 9px; }
.checkout { height: 48px; border-radius: 9px; border: 0; background: var(--accent); color: var(--on-accent);
  font-weight: 800; font-size: 15px; font-family: var(--sans); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.checkout:hover { background: var(--accent-deep); }
.continue { height: 40px; border-radius: 9px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--ink-dim); font-weight: 650; font-size: 13px; font-family: var(--sans); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.continue:hover { border-color: var(--accent); color: var(--accent); }

/* PO number affordance */
.po { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; }
.po label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.po label svg { color: var(--accent); }
.po input { width: 100%; height: 38px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--ground); color: var(--ink); padding: 0 12px; font-size: 13px; font-family: var(--mono); }
.po input::placeholder { color: var(--muted); }
.po input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.po .hint { font-size: 11px; color: var(--muted); margin: 8px 0 0; }

.trust { display: flex; flex-direction: column; gap: 7px; padding: 2px 4px; }
.trust span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.trust svg { color: var(--good); flex-shrink: 0; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(120%);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 12px 18px; font-size: 13px; font-family: var(--mono); box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
  z-index: 80; transition: transform .28s cubic-bezier(.2,.9,.3,1); display: flex; align-items: center; gap: 9px; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast svg { color: var(--good); }

@media (max-width: 900px) {
  .cart-layout { grid-template-columns: 1fr; }
  .summary-col { position: static; top: auto; }
  .tools { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .citem { grid-template-columns: 44px 1fr; grid-template-areas: "thumb body" "ctrl ctrl"; column-gap: 12px; row-gap: 12px; }
  .cthumb { width: 44px; height: 44px; grid-area: thumb; }
  .cbody { grid-area: body; }
  .cprices { grid-area: ctrl; flex-direction: row; align-items: center; justify-content: space-between; width: 100%;
    text-align: left; border-top: 1px solid var(--line); padding-top: 12px; }
  .cprices .ctrls { margin-top: 0; }
  .cprices .stack { display: flex; align-items: baseline; gap: 8px; }
}

/* Empty cart (WooCommerce cart-empty.php override) */
.cart-empty { display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px; padding: 40px 0 64px; color: var(--muted); }
.cart-empty > svg { color: var(--line-strong); margin-bottom: 8px; }
.cart-empty .empty-msg { font-size: 17px; font-weight: 750; color: var(--ink); margin: 0; }
.cart-empty .empty-sub { font-size: 13.5px; color: var(--ink-dim); margin: 0 0 14px; max-width: 42ch; }
.cart-empty .checkout { width: auto; padding: 0 24px; text-decoration: none; }
