/* ============================================================
   新大配件 · 移动端电商风 H5 通用组件
   仅在手机（<=520px）生效；桌面端隐藏，不影响 PC 布局
   ============================================================ */
@media (max-width: 520px) {
  body { padding-bottom: 60px; }
  /* 隐藏页面原有的并排语言切换（已被地球图标下拉替代） */
  .m-hide-lang { display: none !important; }
  /* 浮动 WhatsApp 询价按钮（每页显示，右下角，避开底部导航） */
  .float-whatsapp { display: grid !important; top: auto !important; bottom: 72px !important; right: 14px !important; transform: none !important; width: 50px !important; height: 50px !important; font-size: 26px !important; }
  /* 详情页已有底部询价栏，不重复显示浮动按钮 */
  body.m-has-actionbar .float-whatsapp { display: none !important; }

  /* ---------- 底部固定导航栏（5 项） ---------- */
  .m-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: #0b0d10; border-top: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .3);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .m-tabbar .m-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; height: 56px; min-width: 0; color: #9aa1a9; font-size: 10px; font-weight: 800;
  }
  .m-tabbar .m-tab i { font-size: 19px; line-height: 1; }
  .m-tabbar .m-tab span { white-space: nowrap; }
  .m-tabbar .m-tab.active { color: #ffc400; }
  .m-tabbar .m-tab:active { background: rgba(255, 255, 255, .05); }

  /* ---------- 详情页底部固定操作栏（电话 + 立即询价） ---------- */
  .m-actionbar {
    position: fixed; left: 0; right: 0; bottom: 60px; z-index: 94;
    display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px;
    padding: 9px 14px; background: rgba(11, 13, 16, .97);
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  .m-actionbar a {
    height: 46px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    gap: 8px; font-size: 15px; font-weight: 900;
  }
  .m-actionbar a i { font-size: 18px; }
  .m-actionbar .ab-call { border: 1px solid #ffc400; color: #ffc400; background: transparent; }
  .m-actionbar .ab-inquiry { background: #25d366; color: #fff; box-shadow: 0 6px 16px rgba(37, 211, 102, .3); }
  /* 有操作栏的页面，底部多留出空间 */
  body.m-has-actionbar { padding-bottom: 124px; }
}

/* 桌面端彻底隐藏移动组件 */
@media (min-width: 521px) {
  .m-tabbar, .m-actionbar { display: none !important; }
}

/* ============================================================
   移动端电商首页（内容+布局重构）· 仅手机显示
   ============================================================ */
.m-home { display: none; }
@media (max-width: 520px) {
  /* 手机端隐藏桌面版整套内容，显示电商首页（仅限首页 body.m-home-page） */
  body.m-home-page > .topbar, body.m-home-page > main, body.m-home-page > .footer { display: none !important; }
  body.m-home-page .m-home { display: block; background: #f5f6f8; }

  /* 顶部搜索栏（吸顶） */
  .mh-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #0b0d10; }
  .mh-top .mh-logo { height: 30px; width: auto; flex: 0 0 auto; }
  .mh-search { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; background: rgba(255,255,255,.12); border-radius: 999px; color: #cfd3d8; }
  .mh-search i { font-size: 15px; }
  .mh-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: #fff; font-size: 13px; outline: none; }
  .mh-search input::placeholder { color: #9aa1a9; }
  .mh-lang { flex: 0 0 auto; position: relative; }
  .mh-lang .mh-lang-btn { height: 34px; display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: #fff; cursor: pointer; padding: 0 4px; }
  .mh-lang .mh-lang-btn i { font-size: 18px; }
  .mh-lang .mh-lang-label { font-size: 13px; font-weight: 800; white-space: nowrap; }
  .mh-lang .mh-lang-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 122px; background: #14171b; border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .42); padding: 6px; opacity: 0; pointer-events: none; transform: translateY(-6px); transition: .16s ease; z-index: 60; }
  .mh-lang.open .mh-lang-menu { opacity: 1; pointer-events: auto; transform: none; }
  .mh-lang .mh-lang-menu a { display: block; padding: 9px 12px; border-radius: 6px; color: #e8eaed; font-size: 14px; font-weight: 700; }
  .mh-lang .mh-lang-menu a.active { background: rgba(255, 196, 0, .16); color: #ffc400; }

  /* Banner */
  .mh-banner { position: relative; margin: 10px 12px 0; border-radius: 14px; overflow: hidden; aspect-ratio: 2.1/1; background: #0b0d10; }
  .mh-banner img { width: 100%; height: 100%; object-fit: cover; }
  .mh-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,6,8,.92), rgba(5,6,8,.4) 70%, transparent); }
  .mh-banner-txt { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 1; }
  .mh-banner-txt strong { display: block; color: #fff; font-size: 18px; font-weight: 950; line-height: 1.2; max-width: 200px; }
  .mh-banner-txt span { display: block; margin-top: 6px; color: var(--gold, #ffc400); font-size: 12px; font-weight: 800; }

  /* 分类九宫格 */
  .mh-block { margin: 10px 12px 0; background: #fff; border-radius: 14px; padding: 14px 8px 6px; }
  .mh-cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 2px; }
  .mh-cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px; text-align: center; }
  .mh-cat .ic { width: 52px; height: 52px; border-radius: 14px; background: #f3f4f6; display: grid; place-items: center; overflow: hidden; }
  .mh-cat .ic img { width: 100%; height: 100%; object-fit: cover; }
  .mh-cat .ic i { font-size: 24px; color: #c8920f; }
  .mh-cat span { font-size: 11px; line-height: 1.2; color: #2f343a; font-weight: 700; }

  /* 区块标题 */
  .mh-sec { margin: 10px 12px 0; }
  .mh-sec-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 2px 10px; }
  .mh-sec-head h2 { margin: 0; font-size: 17px; font-weight: 950; color: #15171a; }
  .mh-sec-head a { font-size: 12px; color: #8a9099; font-weight: 700; }

  /* 商品卡片流（2 列） */
  .mh-prod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .mh-prod { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
  .mh-prod .img { aspect-ratio: 1.1/1; background: #f3f4f6; }
  .mh-prod .img img { width: 100%; height: 100%; object-fit: cover; }
  .mh-prod .info { padding: 8px 9px 10px; }
  .mh-prod .info h3 { margin: 0; font-size: 13px; font-weight: 900; color: #15171a; line-height: 1.3; }
  .mh-prod .info .m { margin-top: 3px; font-size: 11px; color: #8a9099; font-weight: 700; }
  .mh-prod .info .tag { display: inline-block; margin-top: 7px; padding: 2px 8px; border-radius: 4px; background: rgba(255,196,0,.16); color: #b07d00; font-size: 10px; font-weight: 800; }

  /* 实力数据 */
  .mh-stats { margin: 12px 12px 18px; display: grid; grid-template-columns: repeat(4, 1fr); background: #0b0d10; border-radius: 14px; padding: 16px 6px; }
  .mh-stats > div { text-align: center; }
  .mh-stats strong { display: block; color: var(--gold, #ffc400); font-size: 19px; font-weight: 950; }
  .mh-stats span { display: block; margin-top: 4px; color: #c7cbd0; font-size: 10px; font-weight: 700; }
}

/* ============================================================
   详情页移动端顶部返回栏（电商标准：← 返回 + 标题）
   ============================================================ */
.m-detail-top { display: none; }
@media (max-width: 520px) {
  /* 详情页移动端用返回栏替换桌面导航 */
  body.m-has-actionbar .top-nav { display: none !important; }
  .m-detail-top {
    display: flex; align-items: center; gap: 6px;
    position: sticky; top: 0; z-index: 50; height: 48px; padding: 0 6px;
    background: #0b0d10; border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
  .m-detail-top .m-back { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; font-size: 25px; }
  .m-detail-top .m-back-title { color: #fff; font-size: 16px; font-weight: 900; }
  .m-detail-top .m-back-home { margin-left: auto; width: 40px; height: 40px; display: grid; place-items: center; color: #fff; font-size: 21px; }
}
