/* WanYang — mobile app-style UI (deployed 2026-11-29)
   只在 <=700px 生效；桌面端 (>=701px) 隐藏 App 结构，原站样式零影响。 */

/* ===== 桌面端：App 结构全部隐藏 ===== */
@media (min-width: 701px) {
  .m-topbar,
  .m-tabbar,
  .m-catalogue { display: none !important; }
}

/* ===== 手机端 ===== */
@media (max-width: 700px) {

  body.m-app { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }

  /* 隐藏桌面 chrome：顶部两条、页脚、大介绍区、桌面筛选表与结果区（首页/商品页由 App 视图替代） */
  body.m-app .b2b-utility,
  body.m-app .site-header,
  body.m-app [data-site-footer],
  body.m-app .wholesale-intro,
  body.m-app .wholesale-filter-section,
  body.m-app .wholesale-results { display: none !important; }

  /* 客服球、留言按钮上移到 tab 栏上方 */
  body.m-app .customer-support { bottom: 74px !important; }
  body.m-app .lead-widget-btn { bottom: 74px !important; }

  /* ---------- 顶部栏 ---------- */
  .m-topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    background: #fff;
    padding: 12px 14px 10px;
    box-shadow: 0 1px 0 #ececec;
  }
  /* 右上角语言切换：国旗按钮 + 下拉列表（对标参考站样式）；桌面端随 .m-topbar 一起隐藏 */
  .m-lang-wrap { position: absolute; right: 12px; top: 12px; z-index: 95; }
  .m-lang-toggle {
    width: 40px;
    height: 32px;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .m-lang-toggle img { width: 26px; height: 19px; object-fit: cover; border-radius: 2px; }
  .m-lang-menu {
    position: absolute;
    right: 0;
    top: 38px;
    width: 190px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
    padding: 6px 0;
    z-index: 96;
    direction: ltr; /* 阿拉伯语 RTL 时语言列表仍保持左对齐，避免整块镜像 */
  }
  .m-lang-menu[hidden] { display: none !important; }
  .m-lang-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px;
    border: 0;
    background: none;
    font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 13px;
    color: #333;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .m-lang-opt img { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; flex: 0 0 auto; }
  .m-lang-opt span { flex: 1; }
  .m-lang-opt i { color: #b5b5b5; font-style: normal; font-size: 12px; }
  .m-lang-opt:active { background: #f5f5f5; }
  .m-lang-opt.is-active { background: #f7f7f7; }
  .m-lang-opt.is-active span { font-weight: 600; }
  .m-brand {
    display: block;
    text-align: center;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .16em;
    color: #1c1c1c;
    text-decoration: none;
  }
  .m-brand span {
    display: block;
    margin-top: 3px;
    font-family: Arial, sans-serif;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: #9a9a9a;
  }
  .m-search { display: flex; margin-top: 10px; }
  .m-search input {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1px solid #e3e3e3;
    border-right: 0;
    border-radius: 19px 0 0 19px;
    background: #f7f7f7;
    padding: 0 14px;
    font-size: 14px;
    color: #333;
    -webkit-appearance: none;
    appearance: none;
  }
  .m-search input::placeholder { color: #b9b5af; }
  .m-search input:focus { outline: none; border-color: #d9363b; background: #fff; }
  .m-search button {
    width: 44px;
    border: 1px solid #d9363b;
    border-radius: 0 19px 19px 0;
    background: #d9363b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .m-search svg { width: 18px; height: 18px; }

  /* ---------- 底部 tab 栏 ---------- */
  .m-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .m-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 56px;
    text-decoration: none;
    color: #666;
    font-size: 11px;
  }
  .m-tab svg { width: 22px; height: 22px; }
  .m-tab.is-active { color: #d9363b; }

  /* ---------- 首页 ---------- */
  .m-catalogue { padding: 12px 12px 26px; background: #fff; min-height: 40vh; }
  .m-catalogue.m-shoppage { padding: 0; background: #f4f4f4; }

  .m-brandcard {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 16px 14px;
    margin-bottom: 12px;
  }
  .m-brandcard h2 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #1c1c1c;
    text-align: center;
  }
  .m-brandcard p {
    margin: 0 0 12px;
    font-size: 12.5px;
    line-height: 1.65;
    color: #777;
    text-align: center;
  }
  .m-brandcard-actions { display: flex; flex-direction: column; gap: 8px; }
  .m-quote-btn {
    display: block;
    text-align: center;
    background: #d9363b;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 11px 12px;
    border-radius: 8px;
    text-decoration: none;
  }
  .m-wa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #d9363b;
    color: #d9363b;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    background: #fff;
  }
  .m-wa-btn svg { width: 16px; height: 16px; }

  /* 首页商品卡片（图左文右，文字居中） */
  .m-card {
    display: flex;
    gap: 12px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
  }
  .m-card-media { flex: 0 0 112px; text-decoration: none; }
  .m-img {
    display: block;
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: 8px;
    background: #f6f6f6;
  }
  span.m-img { display: flex; align-items: center; justify-content: center; }
  .m-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-align: center;
  }
  .m-card-cat {
    margin: 2px 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: #1c1c1c;
  }
  .m-card-name {
    font-size: 14px;
    line-height: 1.45;
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .m-price {
    margin: 8px 0 4px;
    font-size: 18px;
    font-weight: 600;
    color: #d9363b;
  }
  .m-price i {
    font-style: normal;
    font-size: 12px;
    font-weight: 400;
    color: #999;
  }
  .m-price.is-ask { font-size: 14px; font-weight: 400; color: #666; }
  .m-card-moq { margin: 0 0 6px; font-size: 11px; color: #999; }
  .m-card-more {
    margin-top: auto;
    align-self: center;
    font-size: 13px;
    color: #d9363b;
    text-decoration: none;
  }

  /* ---------- 商品页：左分类栏 + 右列表 ---------- */
  .m-shop { display: flex; align-items: flex-start; }
  .m-rail {
    flex: 0 0 92px;
    width: 92px;
    background: #f6f6f6;
    padding: 6px 0;
  }
  .m-rail button {
    display: block;
    width: 100%;
    padding: 13px 6px;
    border: 0;
    border-left: 2px solid transparent;
    background: transparent;
    font-size: 12px;
    line-height: 1.4;
    color: #555;
    text-align: center;
    cursor: pointer;
  }
  .m-rail button.is-active {
    background: #fff;
    color: #d9363b;
    border-left-color: #d9363b;
    font-weight: 600;
  }
  .m-shoplist { flex: 1; min-width: 0; padding: 8px; }
  .m-item {
    display: flex;
    gap: 10px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
  }
  .m-item .m-img { width: 86px; height: 86px; flex: 0 0 86px; }
  .m-item-body { flex: 1; min-width: 0; }
  .m-item-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    text-decoration: none;
  }
  .m-item-meta { margin-top: 3px; font-size: 11px; color: #999; }
  .m-item .m-price { margin: 6px 0 2px; font-size: 16px; }
  .m-item .m-card-moq { margin: 0; }

  .m-empty {
    padding: 40px 0;
    text-align: center;
    font-size: 13px;
    color: #999;
  }

  /* 详情页等内容页：手机上保持现有响应式，仅留出 tab 栏空间（body.m-app 已加 padding） */
}
