:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --line: #dbe3ef;
  --text: #0f172a;
  --muted: #64748b;
  --blue: #1d4ed8;
  --blue2: #2563eb;
  --danger: #c5202f;
  --danger-bg: #fff3f4;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: radial-gradient(1300px 380px at top, #ecf2ff 0%, var(--bg) 50%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
.cartWrap { max-width: 1360px; margin: 0 auto; padding: 22px; }
.cartHead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  margin-bottom: 14px;
}
.cartHead h1 { margin: 0; font-size: 30px; line-height: 1.1; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.headActions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.primary {
  border-color: #1847bf;
  color: #fff;
  background: linear-gradient(180deg, var(--blue2), var(--blue));
}
.btn.ghost { background: #f8fbff; }
.btn.danger { border-color: #f2c2c7; color: var(--danger); background: var(--danger-bg); }

.cartLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}
.cartList { display: grid; gap: 10px; }
.lineCard {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 12px;
  display: grid;
  gap: 10px;
}
.lineTop {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.lineMain {
  display: flex;
  gap: 10px;
  min-width: 0;
}
.lineThumb {
  width: 74px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  flex: 0 0 auto;
}
.lineThumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lineInfo {
  min-width: 0;
}
.title { font-size: 18px; font-weight: 800; line-height: 1.2; }
.unitPrice { font-weight: 800; font-size: 16px; white-space: nowrap; }
.breakdown { color: var(--muted); font-size: 12px; margin-top: 2px; text-align: right; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: #334155;
  background: #f8fafc;
}

.lineBottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.qtyControl {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.qtyControl button {
  border: 0;
  background: #f8fafc;
  min-width: 34px;
  height: 36px;
  font-weight: 700;
  cursor: pointer;
}
.qtyControl input {
  width: 72px;
  height: 36px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font-weight: 700;
}
.lineActions { display: flex; align-items: center; gap: 8px; }
.lineTotal { font-size: 20px; font-weight: 900; white-space: nowrap; }

.summaryCard {
  position: sticky;
  top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 10px;
}
.summaryCard h2 { margin: 0 0 4px; font-size: 20px; }
.sumRow { display: flex; justify-content: space-between; font-size: 14px; color: #334155; }
.sumRow.total { font-size: 20px; font-weight: 900; color: var(--text); padding-top: 6px; border-top: 1px solid var(--line); }
.note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.summaryActions { display: grid; gap: 8px; }

.empty {
  border: 1px dashed #c9d3e3;
  border-radius: 14px;
  background: #fff;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

@media (max-width: 980px) {
  .cartWrap { padding: 12px; }
  .cartHead { flex-direction: column; }
  .headActions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .cartLayout { grid-template-columns: 1fr; }
  .summaryCard { position: static; }
  .lineTop { flex-direction: column; }
  .lineMain { width: 100%; }
  .breakdown { text-align: left; }
  .lineBottom { flex-wrap: wrap; }
}
