/* ===== 购物车页样式 ===== */
.cart-main { padding: 32px 0 80px; min-height: 60vh; }
.page-title { font-family: var(--font-serif); font-size: 24px; font-weight: 700; margin-bottom: 24px; color: var(--text); display: flex; align-items: center; gap: 10px; }
.page-title i { color: var(--primary); }

/* 购物车布局 */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }

/* 购物车列表 */
.cart-list-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cart-list-header {
  display: grid;
  grid-template-columns: 40px 1fr 120px 120px 80px 60px;
  gap: 12px;
  padding: 14px 20px;
  background: var(--border-light);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  align-items: center;
}
.cart-item {
  display: grid;
  grid-template-columns: 40px 1fr 120px 120px 80px 60px;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  align-items: center;
  transition: background 0.2s;
}
.cart-item:hover { background: var(--bg); }
.cart-item:last-child { border-bottom: none; }
.item-check input[type="checkbox"] {
  width: 18px; height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}
.item-info { display: flex; gap: 12px; align-items: center; }
.item-img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.item-details { flex: 1; min-width: 0; }
.item-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-spec { font-size: 12px; color: var(--text-muted); }
.item-price { font-size: 16px; font-weight: 700; color: #E53935; }
.item-price::before { content: '¥'; font-size: 12px; }
.item-qty { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; width: fit-content; }
.item-qty button { width: 28px; height: 28px; background: var(--bg); font-size: 14px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.item-qty button:hover { background: var(--primary); color: #fff; }
.item-qty input { width: 40px; height: 28px; text-align: center; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 13px; font-weight: 700; font-family: inherit; outline: none; }
.item-subtotal { font-size: 16px; font-weight: 700; color: var(--primary); }
.item-subtotal::before { content: '¥'; font-size: 12px; }
.item-del { font-size: 16px; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.item-del:hover { color: #E53935; background: #FFEBEE; }

/* 全选/底部 */
.cart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--border-light);
  border-radius: 0 0 var(--radius) var(--radius);
  flex-wrap: wrap;
  gap: 12px;
}
.select-all { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.select-all input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.del-selected {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.del-selected:hover { color: #E53935; border-color: #E53935; }

/* 结算面板 */
.cart-checkout-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}
.checkout-panel-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; color: var(--text); }
.checkout-summary { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-light); }
.summary-row.total { font-size: 16px; font-weight: 700; color: var(--text); border-top: 1px solid var(--border-light); padding-top: 12px; margin-top: 4px; }
.summary-row.total .total-price { font-size: 22px; color: #E53935; font-weight: 800; }
.summary-row.total .total-price::before { content: '¥'; font-size: 14px; }
.checkout-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #E53935, #C62828);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  transition: all 0.2s;
  margin-bottom: 12px;
}
.checkout-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(229,57,53,0.35); }
.checkout-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.checkout-tips { font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.7; }
.checkout-tips i { color: var(--primary); }

/* 空购物车 */
.empty-cart {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}
.empty-cart i { font-size: 64px; display: block; margin-bottom: 20px; opacity: 0.3; }
.empty-cart h3 { font-size: 18px; margin-bottom: 12px; }
.empty-cart p { font-size: 14px; margin-bottom: 24px; }
.empty-cart a { display: inline-block; padding: 12px 28px; background: var(--primary); color: #fff; border-radius: 24px; font-weight: 600; font-size: 15px; transition: all 0.2s; }
.empty-cart a:hover { background: var(--primary-dark); transform: translateY(-2px); }

@media (max-width: 900px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-list-header { display: none; }
  .cart-item { grid-template-columns: 40px 1fr 80px; grid-template-rows: auto auto; }
  .item-price { display: none; }
  .item-subtotal { text-align: right; }
  .cart-checkout-panel { position: static; }
}
