/* Shared PC header: one visual source for the homepage and all secondary pages. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.site-header .mega-menu {
  display: none;
}

body.secondary-menu-open {
  overflow: hidden;
}

.secondary-mobile-nav,
.mobile-nav-scrim {
  display: none;
}

@media (min-width: 1025px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: auto;
    line-height: normal;
    border-bottom: 1px solid rgba(219, 228, 238, .88);
    background: rgba(255, 255, 255, .96);
    box-shadow: none;
    backdrop-filter: blur(14px);
  }

  .site-header .header-inner {
    width: var(--shell);
    height: var(--header-height);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
  }

  .site-header .brand {
    width: auto;
    min-width: 148px;
    min-height: 44px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
  }

  .site-header .brand img {
    width: 142px;
    height: auto;
  }

  html[lang="zh-CN"] .site-header .brand img {
    width: 200px;
  }

  .site-header .desktop-nav {
    height: 100%;
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: clamp(12px, 1.8vw, 26px);
  }

  .site-header .nav-link {
    position: relative;
    min-width: 70px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
  }

  .site-header .nav-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 3px;
    border-radius: 99px;
    background: var(--color-accent);
    transform: translateX(-50%);
    transition: width .2s ease;
  }

  .site-header .nav-link:hover::after,
  .site-header .nav-link:focus-visible::after,
  .site-header .nav-link.is-active::after {
    width: 34px;
  }

  .site-header .header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .site-header .icon-button,
  .site-header .language-toggle,
  .site-header .menu-button {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
  }

  .site-header .icon-button:hover,
  .site-header .language-toggle:hover,
  .site-header .menu-button:hover {
    background: #eef4fa;
    color: var(--color-primary);
  }

  .site-header .language-toggle {
    gap: 8px;
    padding: 0 8px;
    font-weight: 700;
  }

  .site-header .icon-button svg,
  .site-header .language-toggle svg,
  .site-header .menu-button svg,
  .site-header .primary-button svg {
    width: 19px;
    height: 19px;
    stroke-width: 2;
  }

  .site-header .primary-button {
    min-height: 52px;
    padding: 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 6px;
    background: var(--color-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 14px 24px rgba(20, 121, 220, .22);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  }

  .site-header .primary-button:hover {
    border-color: transparent;
    background: var(--color-accent-strong);
    box-shadow: 0 18px 30px rgba(20, 121, 220, .27);
    transform: translateY(-2px);
  }

  .site-header .primary-button.compact {
    min-height: 44px;
    padding: 0 22px;
  }

  .site-header .menu-button {
    display: none;
  }

  .site-header button:focus-visible,
  .site-header a:focus-visible {
    outline: 3px solid rgba(13, 99, 199, .35);
    outline-offset: 3px;
  }

  .site-header .mega-menu {
    position: absolute;
    top: var(--header-height);
    right: 0;
    left: 0;
    display: none;
    border-top: 1px solid #eef2f7;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 28px 50px rgba(16, 34, 54, .12);
  }

  .site-header .mega-menu.is-open {
    display: block;
  }

  .site-header .mega-inner {
    width: var(--shell);
    margin: 0 auto;
    padding: 30px 0 34px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 42px;
  }

  .site-header .mega-eyebrow {
    margin: 0 0 12px;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .site-header .mega-inner > div:first-child > strong {
    color: var(--color-text);
    font-size: 30px;
    line-height: 1.2;
  }

  .site-header .mega-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }

  .site-header .mega-grid a {
    min-height: 104px;
    padding: 22px;
    border: 1px solid #e5eef8;
    border-radius: 8px;
    background: #f8fbff;
    color: var(--color-text);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.5;
    transition: border-color .2s ease, transform .2s ease;
  }

  .site-header .mega-grid a:hover {
    border-color: #bdd8f5;
    transform: translateY(-2px);
  }

  .site-header .mega-grid span {
    display: block;
    margin-top: 12px;
    color: var(--color-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
  }

  .secondary-site-header .secondary-mobile-nav,
  .secondary-site-header .mobile-nav-scrim {
    display: none;
  }
}

@media (min-width: 1025px) and (max-width: 1180px) {
  .site-header .header-inner,
  .site-header .mega-inner {
    width: min(100% - 56px, 1040px);
  }

  .site-header .desktop-nav {
    gap: 20px;
  }

  .site-header .nav-link {
    min-width: auto;
    font-size: 14px;
  }
}

@media (min-width: 1025px) and (max-width: 1040px) {
  .site-header .header-inner,
  .site-header .mega-inner {
    width: min(100% - 32px, 990px);
  }

  .site-header .header-inner {
    gap: 18px;
  }

  .site-header .brand {
    min-width: 130px;
  }

  .site-header .brand img {
    width: 130px;
  }

  html[lang="zh-CN"] .site-header .brand {
    min-width: 183px;
  }

  html[lang="zh-CN"] .site-header .brand img {
    width: 183px;
  }

  .site-header .desktop-nav {
    gap: 14px;
  }

  .site-header .header-actions {
    gap: 8px;
  }

  .site-header .language-toggle {
    gap: 5px;
    padding: 0 4px;
  }

  .site-header .primary-button.compact {
    padding: 0 14px;
  }
}

@media (max-width: 1024px) {
  /* A filtered sticky header becomes the containing block for fixed children.
     Keep the drawer and scrim viewport-fixed instead of clipping them to the header. */
  .site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .secondary-pc-tool,
  .secondary-desktop-nav,
  .header-cta {
    display: none;
  }

  .secondary-menu-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--color-surface-soft);
    color: var(--color-heading);
  }

  .secondary-mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-drawer);
    width: min(88vw, 390px);
    padding: 18px 22px 30px;
    display: block;
    overflow-y: auto;
    background: #fff;
    box-shadow: -24px 0 70px rgba(4, 24, 48, .18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(0);
    transition: opacity var(--motion-base) ease, visibility var(--motion-base) ease;
  }

  .secondary-mobile-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-nav-scrim {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-drawer) - 1);
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(4, 20, 39, .48);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-base) ease;
  }

  body.secondary-menu-open .mobile-nav-scrim {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-top {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .mobile-nav-top strong {
    color: var(--color-heading);
    font-size: 20px;
  }

  .mobile-nav-top button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--color-surface-soft);
    color: var(--color-heading);
  }

  .secondary-mobile-nav details {
    border-bottom: 1px solid var(--color-border);
  }

  .secondary-mobile-nav summary {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-heading);
    font-weight: 750;
    list-style: none;
  }

  .secondary-mobile-nav details.is-current > summary {
    color: var(--color-primary);
  }

  .secondary-mobile-nav summary::-webkit-details-marker {
    display: none;
  }

  .secondary-mobile-nav details[open] summary svg {
    transform: rotate(180deg);
  }

  .secondary-mobile-nav details > div {
    padding: 0 0 12px 12px;
    display: grid;
  }

  .secondary-mobile-nav details > div a {
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--color-muted);
  }

  .mobile-contact-cta {
    min-height: 48px;
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-sm);
    background: var(--color-accent);
    color: #fff;
    font-weight: 800;
  }
}

.secondary-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  line-height: normal;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 24px 24px;
  background: rgba(8, 17, 31, .46);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--motion-base) ease, visibility var(--motion-base) ease;
}

.secondary-search-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.secondary-search-overlay .search-dialog {
  position: relative;
  width: min(720px, 100%);
  padding: 40px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .24);
  opacity: 0;
  transform: translateY(18px) scale(.985);
  transition: opacity var(--motion-base) ease, transform var(--motion-base) var(--motion-ease);
}

.secondary-search-overlay.is-open .search-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.secondary-search-overlay .icon-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.secondary-search-overlay .search-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.secondary-search-overlay .search-dialog label {
  display: block;
  margin-bottom: 20px;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  line-height: normal;
}

.secondary-search-overlay .search-box {
  min-height: 58px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #d7e4f0;
  border-radius: 8px;
  background: #f8fbff;
}

.secondary-search-overlay .search-box svg {
  width: 24px;
  height: 24px;
  flex: 0 1 auto;
}

.secondary-search-overlay .search-box input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 17px;
}

.secondary-search-overlay .search-suggestions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.secondary-search-overlay .search-suggestions button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #d7e4f0;
  border-radius: 999px;
  background: #fff;
  color: var(--color-muted);
  cursor: pointer;
}

body.secondary-search-open {
  overflow: hidden;
}
