/* ============================================================
   咖鑫官网 · 配件商城样式（沿用全站设计令牌）
   ============================================================ */

.shop-hero {
  padding: 56px 0 44px;
  background: linear-gradient(160deg, var(--brand-900), var(--brand-700));
  color: #fff;
}
.shop-hero-sm { padding: 40px 0 32px; }
.shop-hero .hero-eyebrow { color: var(--accent); }
.shop-hero h1 { font-size: 34px; margin: 10px 0 12px; }
.shop-hero h1 em { font-style: normal; color: var(--accent); }
.shop-hero .hero-lead { color: rgba(255, 255, 255, 0.82); max-width: 720px; font-size: 15px; }
.shop-hero-tip {
  margin-top: 18px;
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}

.shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.shop-cats { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 34px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
}
.chip:hover { border-color: var(--brand-500); color: var(--brand-700); }
.chip.is-active {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
}
.shop-tools { display: flex; gap: 10px; }
.shop-search, .shop-select {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
}
.shop-search { width: 220px; }
.shop-search:focus, .shop-select:focus { outline: none; border-color: var(--brand-500); }

.shop-cartbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 18px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 22px;
}
.shop-count { font-size: 13px; color: var(--ink-3); }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.p-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.p-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--brand-500); }
.p-media {
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-50);
  border-bottom: 1px solid var(--line-soft);
}
.p-media img { max-height: 104px; max-width: 78%; object-fit: contain; }
.p-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.p-cat { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.p-body h3 { font-size: 15px; line-height: 1.45; margin-bottom: 4px; }
.p-sum {
  font-size: 12px;
  color: var(--ink-3);
  min-height: 34px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.p-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 8px 0 12px;
}
.p-price { font-size: 19px; font-weight: 700; color: var(--danger); font-variant-numeric: tabular-nums; }
.p-stock { font-size: 12px; color: var(--ink-3); }
.p-stock.is-out { color: var(--warning); }
.p-actions { display: flex; gap: 8px; margin-top: auto; }
.p-actions .btn { flex: 1; justify-content: center; }
.p-actions .btn[disabled] { opacity: .5; cursor: not-allowed; }

.shop-empty { padding: 60px 0; text-align: center; color: var(--ink-3); }
.shop-more { text-align: center; margin-top: 28px; }

/* ---------------- 购物车抽屉 ---------------- */
.drawer-mask, .modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(31, 27, 24, 0.45);
  z-index: 60;
}
.modal-mask { position: fixed; display: flex; align-items: center; justify-content: center; padding: 20px; }
.drawer-mask { position: fixed; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 92vw;
  height: 100%;
  background: var(--white);
  z-index: 61;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.drawer-head, .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3, .modal-head h3 { font-size: 16px; }
.drawer-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 18px; }
.drawer-empty { padding: 48px 0; text-align: center; color: var(--ink-3); font-size: 14px; }
.cart-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.cart-img { width: 56px; height: 56px; object-fit: contain; background: var(--brand-50); border-radius: var(--radius-sm); }
.cart-info { flex: 1; min-width: 0; }
.cart-name { font-size: 14px; line-height: 1.4; }
.cart-price { font-size: 13px; color: var(--danger); font-weight: 600; margin: 2px 0 6px; }
.cart-qty { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.cart-qty button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
}
.cart-qty a { color: var(--ink-3); font-size: 12px; cursor: pointer; margin-left: auto; }
.drawer-foot { padding: 14px 18px; border-top: 1px solid var(--line); }
.drawer-total { margin-bottom: 10px; font-size: 14px; }
.drawer-total b { color: var(--danger); font-size: 18px; }

/* ---------------- 弹窗 ---------------- */
.modal {
  width: 560px;
  max-width: 100%;
  max-height: 88vh;
  overflow: auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 61;
}
.modal-body { padding: 18px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.field span i { color: var(--danger); font-style: normal; }
.field input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 14px;
  font-family: var(--font);
}
.field input:focus { outline: none; border-color: var(--brand-500); }
.modal-tip { font-size: 12px; color: var(--ink-3); }

.detail { display: flex; gap: 18px; }
.detail-img { width: 190px; height: 190px; object-fit: contain; background: var(--brand-50); border-radius: var(--radius); }
.detail-main { flex: 1; min-width: 0; }
.detail-main h3 { font-size: 18px; margin: 4px 0 8px; }
.detail-price { font-size: 24px; font-weight: 700; color: var(--danger); margin-bottom: 8px; }
.detail-sum { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.detail-spec { display: grid; grid-template-columns: 72px 1fr; gap: 4px 10px; font-size: 13px; margin-bottom: 12px; }
.detail-spec dt { color: var(--ink-3); }
.detail-spec dd { margin: 0; color: var(--ink-2); }
.detail-desc, .detail-note { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }

.ok-box { text-align: center; padding: 8px 0; }
.ok-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 28px;
  line-height: 52px;
}
.ok-box h4 { font-size: 18px; margin-bottom: 8px; }
.ok-no, .ok-amt { font-size: 14px; color: var(--ink-2); }
.ok-amt b { color: var(--danger); font-size: 18px; }
.ok-tip { margin: 12px 0 16px; font-size: 13px; color: var(--ink-3); }
.ok-box .btn { margin-top: 8px; }

/* ---------------- 订单查询 ---------------- */
.track-box {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.track-form { display: grid; gap: 14px; margin-bottom: 8px; }
.track-form .btn { justify-content: center; }
.track-hint { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
.track-hint a { color: var(--brand-700); }
.track-error { padding: 16px; border-radius: var(--radius-sm); background: #fdf0ee; color: var(--danger); font-size: 14px; }

.track-result { border-top: 1px solid var(--line-soft); padding-top: 20px; }
.track-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.track-head span { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--ink-2); }
.track-status { color: var(--brand-700); font-size: 15px; }
.track-steps { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; }
.track-step { position: relative; text-align: center; font-size: 13px; color: var(--ink-3); }
.track-step i {
  display: block;
  width: 12px;
  height: 12px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--line);
}
.track-step::before {
  content: '';
  position: absolute;
  top: 5px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--line);
}
.track-step:first-child::before { display: none; }
.track-step.is-done { color: var(--ink); }
.track-step.is-done i { background: var(--success); }
.track-step.is-done::before { background: var(--success); }
.track-step em { display: block; font-style: normal; font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.track-meta { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 18px; }
.track-meta dt { color: var(--ink-3); }
.track-meta dd { margin: 0; color: var(--ink-2); }
.track-meta dd.strong { color: var(--danger); font-weight: 600; }

.track-items { width: 100%; border-collapse: collapse; font-size: 13px; }
.track-items th, .track-items td { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.track-items th { color: var(--ink-3); font-weight: 500; background: var(--bg-soft); }
.track-items .sku { font-size: 11px; color: var(--ink-3); font-family: ui-monospace, Menlo, Consolas, monospace; }

@media (max-width: 1024px) {
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .shop-hero h1 { font-size: 26px; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-tools { width: 100%; }
  .shop-search { flex: 1; width: auto; }
  .detail { flex-direction: column; }
  .detail-img { width: 100%; }
  .track-steps { grid-template-columns: repeat(2, 1fr); gap: 16px 0; }
  .track-step::before { display: none; }
}
@media (max-width: 480px) {
  .shop-grid { grid-template-columns: 1fr; }
}
