/* 搜索功能修复样式 */

/* 搜索框容器样式修复 */
.c-header-search {
  position: relative;
  z-index: 10;
}

/* 搜索主框架样式 */
.c-header-search__main {
  display: none;
  position: absolute;
  top: 0;
  left: 48px;
  transform: translateX(-100%);
  z-index: 9999;
  width: 0;
  height: 42px;
  background: #fff;
  border: 1px solid #4E0015;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* 搜索输入框样式 */
.c-header-search__main input {
  flex: 1;
  height: 40px;
  padding: 8px 12px;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
}

/* 搜索按钮样式 */
.c-header-search__submit {
  height: 40px;
  padding: 0 16px;
  background: #4E0015;
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.c-header-search__submit:hover {
  background: #6B0020;
}

/* 搜索图标按钮样式调整 */
.c-header-search__open {
  width: 48px;
  height: 42px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
}

/* 修复按钮重合问题 */
.l-subnav__search {
  position: relative;
  z-index: 10;
}

.l-header__bottom .c-header-search {
  margin-right: 15px;
}

/* 响应式调整 */
@media (max-width: 1255px) {
  .c-header-search__main {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 50px;
  }
  
  .c-header-search__main input {
    height: 48px;
    font-size: 16px;
  }
  
  .c-header-search__submit {
    height: 48px;
    padding: 0 20px;
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  .c-header-search__main {
    width: calc(100vw - 40px);
    max-width: 400px;
  }
}

/* 首页底部搜索框特殊样式 */
.l-header__bottom .c-header-search__main {
  top: -42px;
  left: 0;
  transform: none;
}

.l-header__bottom .c-header-search__open {
  background: rgba(255,255,255,0.9);
  border-radius: 4px;
}

/* 避免与其他元素重合 */
.c-header-search.active .c-header-search__main {
  display: flex;
}

/* 动画效果 */
.c-header-search__main.show {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 580px;
    opacity: 1;
  }
}