/* 产品商城样式 */
.shop-hero {
  background: linear-gradient(135deg, #4460ff 0%, #6a7dff 100%);
  color: #fff;
  padding: 36px 24px;
  text-align: center;
}
.shop-hero-inner { max-width: 1200px; margin: 0 auto; }
.shop-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.shop-subtitle { font-size: 15px; opacity: 0.9; margin-bottom: 18px; }
.shop-features { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.shop-features span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; opacity: 0.95; }
.shop-features svg { color: #b9f5c8; }

.shop-container { padding-top: 24px; }
.shop-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; padding: 14px 16px; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04); margin-bottom: 18px; flex-wrap: wrap;
}
.cat-nav { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.cat-item {
  padding: 6px 14px; border-radius: 16px; font-size: 13px; cursor: pointer;
  background: #f2f3f5; color: var(--text-2); transition: all .15s; white-space: nowrap;
}
.cat-item:hover { background: var(--primary-light); color: var(--primary); }
.cat-item.active { background: var(--primary); color: #fff; }
.tool-right { display: flex; align-items: center; gap: 10px; }
.search-box { display: flex; align-items: center; gap: 8px; }
.search-box .form-input { width: 220px; padding: 6px 10px; font-size: 13px; }
.tool-right .form-select { padding: 6px 10px; font-size: 13px; width: auto; }

.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.product-grid > .empty,
.product-grid > .text-center { grid-column: 1 / -1; }
.product-card {
  background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid #ebedf0;
  transition: border-color .2s, box-shadow .2s, transform .2s; cursor: pointer; position: relative;
}
.product-card:hover {
  border-color: var(--primary); box-shadow: 0 6px 18px rgba(68,96,255,0.12); transform: translateY(-2px);
}
.p-cover {
  aspect-ratio: 1 / 1; background: #fff; display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative; padding: 14px;
  box-sizing: border-box;
}
.p-cover img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; transition: transform .3s; border-radius: 6px;
}
.product-card:hover .p-cover img { transform: scale(1.04); }
.p-cover .ph-img {
  width: 80%; height: 80%; display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: #c9ccd1; background: linear-gradient(135deg, #f7f8fa, #eef0f3); border-radius: 6px;
}
.p-badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; }
.badge-tag {
  font-size: 11px; padding: 2px 7px; border-radius: 4px; font-weight: 600;
  display: inline-block; line-height: 1.4;
}
.badge-tag.hot { background: #ff4d4f; color: #fff; }
.badge-tag.new { background: #07c160; color: #fff; }
.p-info { padding: 10px 12px 14px; }
.p-name {
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 38px;
}
.p-sub {
  font-size: 12px; color: var(--text-3); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-price-row { margin-top: 8px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.p-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.p-price .cur { font-size: 18px; font-weight: 700; color: #ff4d4f; }
.p-price .orig { font-size: 12px; color: var(--text-3); text-decoration: line-through; }
.p-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.stock-tag { font-size: 11px; padding: 1px 6px; border-radius: 3px; }
.stock-tag.ok { background: #e8ffea; color: #07c160; }
.stock-tag.warn { background: #fff7e8; color: #ff9900; }
.sold { font-size: 11px; color: var(--text-3); }

.shop-pagination { margin-top: 24px; }
.shop-pagination .pages { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.shop-pagination button {
  min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text-2); border-radius: 6px; cursor: pointer; font-size: 13px;
}
.shop-pagination button:hover:not(:disabled):not(.active) { border-color: var(--primary); color: var(--primary); }
.shop-pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.shop-pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* 详情弹窗 */
#detailModal .modal-body { max-height: 80vh; overflow-y: auto; }
.detail-layout { display: flex; gap: 24px; padding: 24px; }
.detail-gallery { flex: 0 0 380px; }
.gallery-main { width: 100%; aspect-ratio: 1/1; background: #f7f8fa; border-radius: 8px; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 60px; height: 60px; border-radius: 6px; object-fit: cover; cursor: pointer;
  border: 2px solid transparent; transition: border-color .15s;
}
.gallery-thumbs img:hover { border-color: var(--primary-light); }
.gallery-thumbs img.active { border-color: var(--primary); }
.ph-img-big {
  width: 100%; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
  font-size: 120px; color: #c9ccd1; background: linear-gradient(135deg, #f7f8fa, #eef0f3); border-radius: 8px;
}
.detail-info { flex: 1; min-width: 0; }
.d-title { font-size: 20px; font-weight: 700; margin: 6px 0 4px; line-height: 1.4; }
.d-sub { font-size: 14px; color: var(--text-3); margin-bottom: 12px; }
.d-price-box {
  background: linear-gradient(135deg, #fff7f5, #fff); border-radius: 8px; padding: 14px 16px;
  margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.d-price { font-size: 28px; font-weight: 700; color: #ff4d4f; }
.d-orig { font-size: 14px; color: var(--text-3); text-decoration: line-through; }
.d-sold { font-size: 12px; color: var(--text-3); margin-left: auto; }
.d-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.d-meta .meta-item { display: inline-flex; align-items: center; }
.d-desc {
  font-size: 13px; color: var(--text-2); line-height: 1.7; padding: 12px 14px; background: #f9fafb;
  border-radius: 6px; margin-bottom: 16px; white-space: pre-wrap;
}
.d-qty { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.qty-label { font-size: 14px; color: var(--text-2); }
.qty-ctrl { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.qty-ctrl button {
  width: 34px; height: 34px; font-size: 18px; background: #f7f8fa; color: var(--text-2); border: none; cursor: pointer;
}
.qty-ctrl button:hover { background: var(--primary-light); color: var(--primary); }
.qty-ctrl input {
  width: 56px; height: 34px; text-align: center; border: none; border-left: 1px solid var(--border);
  border-right: 1px solid var(--border); font-size: 14px; outline: none; -moz-appearance: textfield;
}
.qty-ctrl input::-webkit-outer-spin-button, .qty-ctrl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stock { font-size: 12px; color: var(--text-3); }
.d-actions { display: flex; gap: 12px; }

.specs-box { padding: 16px 24px; border-top: 1px solid var(--border); }
.specs-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.specs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.specs-table td { padding: 8px 12px; border: 1px solid var(--border); }
.specs-table tr td:first-child { background: #fafbfc; width: 130px; color: var(--text-2); }
.detail-html-box { padding: 16px 24px; border-top: 1px solid var(--border); }
.detail-html-box img { max-width: 100%; border-radius: 6px; margin: 8px 0; }

/* 下单结算弹窗 */
#checkoutModal .modal-body { padding: 16px 20px; }
.checkout-section { padding: 14px 0; border-bottom: 1px solid var(--border); }
.checkout-section:last-of-type { border-bottom: none; }
.co-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.co-form { display: flex; flex-direction: column; gap: 12px; }
.co-row { display: flex; gap: 12px; }
.co-field { min-width: 0; }
.co-field.flex-1 { flex: 1; }
.co-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.co-item-img { width: 56px; height: 56px; border-radius: 6px; overflow: hidden; background: #f7f8fa; flex-shrink: 0; }
.co-item-img img { width: 100%; height: 100%; object-fit: cover; }
.ph-img-sm { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 22px; color: #c9ccd1; }
.co-item-info { flex: 1; min-width: 0; }
.co-item-name { font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-item-price { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.co-item-sub { font-size: 14px; font-weight: 600; color: #ff4d4f; }
.pay-methods { display: flex; gap: 20px; }
.pay-opt { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.pay-opt input { cursor: pointer; }
.pay-ic { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }
.checkout-summary {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 12px;
  padding: 14px 0 4px; border-top: 1px solid var(--border); margin-top: 6px;
}
.co-total { font-size: 22px; font-weight: 700; color: #ff4d4f; }
.checkout-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 12px; }

@media (max-width: 768px) {
  .shop-title { font-size: 22px; }
  .shop-subtitle { font-size: 13px; }
  .shop-features { gap: 14px; }
  .shop-features span { font-size: 12px; }
  .shop-toolbar { flex-direction: column; align-items: stretch; }
  .cat-nav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .cat-item { flex-shrink: 0; }
  .tool-right { flex-direction: column; align-items: stretch; }
  .search-box .form-input { width: 100%; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .p-info { padding: 8px 10px 12px; }
  .p-name { font-size: 13px; min-height: 36px; }
  .p-price .cur { font-size: 16px; }
  .detail-layout { flex-direction: column; padding: 16px; }
  .detail-gallery { flex: 0 0 auto; }
  .d-title { font-size: 18px; }
  .d-price { font-size: 22px; }
  .d-actions .btn-lg { flex: 1; }
  .co-row { flex-direction: column; gap: 12px; }
  .checkout-actions .btn-lg { flex: 1; }
}
