/* ========================================
   好芯友科技官网 - 头部导航样式
   ======================================== */

/* 头部样式 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.header.active {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo 区域 */
.logo-area {
  flex-shrink: 0;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.logo-img {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  height: 30px;
  width: auto;
  object-fit: contain;
}

/* 导航区域 */
.nav-area {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link.active {
  color: var(--primary-color);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
  border-radius: 1px;
}

.arrow-icon {
  transition: transform 0.3s ease;
}

.nav-item:hover .arrow-icon {
  transform: rotate(180deg);
}

/* PC端导航默认样式 - 一级菜单 */
.nav-item.has-submenu > .nav-link {
  position: relative;
}

.nav-item.has-submenu > .arrow-toggle {
  display: none;
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
}

/* PC端导航悬浮样式 */
@media (min-width: 1025px) {
  .nav-item.has-submenu:hover > .nav-link {
    color: var(--primary-color);
  }

  .nav-item.has-submenu:hover > .arrow-toggle {
    display: flex;
    transform: translateY(-50%) rotate(180deg);
  }

  .nav-item.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}

/* 二级菜单 */
.submenu {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  list-style: none;
}

.submenu.show {
  opacity: 1;
  visibility: visible;
}

.submenu li {
  margin-bottom: 0.5rem;
}

.submenu li:last-child {
  margin-bottom: 0;
}

.submenu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.submenu a:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

/* 右侧区域 */
.right-area {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.tel-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 25px;
  color: white;
}

.tel-icon {
  fill: white;
}

.tel-number {
  color: white;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

/* 语言切换按钮 */
.lang-switch {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 30px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.lang-switch:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 12px rgba(64, 123, 255, 0.15);
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 25px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: 50px;
  justify-content: center;
}

.lang-btn:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 3px 10px rgba(64, 123, 255, 0.35);
  transform: translateY(-1px);
}

.lang-btn svg {
  opacity: 0.8;
}

.lang-btn.active svg {
  opacity: 1;
}

.lang-btn span {
  line-height: 1;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  display: none;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-menu-btn svg {
  fill: var(--text-primary);
}

/* 移动端关闭按钮 */
.mobile-close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-close svg {
  fill: var(--text-primary);
}

/* 移动端电话 */
.mobile-tel {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.mobile-tel svg {
  fill: var(--primary-color);
}

.mobile-tel a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
}

/* 响应式 */
@media (max-width: 1024px) {
  .nav-area {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background: white;
    padding: 3rem 1.5rem 2rem;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    flex-direction: column;
    align-items: flex-start;
    overflow-y: auto;
  }

  .nav-area.open {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-item .nav-link {
    flex: 1;
    padding: 1rem 0;
  }

  .has-submenu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }

  .has-submenu .arrow-icon {
    display: none;
  }

  .arrow-toggle {
    display: none;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    flex-shrink: 0;
  }

  .has-submenu .arrow-toggle {
    display: flex;
  }

  .arrow-toggle .arrow-icon {
    transition: transform 0.3s ease;
  }

  .arrow-toggle.expanded .arrow-icon {
    transform: rotate(180deg);
  }

  .submenu {
    position: static;
    transform: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
    border-radius: 0;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
  }

  .submenu.show {
    transform: none;
    opacity: 1;
    visibility: visible;
    max-height: 500px;
    padding: 0.5rem 0.5rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin-top: 0.25rem;
  }

  .submenu li {
    margin-bottom: 0.25rem;
  }

  .mobile-close,
  .mobile-tel {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .tel-box {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 1rem;
    height: 70px;
  }

  .logo-img {
    height: 40px;
  }

  .logo-text {
    height: 24px;
  }

  .right-area {
    gap: 0.75rem;
  }

  .search-btn,
  .lang-btn {
    width: 36px;
    height: 36px;
  }
}
