/* ============================================================
   新禾至信 小家电商城 · 科技蓝+白简约风 自定义样式
   基于 Bootstrap 5.3，覆盖定制主色与组件
   ============================================================ */
:root {
  --ih-blue: #0b6cff;
  --ih-deep: #062a66;
  --ih-cyan: #00c6ff;
  --ih-bg: #f5f8ff;
  --ih-card: #ffffff;
  --ih-text: #1b2a4a;
  --ih-muted: #7c8db0;
  --ih-border: #e3ebf7;
  --ih-amber: #ff9f0a;
  --ih-red: #e63946;
}

body {
  background: var(--ih-bg);
  color: var(--ih-text);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

/* ---------- 顶部导航 ---------- */
.ih-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--ih-border);
  box-shadow: 0 2px 14px rgba(6, 42, 102, 0.06);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.ih-navbar .navbar-brand {
  font-weight: 700;
  font-size: 20px;
  color: var(--ih-deep);
  letter-spacing: 1px;
}
.brand-dot {
  display: inline-block;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ih-blue), var(--ih-cyan));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin-right: 6px;
}
.ih-navbar .nav-link {
  color: var(--ih-text);
  font-weight: 500;
  margin: 0 4px;
  border-radius: 8px;
  padding: 8px 14px;
}
.ih-navbar .nav-link:hover { color: var(--ih-blue); }
.ih-navbar .nav-link.active {
  color: var(--ih-blue);
  background: rgba(11, 108, 255, 0.08);
}
.cart-badge {
  background: var(--ih-red) !important;
  border-radius: 20px;
  font-size: 11px;
  padding: 2px 7px;
  vertical-align: 2px;
}
.cart-badge.zero { display: none; }

/* ---------- Hero ---------- */
.ih-hero {
  background: linear-gradient(120deg, #062a66 0%, #0b6cff 55%, #00c6ff 100%);
  color: #fff;
  padding: 64px 0;
  border-radius: 0 0 36px 36px;
  overflow: hidden;
}
.ih-hero .hero-kicker {
  font-size: 13px;
  letter-spacing: 4px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
}
.ih-hero h1 {
  font-size: 42px;
  font-weight: 800;
  margin: 12px 0 10px;
}
.ih-hero h1 em { font-style: normal; color: #7ff3ff; }
.ih-hero p { color: rgba(255,255,255,0.85); font-size: 16px; max-width: 520px; }
.btn-ih {
  background: linear-gradient(135deg, var(--ih-blue), var(--ih-cyan));
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 12px 30px;
  box-shadow: 0 8px 22px rgba(0,198,255,0.35);
}
.btn-ih:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,198,255,0.45); }
.btn-outline-ih {
  background: #fff;
  color: var(--ih-blue);
  border: 1.5px solid var(--ih-blue);
  border-radius: 10px;
  font-weight: 600;
  padding: 10px 24px;
}
.btn-outline-ih:hover { background: rgba(11,108,255,0.06); color: var(--ih-blue); }
.hero-img img {
  width: 100%;
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(0,0,0,0.3);
  object-fit: cover;
  max-height: 340px;
}

/* ---------- 区块 ---------- */
.ih-section { padding: 44px 0 8px; }
.ih-h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--ih-deep);
  margin-bottom: 4px;
}
.ih-h2 span {
  font-size: 12px;
  color: var(--ih-muted);
  letter-spacing: 3px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: 4px;
}
.ih-rule {
  width: 56px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ih-blue), var(--ih-cyan));
  margin: 10px 0 22px;
}

/* ---------- 店铺卡片 ---------- */
.store-card {
  background: var(--ih-card);
  border: 1px solid var(--ih-border);
  border-radius: 16px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  height: 100%;
  transition: all .25s ease;
}
.store-card:hover {
  border-color: var(--ih-blue);
  box-shadow: 0 10px 26px rgba(11,108,255,0.14);
  transform: translateY(-4px);
}
.store-logo {
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eaf2ff, #d7e7ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--ih-blue);
  font-size: 18px;
}
.store-name { font-size: 13px; font-weight: 700; color: var(--ih-text); line-height: 1.4; }
.store-count { font-size: 11px; color: var(--ih-muted); margin-top: 4px; }

/* ---------- 分类入口 ---------- */
.cat-card {
  background: var(--ih-card);
  border: 1px solid var(--ih-border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  height: 100%;
  transition: all .25s ease;
}
.cat-card:hover {
  border-color: var(--ih-blue);
  box-shadow: 0 10px 26px rgba(11,108,255,0.14);
  transform: translateY(-4px);
}
.cat-card img { height: 130px; object-fit: cover; width: 100%; }
.cat-card .cat-body { padding: 12px; }
.cat-card .cat-name { font-weight: 700; font-size: 15px; color: var(--ih-deep); }
.cat-card .cat-cnt { font-size: 11px; color: var(--ih-muted); }

/* ---------- 商品卡片 ---------- */
.ih-card {
  border: 1px solid var(--ih-border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: var(--ih-card);
  transition: all .25s ease;
}
.ih-card:hover {
  border-color: var(--ih-blue);
  box-shadow: 0 14px 32px rgba(11,108,255,0.14);
  transform: translateY(-4px);
}
.ih-card-img { position: relative; background: #f0f5ff; }
.ih-card-img img { height: 200px; object-fit: cover; width: 100%; }
.ih-off-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, var(--ih-red), #ff6b6b);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
}
.ih-store-badge {
  display: inline-block;
  background: #eaf2ff;
  color: var(--ih-blue);
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 8px;
  margin-bottom: 8px;
}
.ih-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ih-text);
  line-height: 1.45;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ih-price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.ih-price { font-size: 20px; font-weight: 800; color: var(--ih-red); }
.ih-price small { font-size: 12px; }
.ih-orig { font-size: 12px; color: var(--ih-muted); text-decoration: line-through; }
.ih-sales { margin-left: auto; font-size: 11px; color: var(--ih-muted); }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  background: #fff;
  border: 1px solid var(--ih-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 22px;
}
.filter-group { margin-bottom: 12px; }
.filter-label { font-size: 12px; color: var(--ih-muted); margin-bottom: 6px; font-weight: 600; }
.filter-group .btn-sm {
  font-size: 12px;
  border-radius: 20px;
  border: 1px solid var(--ih-border);
  color: var(--ih-text);
  background: #fff;
  margin: 0 6px 6px 0;
}
.filter-group .btn-sm:hover { border-color: var(--ih-blue); color: var(--ih-blue); }
.filter-group .btn-sm.active {
  background: linear-gradient(135deg, var(--ih-blue), var(--ih-cyan));
  color: #fff;
  border-color: transparent;
}
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=text] {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--ih-border);
  border-radius: 10px;
  padding: 9px 14px;
}
.toolbar select {
  border: 1px solid var(--ih-border);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
}
.result-count { font-size: 13px; color: var(--ih-muted); margin-bottom: 14px; }

/* ---------- 详情页 ---------- */
.detail-wrap { padding: 36px 0; }
.detail-img {
  background: #fff;
  border: 1px solid var(--ih-border);
  border-radius: 20px;
  overflow: hidden;
}
.detail-img img { width: 100%; object-fit: cover; }
.detail-info { padding: 8px 8px 8px 24px; }
.detail-info h1 { font-size: 26px; font-weight: 800; color: var(--ih-deep); line-height: 1.4; }
.detail-price-row { display: flex; align-items: baseline; gap: 12px; margin: 16px 0; }
.detail-price { font-size: 34px; font-weight: 800; color: var(--ih-red); }
.detail-price small { font-size: 18px; }
.detail-orig { font-size: 15px; color: var(--ih-muted); text-decoration: line-through; }
.detail-sales { font-size: 13px; color: var(--ih-muted); margin-left: auto; }
.detail-service {
  display: flex;
  gap: 18px;
  background: #f0f7ff;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--ih-blue);
  margin: 18px 0;
}
.qty-box { display: flex; align-items: center; gap: 14px; margin: 20px 0; }
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ih-border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.qty-stepper button {
  width: 38px;
  height: 38px;
  border: none;
  background: #f2f6ff;
  font-size: 18px;
  color: var(--ih-deep);
}
.qty-stepper span { width: 44px; text-align: center; font-weight: 700; }
.detail-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.store-panel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eaf2ff;
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 12px;
}
.store-panel .store-logo { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; margin: 0; }

/* ---------- 购物车 ---------- */
.cart-wrap { padding: 30px 0 60px; }
.cart-item {
  background: #fff;
  border: 1px solid var(--ih-border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.cart-item img { width: 90px; height: 90px; object-fit: cover; border-radius: 12px; background: #f0f5ff; }
.cart-item .ci-info { flex: 1; }
.cart-item .ci-title { font-weight: 600; font-size: 14px; line-height: 1.4; }
.cart-item .ci-store { font-size: 11px; color: var(--ih-muted); margin-top: 4px; }
.cart-item .ci-price { color: var(--ih-red); font-weight: 700; }
.cart-item .ci-price small { font-size: 11px; }
.cart-summary-card {
  background: #fff;
  border: 1px solid var(--ih-border);
  border-radius: 16px;
  padding: 20px;
  position: sticky;
  top: 90px;
}
.cart-summary-card h5 { font-weight: 800; color: var(--ih-deep); }
.sum-row { display: flex; justify-content: space-between; font-size: 14px; margin: 8px 0; color: var(--ih-muted); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; margin: 14px 0 16px; }
.sum-total .v { font-size: 30px; font-weight: 800; color: var(--ih-red); }
.sum-total .v small { font-size: 15px; }
.cart-empty { text-align: center; padding: 80px 0; color: var(--ih-muted); }
.cart-empty .big { font-size: 42px; font-weight: 800; color: #c9d8f2; margin-bottom: 12px; }

/* ---------- 结算页 ---------- */
.checkout-wrap { padding: 30px 0 60px; }
.checkout-box {
  background: #fff;
  border: 1px solid var(--ih-border);
  border-radius: 18px;
  padding: 24px;
}
.chk-title { font-size: 18px; font-weight: 800; color: var(--ih-deep); margin-bottom: 18px; }
.chk-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ih-blue), var(--ih-cyan));
  margin-top: 8px;
}
.pay-option {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--ih-border);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all .2s;
}
.pay-option.selected { border-color: var(--ih-blue); background: rgba(11,108,255,0.04); }
.pay-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #c4d2ec;
  position: relative;
  flex-shrink: 0;
}
.pay-option.selected .pay-radio { border-color: var(--ih-blue); }
.pay-option.selected .pay-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ih-blue), var(--ih-cyan));
}
.pay-name { font-weight: 700; font-size: 15px; }
.pay-desc { font-size: 12px; color: var(--ih-muted); }

/* 支付宝 CSS 徽标：蓝色渐变底 + 白色「支」字 */
.alipay-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1677ff, #69b1ff);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(22,119,255,0.35);
}
.pay-tip { font-size: 12px; color: var(--ih-muted); margin-top: 6px; }

.order-list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--ih-border); }
.order-list-item img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; }
.order-list-item .ol-name { flex: 1; font-size: 13px; font-weight: 600; }
.order-list-item .ol-qty { color: var(--ih-muted); font-size: 13px; }
.order-list-item .ol-price { color: var(--ih-red); font-weight: 700; }
.order-total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 8px; font-weight: 800; color: var(--ih-deep); }
.order-total .v { font-size: 30px; color: var(--ih-red); }

.success-wrap { text-align: center; padding: 80px 0; }
.success-mark {
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #fff;
  font-size: 44px;
  line-height: 84px;
  box-shadow: 0 14px 34px rgba(16,185,129,0.35);
}

/* ---------- Footer ---------- */
.ih-footer {
  background: #062a66;
  color: #b7c8ea;
  margin-top: 60px;
  padding: 44px 0 0;
}
.ih-footer h6 { color: #fff; font-weight: 700; margin-bottom: 14px; }
.ih-footer a, .ih-footer span { display: block; color: #b7c8ea; font-size: 13px; margin-bottom: 8px; text-decoration: none; }
.ih-footer a:hover { color: #7ff3ff; }
.ih-footer .fb { font-size: 13px; line-height: 1.8; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 32px;
  padding: 16px 0;
  text-align: center;
  font-size: 12px;
  color: #7d93c2;
}

/* ---------- Toast ---------- */
.ih-toast {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%) translateY(30px);
  background: #062a66;
  color: #fff;
  padding: 12px 26px;
  border-radius: 30px;
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(6,42,102,0.35);
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
  z-index: 2000;
}
.ih-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 767px) {
  .ih-hero h1 { font-size: 30px; }
  .detail-info { padding: 18px 0; }
  .ih-card-img img { height: 160px; }
}

/* ============ 会员登录/注册 ============ */
.ih-auth-item { display: flex; align-items: center; gap: 8px; padding-left: 6px; }
.ih-auth-btn { display: inline-block; padding: 5px 14px; border: 1px solid var(--ih-accent, #2f8f6b); border-radius: 20px; color: var(--ih-accent, #2f8f6b); font-size: 13px; text-decoration: none; white-space: nowrap; }
.ih-auth-btn:hover { background: var(--ih-accent, #2f8f6b); color: #fff; }
.ih-user-chip { color: var(--ih-accent, #2f8f6b); font-size: 13px; font-weight: 600; white-space: nowrap; }
.auth-modal { position: fixed; inset: 0; z-index: 1080; display: none; align-items: center; justify-content: center; }
.auth-modal.show { display: flex; }
.auth-mask { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.auth-box { position: relative; width: 380px; max-width: 92vw; background: #fff; border-radius: 14px; padding: 28px 26px 22px; box-shadow: 0 16px 50px rgba(0,0,0,.28); }
.auth-close { position: absolute; top: 12px; right: 16px; border: none; background: none; font-size: 22px; color: #999; cursor: pointer; line-height: 1; }
.auth-box h4 { margin: 0 0 4px; font-size: 20px; color: #222; }
.auth-sub { margin: 0 0 14px; font-size: 12px; color: #999; }
.auth-label { display: block; margin: 12px 0 4px; font-size: 13px; color: #555; }
.auth-input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; }
.auth-input:focus { border-color: var(--ih-accent, #2f8f6b); }
.auth-err { min-height: 18px; margin-top: 8px; font-size: 12px; color: #e5484d; }
.auth-submit { width: 100%; padding: 11px 0; border: none; border-radius: 8px; background: var(--ih-accent, #2f8f6b); color: #fff; font-size: 15px; cursor: pointer; }
.auth-submit:hover { opacity: .9; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 13px; }
.auth-switch a { color: var(--ih-accent, #2f8f6b); text-decoration: none; }


/* ===== 图片对齐强化 ===== */
img { display: block; }
.ih-card-img { background: #f0f5ff; overflow: hidden; }
.ih-card-img img { width: 100%; height: 160px; object-fit: cover; object-position: center; display: block; }
.cat-card { overflow: hidden; }
.cat-card img { width: 100%; height: 130px; object-fit: cover; object-position: center; display: block; }
.store-card { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.store-logo { flex-shrink: 0; }
.hero-img img { width: 100%; height: 340px; object-fit: cover; object-position: center; display: block; }
.product-card .p-img { display: flex; align-items: center; justify-content: center; }
.ih-grid, .ih-row { align-items: stretch; }
.ih-card { display: flex; flex-direction: column; }
.ih-card .ih-card-body { flex: 1; }
