/* ============================================
   Header & Navigation Styles
   ============================================ */

/* --- Top Bar (浅蓝灰色背景，普通流，滚动时自然消失) --- */
.zs-top-bar {
  background-color: #f6f8fc;
  height: 40px;
  font-size: 13px;
  color: var(--zs-color-text);
}

.zs-top-bar .zs-wz {
  height: 100%;
}

.zs-top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.zs-top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zs-top-bar-social {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zs-top-bar-social a {
  display: inline-block;
}

.zs-top-bar-social img {
  width: 20px;
  height: 20px;
}

.zs-top-bar-contact {
  display: flex;
  align-items: center;
  margin-left: 30px;
}

.zs-top-bar-contact img {
  width: 16px;
  height: 16px;
  margin-right: 6px;
}

.zs-top-bar-contact a {
  color: var(--zs-color-text);
}

.zs-top-bar-contact a:hover {
  color: var(--zs-color-primary);
}

.zs-top-bar-contact .zs-divider {
  margin: 0 10px;
  color: var(--zs-color-text-light);
}

.zs-top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.zs-top-bar-right a {
  color: var(--zs-color-text);
}

.zs-top-bar-right a:hover {
  color: var(--zs-color-primary);
}

/* --- #zs-header 导航栏 sticky 容器 --- */
#zs-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* --- Main Header (白色背景) --- */
.zs-header {
  background: var(--zs-color-white);
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.zs-header-inner {
  display: flex;
  align-items: center;
  height: 90px;
}

/* --- Logo --- */
.zs-logo {
  flex-shrink: 0;
  margin-right: 40px;
}

.zs-logo img {
  height: 50px;
  width: auto;
}

/* --- Desktop Navigation --- */
.zs-nav {
  display: flex;
  align-items: center;
  height: 100%;
  flex: 1;
}

.zs-nav-list {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
}

.zs-nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.zs-nav-link {
  display: flex;
  align-items: center;
  padding: 0 25px;
  height: 100%;
  font-size: 16px;
  font-weight: 400;
  color: var(--zs-color-text-dark);
  position: relative;
  white-space: nowrap;
}

.zs-nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--zs-color-primary);
  transition: var(--zs-transition);
}

.zs-nav-item:hover .zs-nav-link::after,
.zs-nav-item.active .zs-nav-link::after {
  width: 100%;
}

.zs-nav-item:hover .zs-nav-link,
.zs-nav-item.active .zs-nav-link {
  color: var(--zs-color-primary);
}

/* --- Dropdown --- */
.zs-nav-dropdown-arrow { display: none; }

.zs-nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--zs-color-white);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 6px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--zs-transition);
  z-index: 100;
}

.zs-nav-item:hover .zs-nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.zs-nav-dropdown a {
  display: block;
  padding: 10px 20px;
  font-size: 15px;
  color: #222;
  transition: var(--zs-transition);
}

.zs-nav-dropdown a:hover {
  background-color: var(--zs-color-primary);
  color: #fff;
}

/* --- Header Right (Search + Divider + Email) --- */
.zs-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 40px;
}

.zs-search-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--zs-color-primary);
  flex-shrink: 0;
  padding: 0;
}

.zs-header-divider {
  width: 1px;
  height: 20px;
  background-color: #ddd;
  flex-shrink: 0;
}

.zs-header-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--zs-color-text-dark);
  flex-shrink: 0;
}

.zs-header-email img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.zs-header-email span {
  color: var(--zs-color-primary);
  font-size: 15px;
}

/* --- Mobile Menu Toggle --- */
.zs-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.zs-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--zs-color-text-dark);
  transition: var(--zs-transition);
}

/* --- Search Overlay --- */
.zs-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
}

.zs-search-overlay.active {
  display: flex;
}

.zs-search-box {
  width: 90%;
  max-width: 600px;
  position: relative;
}

.zs-search-box input {
  width: 100%;
  padding: 16px 60px 16px 24px;
  font-size: var(--zs-font-size-lg);
  border: none;
  border-radius: 8px;
}

.zs-search-box button {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  font-size: var(--zs-font-size-xl);
  color: var(--zs-color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  padding: 0;
  line-height: 1;
}

.zs-search-close {
  position: absolute;
  top: 30px;
  right: 30px;
  color: var(--zs-color-white);
  font-size: 32px;
  cursor: pointer;
}

/* --- Responsive Header --- */
@media (max-width: 1024px) {
  .zs-top-bar { display: none; }
  #zs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
  }
  .zs-header {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  }
  /*
   * Mobile nav: when opened, JS moves it to <body> to escape
   * all stacking contexts. position:fixed + z-index works at body level.
   */
  .zs-nav {
    display: none;
    flex-direction: column;
  }
  .zs-nav.zs-nav-open {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99998;
    background: var(--zs-color-white);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .zs-nav-list {
    flex-direction: column;
    width: 100%;
    height: auto;
  }
  .zs-nav-item {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--zs-color-border);
  }
  .zs-nav-link {
    padding: 14px 20px;
    width: 100%;
    height: auto;
    font-size: 15px;
    justify-content: flex-start;
    position: relative;
  }
  .zs-nav-link::after { display: none; }
  /* Mobile: hide dropdowns by default, show on click via JS */
  .zs-nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    background: #f5f5f5;
    padding: 0;
    display: none;
    width: 100%;
    border-top: 1px solid #eee;
  }
  .zs-nav-item.dropdown-open .zs-nav-dropdown {
    display: block;
  }
  .zs-nav-dropdown a {
    padding: 12px 20px 12px 36px;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #eee;
    position: relative;
  }
  .zs-nav-dropdown a:last-child { border-bottom: none; }
  .zs-nav-dropdown a::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ccc;
  }
  .zs-nav-dropdown a:hover {
    background: #eee;
    color: var(--zs-color-primary);
  }
  .zs-nav-dropdown a:hover::before {
    background: var(--zs-color-primary);
  }
  /* Dropdown arrow indicator */
  .zs-nav-dropdown-arrow {
    display: flex;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    color: #999;
    transition: transform 0.3s ease;
  }
  .zs-nav-item.dropdown-open .zs-nav-dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--zs-color-primary);
  }
  .zs-menu-toggle { display: flex; position: relative; z-index: 2; }
  .zs-header-email { display: none; }
  .zs-header-inner { height: 56px; }
  .zs-logo img { height: 36px; }
  .zs-header-right { margin-left: auto; }
}

@media (max-width: 768px) {
  .zs-swiper-prev,
  .zs-swiper-next { display: none; }
  .zs-header-divider { display: none; }
  .zs-header-inner { height: 50px; }
  .zs-logo img { height: 32px; }
  .zs-logo { margin-right: 0; }
}
