/**
 * 功夫商城 (Shop)
 *
 * 只放商城独有的样式；栅格、按钮、卡片、徽章都用 design-system.css 里的。
 * 由 views/frontend/shop/* 通过 $extra_css 单独引入，不进全站样式。
 */

/* ── 列表页工具条：左边分类，右边购物车 ──
 *
 * 不用 design-system 的 .between —— 那个类只设了 justify-content，
 * 没有 display:flex，单独用的话两块内容会各占一行。
 */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.shop-toolbar .shop-filters { flex: 1 1 320px; margin-bottom: 0; }
.shop-toolbar .cart-link    { flex: 0 0 auto; }

/* ── 分类筛选条 ── */
.shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.shop-filter {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--c-ink);
  text-decoration: none;
  background: #fff;
  transition: all .15s ease;
}
.shop-filter:hover { border-color: var(--c-gold-dark); }
.shop-filter.active {
  background: var(--c-red);
  border-color: var(--c-red);
  color: #fff;
}

/* ── 商品网格 ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}
.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .10);
}
.product-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #F5F0E6;
  display: block;
}
.product-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #C8BFA8;
}
.product-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.product-name { font-size: 15px; font-weight: 600; margin: 0 0 4px; line-height: 1.45; }
.product-sub  { font-size: 13px; color: var(--c-muted); margin: 0 0 10px; }
.product-price {
  margin-top: auto;
  font-family: "Noto Serif SC", serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--c-red);
}
.product-price small { font-size: 12px; font-weight: 400; color: var(--c-muted); }

/* ── 商品详情 ── */
.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; }
@media (max-width: 767px) { .product-detail { grid-template-columns: 1fr; gap: 22px; } }
.product-detail .product-hero-img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--c-border);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #F5F0E6;
}
.product-detail h1 { margin: 0 0 6px; font-size: 26px; }
.product-detail .price-lg {
  font-family: "Noto Serif SC", serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--c-red);
  margin: 14px 0 18px;
}

/* ── 购物车 ── */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  vertical-align: middle;
}
.cart-table th { font-size: 13px; color: var(--c-muted); font-weight: 500; }
.cart-table td.num, .cart-table th.num { text-align: right; }
.cart-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #F5F0E6; }
/* 设计系统里 input[type="number"] 的 width:100% 特异度是 (0,1,1)，
   单靠 .cart-qty (0,1,0) 压不住 —— 加上元素选择器才生效。 */
input.cart-qty {
  width: 82px;
  display: inline-block;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}
.cart-summary {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 14px;
  margin-top: 18px;
  font-size: 17px;
}
.cart-summary strong {
  font-family: "Noto Serif SC", serif;
  font-size: 24px;
  color: var(--c-red);
}

/* ── 头部购物车角标 ── */
.cart-link { position: relative; }
.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--c-red);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

/* ── 订单 ── */
.order-status {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.order-status.pending   { background: #FFF4E0; color: #9A6B00; }
.order-status.paid      { background: #E4F1FA; color: #1B5E86; }
.order-status.shipped   { background: #E9E7FA; color: #40348C; }
.order-status.completed { background: #E4F5E9; color: #1E6B39; }
.order-status.cancelled { background: #F0EEE9; color: #77716A; }
