/* 
 * Header Optimization Styles
 * 优化header布局和搜索栏位置
 */

/* Header Main 容器优化 */
.header-main {
  padding: 10px 0;
}

/* Header Inner 弹性布局优化 */
.header-main .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}

/* Logo 区域优化 */
.header-main #logo {
  flex: 0 0 auto;
  padding-right: 20px;
}

/* 导航菜单优化 - 左侧 */
.header-main .header-nav-main.nav-left {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 25px; /* 增加导航项之间的间距 */
  margin-right: 20px;
}

/* 导航菜单优化 - 右侧 */
.header-main .header-nav-main.nav-right {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 20px; /* 增加导航项之间的间距 */
  margin-left: 20px;
}

/* 单个导航项优化 */
.header-main .header-nav-main > li.menu-item {
  display: flex;
  align-items: center;
  white-space: nowrap;
  position: relative;
}

/* 导航链接样式优化 */
.header-main .nav-top-link {
  padding: 10px 0;
  font-weight: 500;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 下拉图标样式 */
.nav-top-link-dropdown-icon {
  font-size: 12px;
  transition: transform 0.3s ease;
}

/* 下拉菜单容器 */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 10px 0;
  min-width: 200px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

/* 下拉菜单显示状态 */
.product-category-item:hover .nav-dropdown,
.menu-item.has-dropdown:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 下拉菜单项 */
.nav-dropdown .menu-item {
  display: block;
  padding: 0;
}

/* 下拉菜单链接 */
.nav-dropdown .menu-item a {
  display: block;
  padding: 8px 20px;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-dropdown .menu-item a:hover {
  background-color: #f8f9fa;
  color: #2563eb;
  padding-left: 25px;
}

/* 下拉菜单图标旋转 */
.product-category-item:hover .nav-top-link-dropdown-icon,
.menu-item.has-dropdown:hover .nav-top-link-dropdown-icon {
  transform: rotate(180deg);
}

/* 搜索栏容器优化 */
.header-search-form {
  min-width: 250px; /* 设置搜索栏最小宽度 */
}

/* 搜索表单优化 */
.header-search-form .search-form {
  width: 100%;
}

/* 搜索输入框优化 */
.header-search-form .search-field {
  padding: 10px 15px;
  border-radius: 30px;
  border: 2px solid #e1e1e1;
  transition: all 0.3s ease;
}

.header-search-form .search-field:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

/* 搜索按钮优化 */
.header-search-form .search-submit {
  padding: 10px 20px;
  border-radius: 30px;
  background-color: #2563eb;
  color: white;
  border: none;
  transition: background-color 0.3s ease;
}

.header-search-form .search-submit:hover {
  background-color: #1d4ed8;
}

/* 移动端适配 */
@media (max-width: 1024px) {
  .header-main .header-inner {
    flex-wrap: wrap;
  }
  
  .header-main .flex-left,
  .header-main .flex-right {
    flex: 1 1 100%;
    justify-content: center;
    margin-top: 10px;
  }
  
  .header-search-form {
    min-width: 200px;
    margin: 0 10px;
  }
}

@media (max-width: 768px) {
  .header-main .header-nav-main.nav-left,
  .header-main .header-nav-main.nav-right {
    gap: 15px;
  }
  
  .header-search-form {
    min-width: 150px;
  }
  
  .header-search-form .search-field {
    padding: 8px 12px;
    font-size: 14px;
  }
  
  .header-search-form .search-submit {
    padding: 8px 15px;
    font-size: 14px;
  }
}

/* 产品分类导航优化 */
.product-categories-nav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 25px; /* 增加分类之间的间距 */
}

.product-categories-nav .nav-top-link {
  color: inherit;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.3s ease;
  padding: 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-categories-nav .nav-top-link:hover {
  color: #2563eb;
}

/* Header中产品分类导航项 */
.header-main .product-categories-nav-item {
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
}

/* 深色模式支持 */
.header-main.dark .product-categories-nav .nav-top-link {
  color: rgba(255, 255, 255, 0.9);
}

.header-main.dark .product-categories-nav .nav-top-link:hover {
  color: #fff;
}

/* 浅色模式支持 */
.header-main.light .product-categories-nav .nav-top-link {
  color: rgba(0, 0, 0, 0.7);
}

.header-main.light .product-categories-nav .nav-top-link:hover {
  color: #000;
}