/* ========================================================================
   home-v2/style.css — 自定义首页 v2 样式
   布局：促销条 + 主导航 + 搜索框 + 9 分类网格(3×3) + 热门产品 + 浮动侧栏
   颜色：主色 #000 / 辅 #e60012（红色促销）/ 灰 #f5f5f5
   注：按用户要求已移除顶部 App 下载条
======================================================================== */

:root {
  --hv2-primary: #000;
  --hv2-accent: #e60012;
  --hv2-bg-light: #f5f5f5;
  --hv2-border: #e5e5e5;
  --hv2-text: #333;
  --hv2-text-light: #666;
  --hv2-text-muted: #999;
  --hv2-radius: 4px;
}

.hv2-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--hv2-text);
  background: #fff;
}

/* ========== ① 主导航 ========== */
.hv2-header {
  background: #fff;
  border-bottom: 1px solid var(--hv2-border);
  position: relative;
  z-index: 100;
}
.hv2-header .hv2-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;                         /* logo 真正贴左边 0px */
  display: flex; align-items: center;
  height: 70px;
}
/* mobile 端 nav flex-wrap 后让 header 自动撑开 */
@media (max-width: 991px) {
  .hv2-header .hv2-container {
    height: auto !important;
    flex-direction: column !important;       /* logo / nav / icons 竖直堆叠 */
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    row-gap: 10px;
    padding: 12px;
  }
  .hv2-logo {
    flex: 0 0 auto;
    align-self: center;           /* logo 居中 */
  }
  .hv2-nav { width: 100%; flex: 0 0 100%; }
  .hv2-header-icons { display: none; }     /* 手机端：纯展示站点无登录/购物车图标，隐藏空 div */
}
.hv2-logo {
  display: flex; align-items: center;
  text-decoration: none; color: var(--hv2-primary);
  font-size: 24px; font-weight: 700;
  letter-spacing: 1px;
  flex: 0 0 auto;             /* logo 固定宽度，紧贴左边 */
}
.hv2-logo img { max-height: 50px; margin-right: 10px; }
.hv2-nav {
  display: flex;
  list-style: none;
  margin: 0 auto;              /* nav 真居中：撑开左右外边距 */
  padding: 0;
  gap: 4px;
  flex: 0 1 auto;
  justify-content: center;     /* nav 内部内容居中 */
  flex-wrap: nowrap;
  min-width: 0;
}
.hv2-nav li { list-style: none; position: relative; }
.hv2-nav a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  color: var(--hv2-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--hv2-radius);
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
}
.hv2-nav a::after {
  content: "\25BE";
  font-size: 9px;
  line-height: 1;
  color: var(--hv2-text);
  opacity: 0.55;
  transition: opacity 0.2s, color 0.2s;
  margin-left: 1px;
}
.hv2-nav a:hover, .hv2-nav a.active {
  color: var(--hv2-accent);
  background: #fef5f6;
}
.hv2-nav a:hover::after, .hv2-nav a.active::after {
  opacity: 1;
  color: var(--hv2-accent);
}
.hv2-nav a.active::after {
  /* 激活态时伪元素已被 a::after 占用，底部高亮改用 box-shadow */
  position: absolute;
  content: "";
  bottom: -22px;
  left: 10px; right: 10px;
  height: 2px;
  background: var(--hv2-accent);
  z-index: 1;
}
.hv2-header-icons {
  display: flex; align-items: center; gap: 14px;
  margin-left: auto;          /* icons 推到最右边 */
}
.hv2-header-icons a {
  color: var(--hv2-text);
  text-decoration: none;
  position: relative;
  font-size: 18px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.hv2-header-icons a:hover { background: var(--hv2-bg-light); color: var(--hv2-accent); }
.hv2-header-icons .hv2-cart-count {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--hv2-accent);
  color: #fff;
  font-size: 10px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ========== ② 搜索框 ========== */
.hv2-search {
  background: #fff;
  padding: 40px 0 28px;
}
.hv2-search .hv2-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 15px;
}
.hv2-search-box {
  display: flex;
  border: 2px solid var(--hv2-primary);
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
}
.hv2-search-select {
  background: #fff;
  border: none;
  border-right: 1px solid var(--hv2-border);
  padding: 9px 16px;
  font-size: 15px;
  color: var(--hv2-text);
  cursor: pointer;
  outline: none;
  min-width: 110px;
  line-height: 1.2;
}
.hv2-search-input {
  flex: 1;
  border: none;
  padding: 9px 16px;
  font-size: 15px;
  outline: none;
  line-height: 1.2;
  min-width: 0;
}
.hv2-search-btn {
  background: var(--hv2-primary);
  color: #fff;
  border: none;
  padding: 9px 28px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.hv2-search-btn:hover { background: #333; }

/* ========== ③ 分类快捷入口（4×3 横排，12 格；当前 9 分类 + 3 空位） ========== */
.hv2-section {
  padding: 36px 0 20px;
}
.hv2-section-title {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--hv2-text);
  margin: 0 0 28px;
  position: relative;
}
.hv2-section-title::before, .hv2-section-title::after {
  content: "";
  display: inline-block;
  width: 40px; height: 1px;
  background: var(--hv2-border);
  vertical-align: middle;
  margin: 0 16px;
}
.hv2-cats {
  max-width: 980px;             /* 收窄，让 3 列更紧凑 */
  margin: 0 auto;
  padding: 0 15px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* 四列横排 */
  gap: 18px 14px;
}
.hv2-cat {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none;
  color: var(--hv2-text);
  padding: 8px 6px;
  border-radius: 6px;
  transition: all 0.25s;
  background: #fff;
}
.hv2-cat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.hv2-cat-img {
  width: 92px; height: 92px;            /* 小一点的方形 */
  border-radius: 0;                          /* 直角黑框 */
  overflow: hidden;
  border: 2px solid #000;
  box-shadow: none;
  background: var(--hv2-bg-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
  position: relative;
}
.hv2-cat-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hv2-cat-img.hv2-empty {
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  color: #ccc;
  font-size: 26px;
  font-weight: 300;
}
.hv2-cat-name {
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}
.hv2-cat-sub {
  font-size: 10px;
  color: var(--hv2-text-muted);
  text-align: center;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hv2-cat-count {
  font-size: 11px;
  color: #a0a0a0;
  text-align: center;
  margin-top: 3px;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

/* ========== ④ 热门产品 ========== */
.hv2-products {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.hv2-product {
  display: flex; flex-direction: column;
  text-decoration: none;
  color: var(--hv2-text);
  background: #fff;
  border: 1px solid var(--hv2-border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.25s;
}
.hv2-product:hover {
  border-color: var(--hv2-accent);
  box-shadow: 0 4px 16px rgba(230,0,18,0.1);
  transform: translateY(-2px);
}
.hv2-product-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--hv2-bg-light);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.hv2-product-img img { width: 100%; height: 100%; object-fit: cover; }
.hv2-product-body { padding: 12px; }
.hv2-product-name {
  font-size: 14px;
  color: var(--hv2-text);
  margin: 0 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hv2-product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--hv2-accent);
}
.hv2-product-price-currency { font-size: 12px; margin-right: 2px; }

/* ========== 响应式 ========== */
/* 平板：导航精简为多行换行展示、网格保持 3 列 */
@media (max-width: 991px) {
  .hv2-nav {
    display: flex !important;
    flex-direction: row !important;       /* 强制水平排列 */
    flex-wrap: wrap !important;           /* 强制换行 */
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;               /* 强制占满整行 */
    flex: 0 0 100% !important;            /* 强制占满交叉轴 */
    margin: 0 !important;                 /* 强制无外边距 */
    gap: 6px !important;
    padding: 8px 4px 12px !important;
    background: #fafafa !important;
    border-top: 1px solid #eee !important;
    box-sizing: border-box !important;
  }
  .hv2-nav li { margin: 0; }
  .hv2-nav a {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    background: #fff;              /* 每个分类白底小方块 */
    border: 1px solid #eee;
  }
  .hv2-nav a.active {
    background: #e60012;
    color: #fff;
    border-color: #e60012;
  }
  /* 关键：mobile 端隐藏 active 分类下方的红下划线（避免飘到 nav 块外面变奇怪短线） */
  .hv2-nav a.active::after {
    display: none !important;
    content: none !important;
  }
  /* mobile 端也隐藏 hover 时的红下划线 */
  .hv2-nav a:hover::after {
    display: none !important;
    content: none !important;
  }
  .hv2-nav a::after { content: ""; }   /* 去掉手机端的倒三角箭头 */
  .hv2-cats { max-width: 720px; }
  .hv2-products { grid-template-columns: repeat(2, 1fr); }
}
/* 手机：保持 3 列横排，图片再小一点 */
@media (max-width: 575px) {
  .hv2-cats {
    grid-template-columns: repeat(4, 1fr);    /* 手机端也保持 4 列横排 */
    gap: 12px 8px;
    max-width: 100%;
  }
  .hv2-cat { padding: 6px 4px; }
  .hv2-cat-img {
    width: 68px; height: 68px;
    border-radius: 4px;
  }
  .hv2-cat-name { font-size: 12px; }
  .hv2-cat-sub { display: none; }
  .hv2-products { grid-template-columns: repeat(2, 1fr); }
}
/* ====================================================================
   首页 hv2 模式：仅隐藏默认 BeikeShop 的主 header + 灰色促销条，
   保留 .top-wrap（默认语言/货币下拉在左上角）继续生效
==================================================================== */
body.hv2-page .header-content,
body.hv2-page .header-mobile,
body.hv2-page .top-bar-promo,
body.hv2-page .top-bar-app {
  display: none !important;
}

/* 让 v2-header 直接接在默认 top-wrap 下，不留白 */
body.hv2-page .top-wrap { margin-bottom: 0; }

/* ========== 默认 .top-wrap 微调：让原生语言/货币下拉更紧凑 ========== */
body.hv2-page .top-wrap { font-size: 12px; }

/* ========== ⑤ 分类展示 v2：每个分类一行（名称 + 4 张正方形图） ========== */
.hv2-catgrids {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 15px;
}
.hv2-catblock { margin-bottom: 30px; }
.hv2-catblock:last-child { margin-bottom: 0; }
.hv2-catblock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hv2-border);
}
.hv2-catblock-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--hv2-text);
  text-decoration: none;
}
.hv2-catblock-title:hover { color: var(--hv2-accent); }
.hv2-catblock-more {
  font-size: 13px;
  color: var(--hv2-text-light);
  text-decoration: none;
}
.hv2-catblock-more:hover { color: var(--hv2-accent); }

.hv2-squares {
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* 桌面与手机均为 4 列，保证手机端一眼看到 4 张 */
  gap: 14px;
}
.hv2-sq {
  display: block;
  aspect-ratio: 1 / 1;                       /* 正方形 */
  border-radius: var(--hv2-radius);
  overflow: hidden;
  background: var(--hv2-bg-light);
  border: 1px solid var(--hv2-border);
  text-decoration: none;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.hv2-sq:hover {
  border-color: var(--hv2-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.hv2-sq img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hv2-sq-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f7f7f7 0%, #ececec 100%);
  color: #bbb;
}

/* 手机端：4 列不变，间距收紧，标题略小 */
@media (max-width: 575px) {
  .hv2-catgrids { padding: 0 10px; }
  .hv2-squares { gap: 8px; }
  .hv2-catblock { margin-bottom: 24px; }
  .hv2-catblock-head { margin-bottom: 10px; padding-bottom: 6px; }
  .hv2-catblock-title { font-size: 16px; }
}

/* 空分类占位（不可点击） */
.hv2-cat-empty { cursor: default; pointer-events: none; opacity: 0.65; }
/* 分类图块区域与上方快捷入口间距收紧 */
.hv2-section-catrows { padding-top: 10px; }

/* ====================================================================
   分类块标题区改为“居中、上下排列”：分类名在上，查看全部在下
==================================================================== */
.hv2-catblock-head {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}
.hv2-catblock-title { text-align: center; }
.hv2-catblock-more { margin-top: 2px; }

/* ====================================================================
   查看全部：移到图片下方，做成带边框的胶囊按钮
==================================================================== */
.hv2-catblock-more {
  display: block;
  width: fit-content;
  margin: 14px auto 0;
  padding: 6px 20px;
  border: 1px solid var(--hv2-border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--hv2-text-light);
  text-decoration: none;
  background: #fff;
  transition: all .25s;
}
.hv2-catblock-more:hover {
  border-color: var(--hv2-accent);
  color: #fff;
  background: var(--hv2-accent);
}
@media (max-width: 575px) {
  .hv2-catblock-more { margin-top: 12px; padding: 5px 16px; font-size: 12px; }
}


/* ================================================================
   2026-07-31 改造：.hv2-sq 由"4 张正方形占位大块"改为"产品卡"
   保留原 .hv2-squares grid 4 列布局；新增 .hv2-sq-img/-name/-price/-empty
   ================================================================ */
.hv2-sq {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  aspect-ratio: auto;          /* 覆盖原 1/1，由 .hv2-sq-img 自带 1/1 */
}
.hv2-sq:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  border-color: #ddd;
}
.hv2-sq-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hv2-sq-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hv2-sq-name {
  font-size: 12px;
  line-height: 1.35;
  padding: 7px 8px 2px;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.7em;
}
.hv2-sq-price {
  font-size: 13px;
  font-weight: 600;
  color: #c8102e;
  padding: 0 8px 8px;
}
.hv2-sq-empty { opacity: .55; cursor: default; }
.hv2-sq-empty:hover { transform: none; box-shadow: none; border-color: #eee; }

@media (max-width: 575px) {
  .hv2-sq-name { font-size: 11px; padding: 5px 6px 1px; min-height: 2.3em; }
  .hv2-sq-price { font-size: 12px; padding: 0 6px 6px; }
}
/* ===== 实时访客数据展示 ===== */
.hv2-stats-section {
  margin-top: 20px;
}
.hv2-pulse-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: hv2-pulse 1.6s infinite;
}
@keyframes hv2-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.hv2-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 4px;
}
.hv2-stat-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 18px 14px 16px;
  text-align: center;
  transition: all 0.25s;
}
.hv2-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  border-color: #ddd;
}
.hv2-stat-icon {
  display: inline-flex;
  width: 44px; height: 44px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.hv2-stat-visitors .hv2-stat-icon { background: #ecfeff; color: #0891b2; }
.hv2-stat-views     .hv2-stat-icon { background: #f0fdf4; color: #16a34a; }
.hv2-stat-orders    .hv2-stat-icon { background: #fef3c7; color: #d97706; }
.hv2-stat-paid      .hv2-stat-icon { background: #ede9fe; color: #7c3aed; }
.hv2-stat-total     .hv2-stat-icon { background: #fff1f2; color: #e11d48; }
.hv2-stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: #1a1a1a;
  font-feature-settings: "tnum";
}
.hv2-stat-label {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}
@media (max-width: 767px) {
  .hv2-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .hv2-stat-card { padding: 14px 8px 12px; }
  .hv2-stat-value { font-size: 22px; }
  .hv2-stat-icon { width: 36px; height: 36px; }
  .hv2-stat-icon svg { width: 22px; height: 22px; }
}
@media (max-width: 380px) {
  .hv2-stats { grid-template-columns: 1fr; }
}


/* ================================================================
   2026-08-02 修复：移动端 .hv2-nav 类目链接偶发消失
   根因：BeikeShop 默认 header 的滚动 sticky JS 在 ≤768px 视口
   以 .header-mobile 作为目标，添加 .fixed 类（position:fixed;
   top:0; z-index:999）。hv2 页面虽然用 CSS 隐藏了 .header-mobile，
   但 JS 仍以 offset.top=0、outerHeight=0 运行——任意滚动即触发，
   持续插入 .header-content-placeholder 占位 div 并保持 fixed 类，
   干扰 hv2-nav 的渲染栈/位置。
   修复：强制隐藏该占位、确保 hv2-nav 始终可见。
   ================================================================ */
body.hv2-page .header-content-placeholder { display: none !important; }
body.hv2-page .hv2-nav {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 101 !important;
}

/* 分类页品牌导航条 */
.brand-nav-wrap{margin:18px 0 8px}
.brand-nav{display:flex;gap:10px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin;padding:6px 2px;flex-wrap:nowrap}
.brand-nav::-webkit-scrollbar{height:6px}
.brand-nav::-webkit-scrollbar-thumb{background:#d0d0d0;border-radius:3px}
.brand-item{flex:0 0 auto;display:flex;align-items:center;gap:6px;padding:6px 14px;border:1px solid #e5e7eb;border-radius:999px;color:#333;text-decoration:none;white-space:nowrap;background:#fff;transition:.15s}
.brand-item:hover{border-color:#0d6efd;color:#0d6efd;text-decoration:none}
.brand-item.active{background:#0d6efd;border-color:#0d6efd;color:#fff}
.brand-item .brand-logo{width:22px;height:22px;border-radius:4px;object-fit:contain}


/* === mobile 菜单抽屉窄化 + chip 样式（v20260802-2140） === */
#offcanvas-mobile-menu {
  width: 50vw !important;
  max-width: 200px !important;
  min-width: 170px !important;
}
#offcanvas-mobile-menu .offcanvas-header { padding: 10px 12px; }
#offcanvas-mobile-menu .offcanvas-title { font-size: 14px; font-weight: 600; }
#offcanvas-mobile-menu .mobile-menu-wrap { padding: 8px 10px; }
#offcanvas-mobile-menu .accordion,
#offcanvas-mobile-menu .accordion-item { background: transparent; border: 0; }
#offcanvas-mobile-menu .accordion-item { margin: 5px 0; }
#offcanvas-mobile-menu .nav-item-text { display: flex; }
#offcanvas-mobile-menu .nav-link {
  flex: 1;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid #333;
  border-radius: 999px;
  background: #fff;
  color: #222;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: .15s;
}
#offcanvas-mobile-menu .nav-link:hover,
#offcanvas-mobile-menu .nav-link:focus { background: #f5f5f5; color: #ff4757; border-color: #ff4757; outline: 0; }
#offcanvas-mobile-menu .accordion-item:first-child .nav-link { color: #ff4757; border-color: #ff4757; background: #fff5f5; }
#offcanvas-mobile-menu .accordion-item:first-child .nav-link:hover { background: #ffe5e8; }
