/* ═══════════════════════════════════════════════
   EJ 网站 · 手机端增强样式
   使用方式：在每个 HTML 页面的 </head> 前加入
   <link rel="stylesheet" href="mobile.css">
═══════════════════════════════════════════════ */

/* ─── 基础 Touch 优化 ─── */
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { -webkit-text-size-adjust: 100%; }

/* ─── 汉堡菜单按钮 ─── */
.mob-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.mob-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1a1a1a;
  transition: all 0.25s ease;
  border-radius: 1px;
}
.mob-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mob-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mob-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── 移动导航抽屉 ─── */
.mob-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 900;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mob-drawer-overlay.open {
  display: block;
  opacity: 1;
}
.mob-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: #fff;
  z-index: 950;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
}
.mob-drawer.open { transform: translateX(0); }
.mob-drawer-header {
  background: #1a1a1a;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.mob-drawer-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: #c8102e;
  letter-spacing: 2px;
  line-height: 1;
}
.mob-drawer-close {
  background: none;
  border: 1px solid #333;
  color: #aaa;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mob-drawer-close:hover { color: #fff; border-color: #666; }
.mob-drawer-phone {
  background: #111;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.mob-drawer-phone:hover { background: #222; color: #fff; }
.mob-nav-section { border-bottom: 1px solid #f0f0f0; }
.mob-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: #1a1a1a;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.mob-nav-toggle:hover { background: #fafafa; }
.mob-nav-toggle-icon {
  font-size: 10px;
  color: #c8102e;
  transition: transform 0.2s;
  font-style: normal;
}
.mob-nav-toggle.expanded .mob-nav-toggle-icon { transform: rotate(180deg); }
.mob-nav-sub {
  display: none;
  padding: 0 0 8px;
  background: #fafafa;
}
.mob-nav-sub.open { display: block; }
.mob-nav-sub-cat {
  font-size: 10px;
  font-weight: 700;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 10px 20px 4px;
}
.mob-nav-sub a {
  display: block;
  padding: 9px 20px 9px 26px;
  font-size: 13px;
  color: #555;
  border-bottom: 1px solid #f0f0f0;
  transition: color 0.15s, background 0.15s;
}
.mob-nav-sub a:last-child { border: none; }
.mob-nav-sub a:hover { color: #c8102e; background: #fff8f8; padding-left: 30px; }
.mob-direct-link {
  display: block;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.15s;
}
.mob-direct-link:hover { color: #c8102e; background: #fff8f8; padding-left: 24px; }
.mob-drawer-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
  background: #f7f7f7;
  flex-shrink: 0;
}
.mob-drawer-footer a {
  display: block;
  padding: 8px 0;
  font-size: 12px;
  color: #777;
  border-bottom: 1px solid #eee;
}
.mob-drawer-footer a:hover { color: #c8102e; }
.mob-drawer-footer a:last-child { border: none; }
.mob-cta-login {
  display: block;
  background: #c8102e;
  color: #fff !important;
  padding: 11px 20px;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

/* ─── 底部固定导航栏 ─── */
.mob-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e2e2e2;
  z-index: 800;
  height: 56px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.mob-bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 100%;
}
.mob-bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #999;
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 0;
}
.mob-bnav-item.active, .mob-bnav-item:hover { color: #c8102e; }
.mob-bnav-icon { font-size: 18px; line-height: 1; }
.mob-bnav-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ─── 返回顶部按钮 ─── */
.mob-scroll-top {
  display: none;
  position: fixed;
  bottom: 70px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  z-index: 790;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: background 0.15s, opacity 0.2s;
  opacity: 0;
}
.mob-scroll-top.visible { opacity: 1; }
.mob-scroll-top:hover { background: #c8102e; }

/* ─── 搜索覆盖层 ─── */
.mob-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 980;
  padding: 60px 20px 20px;
  flex-direction: column;
  align-items: center;
}
.mob-search-overlay.open { display: flex; }
.mob-search-box {
  display: flex;
  width: 100%;
  max-width: 480px;
  background: #fff;
  overflow: hidden;
}
.mob-search-box input {
  flex: 1;
  padding: 14px 16px;
  font-size: 16px;
  border: none;
  outline: none;
  font-family: 'Barlow', sans-serif;
}
.mob-search-box button {
  padding: 0 20px;
  background: #c8102e;
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
}
.mob-search-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: 1px solid #555;
  color: #fff;
  width: 36px;
  height: 36px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mob-search-hints {
  color: #aaa;
  font-size: 13px;
  margin-top: 20px;
  text-align: center;
  line-height: 1.8;
}

/* ─── 响应式断点 ─── */
@media (max-width: 768px) {

  /* 显示汉堡按钮 */
  .mob-hamburger { display: flex; }
  
  /* 显示底部导航 */
  .mob-bottom-nav { display: block; }
  .mob-scroll-top { display: flex; }

  /* 给底部导航留空间 */
  body { padding-bottom: 56px; }

  /* 隐藏桌面导航 + 工具栏简化 */
  .util-bar { display: none; }
  .site-nav { display: none !important; }
  .hdr-actions { display: none; }

  /* 移动端 Header */
  .site-header {
    padding: 0 14px !important;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .logo-link {
    border: none !important;
    margin: 0 !important;
    padding: 10px 0 !important;
  }
  .logo-mark { font-size: 30px !important; }

  /* Hero Section */
  .hero {
    padding: 36px 16px !important;
  }
  .hero h1 {
    font-size: 26px !important;
    margin-bottom: 10px !important;
  }
  .hero p {
    font-size: 14px !important;
    margin-bottom: 20px !important;
  }
  .hero-actions {
    flex-direction: column;
    gap: 10px !important;
  }
  .hero-actions a, .hero-actions button {
    width: 100%;
    text-align: center;
    padding: 13px 20px !important;
    font-size: 14px !important;
  }

  /* Page Wrap */
  .page-wrap, .page-wrap-wide {
    padding: 16px !important;
  }

  /* Section titles */
  .sec-title { font-size: 22px !important; }

  /* Grids → Single Column */
  .two-col {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .three-col {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  /* Product Cards */
  .card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  /* Category Tiles */
  [style*="minmax(180px,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  [style*="minmax(220px,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .cat-tile { padding: 12px 8px !important; }
  .cat-icon { width: 56px !important; height: 56px !important; margin-bottom: 6px !important; }
  .cat-label { font-size: 12px !important; }

  /* Sidebar Layout → Stack */
  .sidebar-layout {
    flex-direction: column !important;
  }
  .sidebar-panel {
    width: 100% !important;
  }

  /* Filter Panel Compact */
  .fp-head { padding: 10px 12px !important; font-size: 11px !important; }
  .fp-body { padding: 10px 12px !important; }
  .f-opt { font-size: 12px !important; }

  /* Toolbar */
  .toolbar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }
  .toolbar-r {
    width: 100%;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .sort-g select { min-width: auto !important; flex: 1; }
  .uom-tog { flex: 1; }
  .uom-tog button { flex: 1; }

  /* Tables → Scroll */
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }

  /* Breadcrumb */
  .breadcrumb { padding: 8px 14px !important; font-size: 11px !important; }

  /* Buttons Touch Size */
  .btn-red, .btn-dark, .btn-outline-red {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Footer */
  .site-footer { padding: 28px 16px 12px !important; }
  .ft-top {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .ft-col { border-bottom: 1px solid #222; padding-bottom: 16px; }
  .ft-col:last-child { border: none; }
  .ft-col h5 { cursor: pointer; display: flex; justify-content: space-between; }
  .ft-col h5::after {
    content: '+';
    font-size: 14px;
    color: #555;
    font-weight: 400;
  }
  .ft-col.open h5::after { content: '−'; }
  .ft-col ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .ft-col.open ul { max-height: 400px; }
  .ft-bottom {
    flex-direction: column !important;
    gap: 12px !important;
    text-align: center;
  }
  .ft-links { justify-content: center !important; gap: 10px !important; flex-wrap: wrap !important; }

  /* Info Box */
  .info-box { padding: 12px 14px !important; margin: 12px 0 !important; }

  /* Pagination */
  .pagination { flex-wrap: wrap; gap: 4px; }
  .pg-btn { min-width: 36px; height: 36px; }

  /* Product Stats Grid */
  [style*="grid-template-columns:1fr 1fr"][style*="background:#fff"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Industry Tiles */
  .ind-tile { padding: 12px !important; }

  /* Cards Compact on Mobile */
  .card-body { padding: 10px !important; }
  .card-name { font-size: 12px !important; }
  .card-specs { font-size: 11px !important; }
  .ca-view { padding: 8px 6px !important; font-size: 11px !important; }
  .ca-add { padding: 8px 8px !important; font-size: 11px !important; }

  /* Mega Menu → Hidden on Mobile (drawer handles it) */
  .mega { display: none !important; }
}

/* ─── Extra Small (iPhone SE etc.) ─── */
@media (max-width: 375px) {
  .hero h1 { font-size: 22px !important; }
  .card-grid { grid-template-columns: 1fr !important; }
  .three-col { grid-template-columns: 1fr !important; }
  [style*="minmax(180px,1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ─── 中等屏幕修正 (平板) ─── */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero h1 { font-size: 32px !important; }
  .card-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .ft-top { grid-template-columns: 1fr 1fr !important; }
  .three-col { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ─── 过渡动画 ─── */
.mob-drawer, .mob-drawer-overlay, .mob-search-overlay {
  will-change: transform, opacity;
}
