/* =============================================================
   科纳云官网 · 商城（shop.html / shop-detail.html）样式
   复用 style.css 的 CSS 变量与按钮，只补商城专有部分。
   ============================================================= */

/* ---------- 商城 page hero ---------- */
.shop-hero {
  background: var(--gradient-hero);
  padding: 150px 0 60px;
  position: relative;
  overflow: hidden;
}
.shop-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 25% 30%, rgba(37,99,235,0.12), transparent 60%),
    radial-gradient(ellipse 50% 45% at 78% 22%, rgba(59,130,246,0.1), transparent 58%);
  pointer-events: none;
}
.shop-hero .container { position: relative; z-index: 2; }
.shop-hero h1 {
  font-size: 46px; font-weight: 800; color: var(--text);
  letter-spacing: -1.2px; margin: 16px 0 14px;
}
.shop-hero h1 span {
  background: var(--gradient-aurora); background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.shop-hero p { font-size: 17px; color: var(--text-light); line-height: 1.8; max-width: 680px; }

/* ---------- 工具条：搜索 + 排序 ---------- */
.shop-toolbar {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; margin-top: 30px;
}
.shop-search {
  flex: 1; min-width: 240px; max-width: 420px; position: relative;
}
.shop-search input {
  width: 100%; height: 46px; padding: 0 46px 0 18px;
  border: 1.5px solid var(--border); border-radius: 14px;
  background: #fff; font-size: 15px; color: var(--text);
  font-family: inherit; outline: none; transition: var(--transition-fast);
}
.shop-search input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }
.shop-search button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; border-radius: 10px;
  background: var(--gradient-ocean); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.shop-sort { display: flex; gap: 8px; flex-wrap: wrap; }
.shop-sort button {
  height: 40px; padding: 0 18px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--border); background: rgba(255,255,255,0.8);
  color: var(--text-light); font-size: 14px; font-weight: 600;
  font-family: inherit; transition: var(--transition-fast);
}
.shop-sort button:hover { border-color: var(--primary-light); color: var(--primary); }
.shop-sort button.active {
  background: var(--gradient-ocean); border-color: transparent; color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}

/* ---------- 主体布局 ---------- */
.shop-section { background: var(--bg-gray); padding: 48px 0 100px; min-height: 50vh; }
.shop-layout { display: grid; grid-template-columns: 210px 1fr; gap: 28px; align-items: start; }

/* 分类侧栏 */
.shop-cats {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 18px 14px; position: sticky; top: 96px;
}
.shop-cats h3 {
  font-size: 13px; font-weight: 700; color: var(--text-lighter);
  letter-spacing: 1px; text-transform: uppercase; margin: 0 0 12px 8px;
}
.shop-cat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-radius: 12px; cursor: pointer;
  font-size: 15px; color: var(--text-light); font-weight: 600;
  transition: var(--transition-fast); border: none; background: none;
  width: 100%; font-family: inherit; text-align: left;
}
.shop-cat:hover { background: var(--bg-warm); color: var(--primary); }
.shop-cat.active { background: var(--gradient-ocean); color: #fff; }
.shop-cat .cnt { font-size: 12px; opacity: 0.7; font-weight: 500; }

/* 商品网格 */
.shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.goods-card {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: var(--transition); cursor: pointer;
  display: flex; flex-direction: column; position: relative;
}
.goods-card:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-lg);
  border-color: rgba(37,99,235,0.2);
}
.goods-card__media {
  height: 176px; background: linear-gradient(135deg, #eef4ff, #e8f0ff);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  position: relative;
}
.goods-card__media img { width: 100%; height: 100%; object-fit: cover; }
.goods-card__media .ph {
  font-size: 46px; font-weight: 800; color: rgba(37,99,235,0.22); letter-spacing: -2px;
}
.goods-card__tag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--gradient-ocean); color: #fff;
  padding: 4px 12px; border-radius: 8px; font-size: 11px; font-weight: 700;
}
.goods-card__type {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(15,23,42,0.72); color: #fff;
  padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 600;
}
.goods-card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.goods-card__name {
  font-size: 17px; font-weight: 800; color: var(--text);
  margin-bottom: 6px; line-height: 1.35;
}
.goods-card__sub {
  font-size: 13px; color: var(--text-lighter); line-height: 1.6;
  margin-bottom: 14px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.goods-card__features { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.goods-card__features span {
  font-size: 11px; color: var(--accent-text); background: rgba(37,99,235,0.07);
  padding: 3px 9px; border-radius: 6px; font-weight: 600;
}
/* 说明行：库存 / 保障期 等（部件 parts.notes） */
.goods-card__notes {
  font-size: 12px; color: var(--text-lighter); line-height: 1.7;
  margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px;
}
.goods-card__notes span { display: inline-flex; align-items: center; gap: 5px; }
.goods-card__notes span::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--primary-light, #3b82f6); opacity: 0.55; flex: 0 0 5px;
}
/* compact 变体：不占大图，用于密集清单（部件 registerCard('compact')） */
.goods-card--compact .goods-card__body { padding: 18px; }
.goods-card__foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.goods-card__price { display: flex; align-items: baseline; gap: 2px; color: var(--primary); }
.goods-card__price .cur { font-size: 14px; font-weight: 700; }
.goods-card__price .num { font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.goods-card__price .suffix { font-size: 12px; color: var(--text-lighter); font-weight: 600; margin-left: 3px; }
.goods-card__btn {
  padding: 9px 18px; border-radius: 11px; border: none; cursor: pointer;
  background: var(--gradient-ocean); color: #fff; font-size: 13px; font-weight: 700;
  font-family: inherit; transition: var(--transition-fast); white-space: nowrap;
}
.goods-card__btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(37,99,235,0.35); }

/* 空状态 / 加载 */
.shop-empty, .shop-loading {
  grid-column: 1 / -1; text-align: center; padding: 70px 20px;
  color: var(--text-lighter); font-size: 15px;
}
.shop-loading::before {
  content: ''; display: block; width: 34px; height: 34px; margin: 0 auto 16px;
  border: 3px solid rgba(37,99,235,0.15); border-top-color: var(--primary);
  border-radius: 50%; animation: shopSpin 0.8s linear infinite;
}
@keyframes shopSpin { to { transform: rotate(360deg); } }
.shop-empty strong { display: block; font-size: 17px; color: var(--text); margin-bottom: 8px; }

/* ===========================================================
   商品详情页
   =========================================================== */
.detail-wrap { background: var(--bg-gray); padding: 130px 0 90px; }
.detail-crumb { font-size: 13px; color: var(--text-lighter); margin-bottom: 22px; }
.detail-crumb a { color: var(--text-light); text-decoration: none; }
.detail-crumb a:hover { color: var(--primary); }
.detail-crumb span { margin: 0 8px; }

.detail-card {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 44px;
}
.detail-gallery__main {
  border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg,#eef4ff,#e8f0ff);
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
}
.detail-gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.detail-gallery__main .ph { font-size: 76px; font-weight: 800; color: rgba(37,99,235,0.2); letter-spacing: -4px; }
.detail-gallery__thumbs { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.detail-gallery__thumbs img {
  width: 68px; height: 68px; object-fit: cover; border-radius: 10px; cursor: pointer;
  border: 2px solid transparent; transition: var(--transition-fast);
}
.detail-gallery__thumbs img.active { border-color: var(--primary); }

.detail-info h1 { font-size: 30px; font-weight: 800; color: var(--text); margin: 0 0 10px; letter-spacing: -0.6px; }
.detail-info__sub { font-size: 15px; color: var(--text-light); line-height: 1.75; margin-bottom: 18px; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.detail-meta span {
  font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 7px;
  background: rgba(37,99,235,0.07); color: var(--accent-text);
}

.detail-price-box {
  background: linear-gradient(135deg, rgba(37,99,235,0.05), rgba(37,99,235,0.02));
  border: 1.5px solid rgba(37,99,235,0.12);
  border-radius: var(--radius-sm); padding: 18px 20px; margin-bottom: 22px;
}
.detail-price { display: flex; align-items: baseline; gap: 3px; color: var(--primary); }
.detail-price .cur { font-size: 20px; font-weight: 700; }
.detail-price .num { font-size: 40px; font-weight: 800; letter-spacing: -1.5px; }
.detail-price .suffix { font-size: 14px; color: var(--text-lighter); font-weight: 600; margin-left: 6px; }
.detail-price .orig { font-size: 14px; color: var(--text-lighter); text-decoration: line-through; margin-left: 10px; }
.detail-price__note { font-size: 12px; color: var(--text-lighter); margin-top: 6px; }

.detail-field { margin-bottom: 20px; }
.detail-field > label {
  display: block; font-size: 13px; font-weight: 700; color: var(--text-light); margin-bottom: 9px;
}
.detail-specs { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-spec {
  padding: 10px 16px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--border); background: #fff;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text-light);
  transition: var(--transition-fast); text-align: left; line-height: 1.35;
}
.detail-spec:hover { border-color: var(--primary-light); color: var(--primary); }
.detail-spec.active {
  border-color: var(--primary); color: var(--primary);
  background: rgba(37,99,235,0.06); box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.detail-spec small { display: block; font-size: 12px; font-weight: 700; color: var(--text-lighter); margin-top: 3px; }
.detail-spec.active small { color: var(--primary); }
.detail-spec.out { opacity: 0.45; cursor: not-allowed; text-decoration: line-through; }

.detail-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.detail-qty button {
  width: 42px; height: 42px; border: none; background: #fff; cursor: pointer;
  font-size: 19px; color: var(--text-light); font-family: inherit; transition: var(--transition-fast);
}
.detail-qty button:hover:not(:disabled) { background: var(--bg-warm); color: var(--primary); }
.detail-qty button:disabled { opacity: 0.35; cursor: not-allowed; }
.detail-qty input {
  width: 62px; height: 42px; border: none; border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border); text-align: center; font-size: 16px;
  font-weight: 700; color: var(--text); font-family: inherit; outline: none;
}

.detail-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.detail-actions .btn-primary, .detail-actions .btn-outline { flex: 1; min-width: 160px; text-align: center; }

/* 买家表单 */
.buyer-form { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 22px; }
.buyer-form h3 { font-size: 15px; font-weight: 800; color: var(--text); margin: 0 0 16px; }
.buyer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.buyer-field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-lighter); margin-bottom: 6px; }
.buyer-field input, .buyer-field textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 11px;
  font-size: 14px; font-family: inherit; color: var(--text); outline: none;
  transition: var(--transition-fast); background: #fff;
}
.buyer-field input:focus, .buyer-field textarea:focus {
  border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,235,0.09);
}
.buyer-field.full { grid-column: 1 / -1; }
.buyer-field textarea { resize: vertical; min-height: 74px; }

/* 商品详情正文 */
.detail-body {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 34px; margin-top: 26px;
}
.detail-body h2 {
  font-size: 21px; font-weight: 800; color: var(--text); margin: 0 0 18px;
  padding-left: 14px; border-left: 4px solid var(--primary);
}
.detail-body h3 { font-size: 17px; font-weight: 700; color: var(--text); margin: 24px 0 12px; }
.detail-body p { font-size: 15px; color: var(--text-light); line-height: 1.9; margin: 0 0 14px; }
.detail-body img { max-width: 100%; border-radius: var(--radius-sm); }
.detail-body table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.detail-body th, .detail-body td {
  padding: 11px 14px; border: 1px solid var(--border); font-size: 14px; text-align: left;
}
.detail-body th { background: var(--bg-warm); font-weight: 700; color: var(--text); }
.detail-body ul { margin: 0 0 16px; padding-left: 22px; }
.detail-body li { font-size: 15px; color: var(--text-light); line-height: 1.9; }

.detail-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.detail-feature {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  background: var(--bg-warm); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; color: var(--text-light);
}
.detail-feature::before {
  content: '✓'; width: 20px; height: 20px; min-width: 20px; flex: 0 0 20px;
  background: var(--gradient-ocean); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}

/* ---------- 支付弹窗 ---------- */
.pay-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55);
  backdrop-filter: blur(4px); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.pay-modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 460px;
  padding: 32px; text-align: center; box-shadow: var(--shadow-xl);
  max-height: 90vh; overflow-y: auto;
}
.pay-modal h3 { font-size: 20px; font-weight: 800; color: var(--text); margin: 0 0 6px; }
.pay-modal__amount { font-size: 34px; font-weight: 800; color: var(--primary); margin: 14px 0 4px; letter-spacing: -1px; }
.pay-modal__order { font-size: 12px; color: var(--text-lighter); margin-bottom: 20px; word-break: break-all; }
.pay-modal__qr {
  width: 218px; height: 218px; margin: 0 auto 16px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: #fff;
}
.pay-modal__qr img, .pay-modal__qr canvas { width: 100%; height: 100%; }

/* 渠道切换 */
.pay-modal__switch {
  display: inline-flex; gap: 4px; padding: 4px; margin: 0 auto 18px;
  background: var(--bg-gray); border-radius: 12px;
}
.pay-tab {
  padding: 8px 22px; border: none; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--text-lighter); font-size: 14px;
  font-weight: 600; font-family: inherit; transition: var(--transition-fast);
}
.pay-tab:hover:not(:disabled) { color: var(--primary); }
.pay-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.pay-tab:disabled { opacity: 0.5; cursor: not-allowed; }
.pay-modal__tip { font-size: 13px; color: var(--text-lighter); line-height: 1.8; margin-bottom: 20px; }
.pay-modal__tip b { color: var(--primary); }
.pay-modal .btn-primary, .pay-modal .btn-outline { width: 100%; }
.pay-modal__status { padding: 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.pay-modal__status.ok { background: rgba(16,185,129,0.1); color: #047857; }
.pay-modal__status.warn { background: rgba(245,158,11,0.1); color: #b45309; }
.pay-modal__status.err { background: rgba(239,68,68,0.1); color: #b91c1c; }

/* 纯 CSS 占位二维码（无第三方 JS 时用） */
.pay-qr-fallback {
  width: 100%; height: 100%; display: grid; grid-template-columns: repeat(21, 1fr);
  grid-template-rows: repeat(21, 1fr); gap: 0; padding: 10px; box-sizing: border-box;
}
.pay-qr-fallback i { background: #0f172a; }

@media (max-width: 980px) {
  .shop-hero { padding: 120px 0 44px; }
  .shop-hero h1 { font-size: 32px; }
  .shop-layout { grid-template-columns: 1fr; }
  .shop-cats { position: static; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
  .shop-cats h3 { display: none; }
  .shop-cat { width: auto; padding: 8px 14px; font-size: 14px; }
  .shop-cat .cnt { display: none; }
  .detail-card { grid-template-columns: 1fr; gap: 26px; padding: 22px; }
  .detail-wrap { padding: 110px 0 60px; }
  .detail-info h1 { font-size: 24px; }
  .detail-price .num { font-size: 32px; }
  .buyer-grid { grid-template-columns: 1fr; }
  .detail-body { padding: 22px; }
}
