/* ============================================================
   nav-v7.css
   把旧模板（styles.css / site-v2.css / product-page.css）的站头
   统一成 V7 首页的外观。

   只改皮肤，不动 HTML 结构与任何一个链接：
   旧页面继续用 .site-header / .nav-shell / .site-nav / .nav-cta /
   .menu-toggle 这套类名，各自的菜单脚本照常工作。

   取值全部对齐 v7.css：
     头部 72px、白底 96% + 8px 模糊、1px #E3EBF2 下边线
     LOGO 36px 圆形、品牌字 15px/700、副行 9.5px 大写字距
     导航 15px、行距 30px、hover 变 #0174EB
     CTA 42px 高、4px 圆角、#0E5A87
   ============================================================ */

/* 双写类名：压过 .product-detail-page .site-header（0-2-0）这类后代选择器 */
.site-header.site-header {
  height: 72px;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid #E3EBF2;
}

.site-header .nav-shell { gap: 40px; justify-content: flex-start; }

/* V2/V1 模板把询价按钮塞在 .site-nav 里，所以整条 nav 要撑满剩余宽度，
   按钮再用 margin-left:auto 顶到最右——这样链接就贴着品牌字，和首页一致 */
.site-header .site-nav { flex: 1 1 auto; margin-left: 0; }
.site-header .site-nav .nav-cta { margin-left: auto; }

/* ---------------- 品牌锁定 ---------------- */

.site-header .brand { gap: 10px; }
.site-header .brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
}
.site-header .brand b {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0C1D2A;
}
.site-header .brand small,
.site-header .brand i {
  margin-top: 2px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #8D9EAD;
}

/* ---------------- 链接 ---------------- */

.site-header .site-nav {
  gap: 30px;
  font-size: 15px;
  font-weight: 400;
}
.site-header .site-nav a {
  padding: 0;
  color: #46596A;
  font-weight: 400;
  /* 不加就会在 900 附近被挤成 "OEM /" 换行 "ODM" */
  white-space: nowrap;
  transition: color .16s cubic-bezier(.22, .61, .36, 1);
}
.site-header .site-nav a:hover { color: #0174EB; }

/* V7 的导航没有下滑线，靠颜色变化；旧模板的 2px 蓝线要去掉 */
.site-header .site-nav > a:not(.nav-cta)::after { display: none; }

/* OEM / ODM 原来的橙色强调在 V7 体系里没有对应，统一回正文色 */
.site-header .v2-nav .nav-oem { color: #46596A; }

/* ---------------- 询价按钮 ---------------- */

.site-header .site-nav .nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  border-radius: 4px;
  background: #0E5A87;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background .18s cubic-bezier(.22, .61, .36, 1);
}
.site-header .site-nav .nav-cta:hover { background: #0A4568; color: #fff; }

/* ---------------- 汉堡 ---------------- */

.site-header .menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  border: 1px solid #D3DFE9;
  border-radius: 4px;
  background: #fff;
}
.site-header .menu-toggle > span:not(.sr-only) {
  width: 100%;
  height: 1.5px;
  margin: 0;
  background: #0C1D2A;
}
.site-header .menu-toggle[aria-expanded="true"] > span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
/* 旧模板把“中间那条消失”写在 760 的媒体查询里，860 这档继承不到，
   X 会多出一横变成六角星，所以这里必须再写一遍 */
.site-header .menu-toggle[aria-expanded="true"] > span:nth-child(2) { opacity: 0; }
.site-header .menu-toggle[aria-expanded="true"] > span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------------- 中间屏：先收行距，别让六项顶到品牌 ---------------- */

@media (max-width: 1180px) {
  .site-header .nav-shell { gap: 28px; }
  .site-header .site-nav { gap: 22px; }
}

@media (min-width: 861px) and (max-width: 1000px) {
  /* 六项 + CTA 在这个区间很紧，压字号和行距，保证不换行也不溢出 */
  .site-header .nav-shell { gap: 16px; }
  .site-header .site-nav { gap: 10px; font-size: 13.5px; }
  .site-header .site-nav .nav-cta { padding: 0 12px; font-size: 12.5px; }
}

/* ---------------- 抽屉：断点对齐 V7 的 860，不是旧模板的 760 ----------------
   旧模板在 760 才收导航、860 就该显示汉堡的话中间这 100px 会“按钮出来了、
   导航还没收”，六项挤成三行还把 CTA 顶出屏幕。这里把抽屉整套在 860 重写。 */

@media (max-width: 860px) {
  .site-header.site-header { height: 72px; }
  .site-header .brand img { width: 34px; height: 34px; }
  .site-header .menu-toggle { display: flex; margin-left: auto; }

  .site-header .site-nav {
    position: fixed;
    /* 旧样式把面板钉在 68px；头部改成 72px 后必须同步，否则漏一条缝 */
    inset: 72px 0 auto;
    display: grid;
    flex: none;
    gap: 0;
    margin: 0;
    padding: 6px 20px 14px;
    background: #fff;
    border-bottom: 1px solid #E3EBF2;
    box-shadow: 0 18px 26px -22px rgba(10, 52, 80, .5);
    transform: translateY(-130%);
    transition: transform .3s ease;
  }
  .site-header .site-nav.open { transform: translateY(0); }

  .site-header .site-nav a {
    padding: 14px 0;
    font-size: 16px;
    border-bottom: 1px solid #E3EBF2;
  }
  .site-header .site-nav a:last-child { border-bottom: 0; }
  /* CTA 在抽屉里保留：手机上没有头部按钮，这是唯一的询价入口 */
  .site-header .site-nav .nav-cta {
    margin: 12px 0 0;
    height: 46px;
    border-bottom: 0;
  }
}

/* ---------------- Products mega menu ----------------
   site-v2.css still assumes the old 78px header:
     .product-nav { height: 78px }
     .product-mega { position: fixed; top: 78px; transform: translate(-50%, 12px) }
   This skin set the header to 72px border-box (1px bottom border → 71px
   content box). The 78px trigger was then vertically centered, so its
   bottom sat at 74.5px while the panel started at 78px. Crossing that
   3.5px gap dropped :hover; pointer-events:none on the closing panel
   made it impossible to reach a menu item.

   .site-nav is height:auto, so height:100% on .product-nav would be
   ignored. Give .site-nav an explicit height first, then stretch the
   trigger, and add a hover bridge for the 1px border seam. */

.site-header .site-nav {
  height: 100%;
}

.site-header .product-nav {
  align-self: stretch;
  height: auto;
}

.site-header .product-mega {
  top: 72px; /* flush with the header's border box */
  /* Keep the fade; drop the 12px downward shift that widens the gap
     while the menu is opening or closing. */
  transform: translate(-50%, 0);
}

.site-header .product-nav:hover .product-mega,
.site-header .product-nav:focus-within .product-mega {
  transform: translate(-50%, 0);
}

/* Invisible hover bridge covering the 1px header border and any sub-pixel remainder. */
.site-header .product-mega::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 16px;
}

/* Drawer (≤860) should show the groups inline, not as a hover flyout.
   site-v2.css only does this at 760px, so 761–860 had a hamburger
   plus a still-fixed mega and the same hover gap. */
@media (max-width: 860px) {
  .site-header .site-nav {
    height: auto; /* drawer is not the 72px header row */
  }
  .site-header .product-nav {
    height: auto;
    display: block;
    align-self: auto;
  }
  .site-header .product-nav-trigger {
    padding: 14px 0;
  }
  .site-header .product-nav-trigger span {
    margin-left: auto;
  }
  .site-header .product-mega,
  .site-header .product-nav:hover .product-mega,
  .site-header .product-nav:focus-within .product-mega {
    position: static;
    left: auto;
    top: auto;
    width: 100%;
    display: block;
    padding: 0 0 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  .site-header .product-mega::before { display: none; }
  .site-header .mega-overview { display: none; }
  .site-header .mega-groups {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .site-header .mega-group {
    min-height: auto;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  .site-header .mega-group > span { display: none; }
  .site-header .site-nav .mega-group a {
    padding: 8px 0 8px 12px;
    border-bottom: 1px solid #E3EBF2;
    font-size: 14px;
  }
  /* Match the existing 760px drawer: group titles only, hide subgroup links. */
  .site-header .mega-group a:not(.mega-group-title) { display: none; }
  .site-header .site-nav .mega-group .mega-group-title {
    margin: 0;
    padding-left: 0;
    border-bottom: 1px solid #E3EBF2;
    font-size: 15px;
  }
}
