/* 搜索区域样式 */
.search-section {
    margin-bottom: 60px;
}

.search-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

.search-form {
    width: 100%;
}

.search-main-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

/* 搜索框样式 */
.search-input-group {
    flex: 1;
    min-width: 300px;
    position: relative;
    display: flex;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #D7D2C9;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    border-color: #E11111;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    width: 50px;
    background: #E11111;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #C10E0F;
}

/* 搜索条件样式 */
.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 2;
}

.filter-item {
    position: relative;
}

.filter-toggle {
    background: #F1F1F5;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 120px;
    justify-content: space-between;
}

.filter-toggle:hover {
    border-color: #E11111;
}

.filter-toggle.active {
    background: #E11111;
    color: white;
}

.filter-name {
    font-size: 14px;
    font-weight: 500;
}

.filter-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.filter-item:hover .filter-arrow,
.filter-item.active .filter-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单样式 */
.filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 20px;
    min-width: 200px;
    z-index: 1000;
    display: none;
    margin-top: 5px;
    max-height: 350px;
    overflow-y: auto;
    /* 添加过渡延迟，让下拉框不会立即消失 */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 修复下拉菜单交互 - 使用active类控制显示 */
.filter-item.active .filter-dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* 为下拉菜单添加一个小的间隙，避免鼠标直接离开 */
.filter-dropdown::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 5px;
    background: transparent;
}

/* 促销开关样式 */
.promotion-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
}

.promotion-switch {
    position: relative;
    width: 50px;
    height: 24px;
}

.promotion-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.promotion-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #D7D2C9;
    transition: .4s;
    border-radius: 24px;
}

.promotion-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.promotion-switch input:checked + .promotion-slider {
    background-color: #E11111;
}

.promotion-switch input:checked + .promotion-slider:before {
    transform: translateX(26px);
}

.promotion-text {
    font-size: 14px;
    color: #343434;
}

/* 价格下拉菜单 */
.price-dropdown {
    min-width: 250px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: nowrap;
}

.price-inputs input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #D7D2C9;
    border-radius: 5px;
    text-align: center;
    min-width: 0;
    width: 80px;
}

.price-separator {
    color: #9A958D;
    flex-shrink: 0;
}

/* 选项样式 */
.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 5px;
}

.filter-option:hover {
    background: #F8F9FA;
}

.filter-option input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #D7D2C9;
    border-radius: 3px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* 单选按钮样式 */
.filter-option input[type="radio"] + .checkmark {
    border-radius: 50%;
}

.filter-option input[type="radio"]:checked + .checkmark {
    background: #E11111;
    border-color: #E11111;
}

.filter-option input[type="radio"]:checked + .checkmark::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
}

/* 多选按钮样式 */
.filter-option input[type="checkbox"]:checked + .checkmark {
    background: #E11111;
    border-color: #E11111;
}

.filter-option input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
}

.option-text {
    font-size: 14px;
    flex: 1;
}

/* 颜色选项特殊样式 */
.color-option {
    gap: 8px;
}

.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #f0f0f0;
    flex-shrink: 0;
}

/* 选中的颜色选项样式 */
.color-option input:checked + .color-preview {
    border-color: #E11111;
    box-shadow: 0 0 0 2px rgba(225, 17, 17, 0.3);
}

/* 单选颜色选项样式 */
.color-option input[type="radio"]:checked + .color-preview {
    border-color: #E11111;
    box-shadow: 0 0 0 2px rgba(225, 17, 17, 0.3);
    position: relative;
}

.color-option input[type="radio"]:checked + .color-preview::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #E11111;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 2px white;
}

/* 多选颜色选项样式 */
/* .color-option input[type="checkbox"]:checked + .color-preview {
    border-color: #E11111;
    box-shadow: 0 0 0 2px rgba(225, 17, 17, 0.3);
    position: relative;
}

.color-option input[type="checkbox"]:checked + .color-preview::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #E11111;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 2px white;
} */

/* 应用按钮 */
.filter-apply-btn {
    width: 100%;
    background: #DC1113;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px;
    margin-top: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: 600;
}

.filter-apply-btn:hover {
    background: #C10E0F;
}

/* 热销标签 */
.hot-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #E11111;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    z-index: 5;
}

/* 滚动条样式 */
.filter-dropdown::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-dropdown::-webkit-scrollbar-thumb {
    background: #D7D2C9;
    border-radius: 3px;
}

.filter-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9A958D;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .search-main-row {
        flex-direction: column;
    }
    
    .search-input-group {
        min-width: 100%;
    }
    
    .search-filters {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .search-filters {
        flex-direction: column;
    }
    
    .filter-item {
        width: 100%;
    }
    
    .filter-dropdown {
        width: 100%;
        left: 0;
    }
    
    .price-inputs {
        flex-wrap: wrap;
    }
    
    .price-inputs input {
        flex: 1;
        min-width: 80px;
    }
}



/* 重置按钮样式 */
.reset-filter {
    background: #F1F1F5 !important;
    border: 2px solid transparent !important;
    color: #343434 !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-filter:hover {
    background: #E11111 !important;
    color: white !important;
    border-color: #E11111 !important;
}

.reset-filter .filter-name {
    color: inherit;
}

.reset-filter i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.reset-filter:hover i {
    transform: rotate(180deg);
}

/* 确保重置按钮与其他筛选条件样式一致 */
.filter-item .reset-filter {
    background: #F1F1F5;
    border-radius: 10px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: space-between;
    border: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}