/* ============================================================
   cart.html 选品车独立页 专用样式
   依赖 style.css 的 CSS 变量（--blue/--red/--line 等）
   ============================================================ */

/* ---------- 顶栏右侧动作区（原在 product.css，cart.html 不引 product.css，故在此声明） ---------- */
.pd-top-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.pd-cartlink { position: relative; }
@media (max-width: 640px) {
  .pd-top-actions { gap: 8px; }
  .acct { padding: 5px 8px; }
  .acct-txt small { display: none; }
}
.ct-wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px 40px; }
.ct-crumb { font-size: 13px; color: var(--ink3); padding: 12px 2px 10px; }
.ct-crumb a { color: var(--ink3); }
.ct-crumb a:hover { color: var(--blue); }
.ct-crumb .sep { margin: 0 6px; opacity: .6; }
.ct-crumb b { color: var(--ink); }

/* 导入产品工具栏 */
.ct-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 2px 6px; }
.btn-imp { display: inline-flex; align-items: center; gap: 6px; background: var(--orange, #F0701A); border: none; color: #fff;
  padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.btn-imp:hover { filter: brightness(.95); }
.ct-tpllink { font-size: 13px; color: var(--blue); cursor: pointer; text-decoration: none; }
.ct-tpllink:hover { text-decoration: underline; }
.ct-imphint { font-size: 12px; color: var(--ink3); }

/* 导入预览表 */
.imp-prev { margin: 12px 0; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.imp-prev table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.imp-prev th, .imp-prev td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.imp-prev th { position: sticky; top: 0; background: #F6F8FA; font-weight: 700; color: var(--ink2); }
.imp-prev tr:last-child td { border-bottom: none; }
.imp-prev .ok { color: var(--teal, #0a8a5f); font-weight: 600; }
.imp-prev .bad { color: var(--red); }
.imp-prev .mut { color: var(--ink3); }
.imp-sum { font-size: 12.5px; color: var(--ink2); margin: 6px 0; line-height: 1.7; }
.imp-sum b { color: var(--ink); }
.imp-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.ct-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }

/* 行栅格：勾选 | 图 | 商品 | 单价 | 数量 | 箱数 | 小计 | 操作 */
.ct-row { display: grid; grid-template-columns: 74px 78px 1fr 118px 88px 132px 116px 72px;
  align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ct-thead { background: #F6F8FA; font-size: 12.5px; color: var(--ink2); font-weight: 700; padding: 10px 14px; }
.ct-tbody .ct-row:last-child { border-bottom: none; }
.ct-tbody .ct-row:hover { background: #FFF9F4; }
.ct-row.selrow { background: #FFF6EC; }

.ct-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; font-size: 12.5px; }
.ct-check input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }

.ct-thumb { width: 68px; height: 68px; border-radius: 8px; overflow: hidden; background: #fff;
  display: flex; align-items: center; justify-content: center; color: #c3c9d1; font-weight: 700; font-size: 15px; }
.ct-thumb img { width: 100%; height: 100%; object-fit: contain; }

.ct-info { min-width: 0; }
.ct-nm { font-size: 13.5px; font-weight: 600; line-height: 1.4; margin-bottom: 3px; word-break: break-all; }
.ct-nm .st { font-size: 11px; color: #fff; background: #999; border-radius: 4px; padding: 1px 5px; font-weight: 600; margin-left: 4px; }
.ct-mt { font-size: 11.5px; color: var(--ink3); font-family: ui-monospace, Menlo, Consolas, monospace; }
.ct-remark { font-size: 11.5px; color: var(--amber); margin-top: 2px; }

.ct-price b { font-size: 15px; color: var(--red); }
.ct-price small { font-size: 11px; color: var(--ink3); margin-left: 1px; }
.ct-price .lock { font-size: 12px; color: var(--amber); }
/* 数量列：箱数 × 装箱数 */
.ct-num b { font-size: 14px; color: var(--ink); }
.ct-num small { font-size: 11px; color: var(--ink3); margin-left: 1px; }
.ct-num .na { font-size: 13px; color: var(--ink3); }
.ct-sub b { font-size: 15px; color: var(--red); }
.ct-sub span { font-size: 12px; color: var(--ink3); }

.stepper.ct-step { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: fit-content; }
.stepper.ct-step button { width: 30px; height: 30px; background: #F6F8FA; border: none; cursor: pointer; font-size: 15px; color: var(--ink); }
.stepper.ct-step button:hover { background: var(--blue-l); color: var(--blue); }
.stepper.ct-step input { width: 42px; height: 30px; border: none; border-left: 1px solid var(--line);
  border-right: 1px solid var(--line); text-align: center; font-size: 13px; }

.ct-del { font-size: 12px; color: var(--ink3); cursor: pointer; }
.ct-del:hover { color: var(--red); text-decoration: underline; }

.ct-empty { padding: 60px 20px; text-align: center; color: var(--ink2); }
.ct-empty b { display: block; font-size: 16px; margin-bottom: 6px; color: var(--ink); }
.ct-empty .mut { font-size: 12.5px; color: var(--ink3); }

/* 底部汇总 + 操作 */
.ct-foot { margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.ct-foot .sum { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.ct-foot .sum > div { display: flex; flex-direction: column; gap: 2px; }
.ct-foot .sum span { font-size: 11.5px; color: var(--ink3); }
.ct-foot .sum b { font-size: 15px; }
.ct-foot .sum .total b { font-size: 20px; color: var(--red); }
.ct-hint { font-size: 11.5px; color: var(--ink3); margin-top: 8px; line-height: 1.6; }
.ct-acts { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ct-acts .btn { flex: 1; min-width: 130px; text-align: center; }
.tolist { font-size: 12.5px; color: var(--blue); cursor: pointer; }
.tolist:hover { text-decoration: underline; }

/* 手机端操作条 */
.ct-bar { display: none; }

/* 分页条：每页条数（20/50/80/100，默认 20）+ 页码 */
.ct-pgbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 0 4px; }
.ct-pgbar .pager { margin: 0; justify-content: flex-start; gap: 5px; }
.ct-spacer { flex: 1; }
.ct-selcount { font-size: 12px; color: var(--ink3); }
.ct-linkbtn { background: none; border: none; font-size: 12.5px; color: var(--ink2); cursor: pointer; padding: 0; }

/* ============================================================
   手机端：行卡片化
   ============================================================ */
@media (max-width: 860px) {
  .ct-wrap { padding: 0 0 30px; }
  .ct-crumb { padding: 8px 12px; }
  .ct-card { border-radius: 0; border-left: none; border-right: none; }
  .ct-foot { border-radius: 0; border-left: none; border-right: none; }

  .ct-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff;
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .ct-spacer { flex: 1; }
  .ct-selcount { font-size: 12px; color: var(--ink3); }
  .ct-linkbtn { background: none; border: none; font-size: 12.5px; color: var(--ink2); cursor: pointer; padding: 0; }
  .ct-linkbtn.danger { color: var(--red); }

  .ct-thead { display: none; }
  .ct-row { grid-template-columns: 30px 76px 1fr; grid-template-areas:
      "chk img info" ". . price" ". . num" ". . qty" ". . sub" ". . op";
    gap: 6px 10px; padding: 12px; align-items: start; }
  .ct-row > .c-chk { grid-area: chk; padding-top: 26px; }
  .ct-row > .c-img { grid-area: img; }
  .ct-row > .c-info { grid-area: info; }
  .ct-row > .c-price { grid-area: price; }
  .ct-row > .c-num { grid-area: num; }
  .ct-row > .c-qty { grid-area: qty; }
  .ct-row > .c-sub { grid-area: sub; }
  .ct-row > .c-op { grid-area: op; text-align: right; }
  .ct-row > div::before { display: none; }
  .ct-row .c-price::before { content: attr(data-l) '：'; font-size: 11.5px; color: var(--ink3); margin-right: 4px; }
  .ct-row .c-num::before { content: attr(data-l) '：'; font-size: 11.5px; color: var(--ink3); margin-right: 4px; }
  .ct-row .c-qty::before { content: attr(data-l) '：'; font-size: 11.5px; color: var(--ink3); margin-right: 4px; }
  .ct-row .c-sub::before { content: attr(data-l) '：'; font-size: 11.5px; color: var(--ink3); margin-right: 4px; }
  .ct-acts .btn { min-width: 0; width: 100%; }
}

/* ---------- 整单起订量凑单进度（同一系列 = 同一厂家编码） ---------- */
.ct-og { margin: 14px 0 0; padding: 14px 16px; background: #fff; border: 1px solid #f0d9c2; border-radius: 12px; }
.ct-og-h { font-size: 13px; font-weight: 700; color: var(--ink2); margin-bottom: 8px; }
.ogm { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px dashed #f0e2d3; }
.ogm:first-of-type { border-top: none; }
.ogm-short { background: #fff7ef; margin: 0 -8px; padding: 9px 8px; border-radius: 8px; }
.ogm-t { flex: 1; min-width: 0; font-size: 13px; color: var(--ink2); line-height: 1.45; }
.ogm-short .ogm-t { color: var(--red); font-weight: 600; }
.ogm-bar { width: 140px; flex: none; height: 8px; background: #f0e2d3; border-radius: 6px; overflow: hidden; }
.ogm-bar i { display: block; height: 100%; background: var(--blue); }
.ogm-met .ogm-bar i { background: #2e9e5b; }
.ogm-short .ogm-bar i { background: var(--blue-d); }
.ogm-btn { flex: none; font-size: 12.5px; font-weight: 600; color: #fff; background: var(--blue); padding: 6px 12px; border-radius: 7px; text-decoration: none; white-space: nowrap; }
.ogm-btn:hover { background: var(--blue-d); }
.ogm-ok { flex: none; font-size: 12.5px; font-weight: 600; color: #2e9e5b; white-space: nowrap; }

@media (max-width: 560px) {
  .ogm { flex-wrap: wrap; gap: 6px 10px; }
  .ogm-bar { width: 100%; order: 3; }
  .ogm-btn, .ogm-ok { order: 2; }
}
