/* 搜索页面筛选功能专用样式 */
/* 完全基于 categories-filter.css 设计稿样式，使用 search- 前缀 */

/* 搜索页面筛选侧边栏样式 */
.search-filter-sidebar {
    background: #fff;
    margin-bottom: 2rem;
    width: 240px;
    flex-shrink: 0;
    padding-right: 30px;
    position: sticky; /* 粘性定位 */
    top: 20px;  /* 距离顶部20px */
    z-index: 100;  /* 确保在其他元素之上 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 300;
}

/* 移动端布局调整 - 使用更具体的选择器避免冲突 */
@media (max-width: 991.98px) {
    .search-page .d-flex {
        flex-direction: column;
    }
    
    .search-page .flex-grow-1 {
        width: 100%;
    }
    
    .search-filter-sidebar {
        position: static;  /* 移动端取消固定定位 */
        top: auto;
    }
    
    /* 为移动端底部按钮预留空间 */
    body {
        padding-bottom: 80px;
    }
}

/* 移动端底部筛选按钮 */
.search-mobile-filter-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    z-index: 1000;
}

.search-mobile-filter-btn {
    width: 100%;
    background: #2a292f;
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    opacity: 1;
}

.search-mobile-filter-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.search-mobile-filter-btn:hover {
    background: rgba(42, 41, 47, 0.8);
    color: white;
}

.search-mobile-filter-btn:focus {
    background: rgba(42, 41, 47, 0.8);
    color: white;
    box-shadow: none;
}

/* 移动端 Offcanvas 样式 */
.offcanvas-start {
    width: 280px;
}

.offcanvas-header {
    background: #000;
    color: white;
    /* border-bottom: 1px solid #333; */
}

.offcanvas-title {
    font-weight: 300;
    font-size: 18px;
}

.btn-close {
    filter: invert(1);
}

.search-btn-close-custom {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.search-btn-close-custom:hover {
    opacity: 0.7;
}

.search-btn-close-custom:focus {
    outline: none;
    box-shadow: none;
}

.offcanvas-body {
    background: #000;
    color: white;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 300;
}

/* 移动端筛选内容样式 */
.offcanvas-body .search-filter-section {
    border-bottom: 1px solid #444;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.offcanvas-body .search-filter-header {
    background: transparent;
    border: none;
    color: white;
    padding: 0;
    font-weight: 300;
    font-size: 16px;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.offcanvas-body .search-filter-header:focus {
    color: white;
    box-shadow: none;
}

.offcanvas-body .search-filter-header span:after {
    border-color: white;
}

.offcanvas-body .search-filter-content {
    margin-top: 15px;
}

.offcanvas-body .form-check {
    margin-bottom: 12px;
}

.offcanvas-body .form-check-input {
    background-color: transparent;
    border: 1px solid #666;
}

.offcanvas-body .form-check-input:checked {
    background-color: white;
    border-color: white;
}

.offcanvas-body .form-check-input:focus {
    border-color: #7292a9;
    box-shadow: 0 0 0 0.2rem rgba(114, 146, 169, 0.25);
}

.offcanvas-body .form-check-label {
    color: #b1b1b1 !important;
    font-size: 14px;
    font-weight: 300;
    margin-left: 8px;
}

.offcanvas-body .form-check-input:checked + .form-check-label {
    color: white !important;
}

.offcanvas-body .search-filter-search-btn {
    background: white;
    border: none;
    color: black;
    padding: 12px 20px;
    border-radius: 0;
    font-weight: 300;
    font-size: 16px;
    width: 100%;
}

.offcanvas-body .search-filter-search-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    color: black;
}

.offcanvas-body .search-filter-search-btn .badge {
    background: #2a292f;
    color: white;
    font-weight: normal;
}

/* 筛选区块 */
.search-filter-section {
    border-bottom: 1px solid #f1f3f4;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.search-filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 筛选标题按钮 */
.search-filter-header {
    width: 100%;
    background: none;
    border: none;
    padding: 0.75rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 300;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
}

.search-filter-header:hover {
    color: #333;
}

.search-filter-header:focus {
    color: #333;
    outline: none;
    box-shadow: none;
}

.search-filter-header:active {
    color: #333;
}

.search-filter-header span:after {
    content: "";
    display: block;
    border-top: 1px solid #2b2b2b;
    border-right: 1px solid #2b2b2b;
    width: 13px;
    height: 13px;
    position: absolute;
    top: 6px;
    bottom: 0;
    right: 8px;
    margin: auto 0;
    transform: rotate(135deg);
    transition: transform 0.3s ease;
    transform-origin: 75% 25%;
}

.search-filter-header[aria-expanded="true"] span:after {
    transform: rotate(315deg);
}

/* 筛选内容区域 */
.search-filter-content {
    padding-top: 0.5rem;
    font-weight: 300;
}

/* 表单复选框和单选框样式 */
.search-filter-content .form-check {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.search-filter-content .form-check:last-child {
    margin-bottom: 0;
}

.search-filter-content .form-check-input {
    margin-top: 0.125rem;
}

.search-filter-content .form-check-label {
    font-size: 0.9rem;
    color: #495057;
    cursor: pointer;
    line-height: 1.4;
    font-weight: 300;
}

.search-filter-content .form-check-input:checked + .form-check-label {
    color: #2a292f;
    font-weight: 400;
}

/* 检索按钮样式 */
.search-filter-search-btn {
    background: #2a292f;
    border: none;
    color: white;
    font-weight: 300;
    padding: 0.75rem 1rem;
    border-radius: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.search-filter-search-btn:hover {
    background: rgba(42, 41, 47, 0.8);
}

.search-filter-search-btn:focus {
    outline: none;
    box-shadow: none;
}

.search-filter-search-btn .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background-color: #7292a9;
    color: white;
    font-weight: normal;
}

/* 移动端隐藏筛选菜单 */
@media (max-width: 991.98px) {
    .search-filter-sidebar {
        display: none !important;
    }
}

/* 响应式调整 */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .search-filter-content .form-check-label {
        font-size: 0.85rem;
    }
    
    .search-filter-header {
        font-size: 0.95rem;
        padding: 0.6rem 0;
    }
}

/* 选中状态的视觉反馈 */
.form-check-input:checked {
    background-color: #2a292f;
    border-color: #2a292f;
}

.form-check-input:focus {
    border-color: #2a292f;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(42, 41, 47, 0.25);
}

.form-check-input:hover {
    background-color: rgba(42, 41, 47, 0.8);
}

/* 兼容性：保持对原有类名的支持 */
.categories-filter-sidebar {
    background: #fff;
    margin-bottom: 2rem;
    width: 240px;
    flex-shrink: 0;
    padding-right: 30px;
    position: sticky;
    top: 20px;
    z-index: 100;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 300;
}

.categories-filter-section {
    border-bottom: 1px solid #f1f3f4;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.categories-filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.categories-filter-header {
    width: 100%;
    background: none;
    border: none;
    padding: 0.75rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 300;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
}

.categories-filter-header:hover {
    color: #333;
}

.categories-filter-header:focus {
    color: #333;
    outline: none;
    box-shadow: none;
}

.categories-filter-header:active {
    color: #333;
}

.categories-filter-header span:after {
    content: "";
    display: block;
    border-top: 1px solid #2b2b2b;
    border-right: 1px solid #2b2b2b;
    width: 13px;
    height: 13px;
    position: absolute;
    top: 6px;
    bottom: 0;
    right: 8px;
    margin: auto 0;
    transform: rotate(135deg);
    transition: transform 0.3s ease;
    transform-origin: 75% 25%;
}

.categories-filter-header[aria-expanded="true"] span:after {
    transform: rotate(315deg);
}

.categories-filter-content {
    padding-top: 0.5rem;
    font-weight: 300;
}

.categories-filter-content .form-check {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.categories-filter-content .form-check:last-child {
    margin-bottom: 0;
}

.categories-filter-content .form-check-input {
    margin-top: 0.125rem;
}

.categories-filter-content .form-check-label {
    font-size: 0.9rem;
    color: #495057;
    cursor: pointer;
    line-height: 1.4;
    font-weight: 300;
}

.categories-filter-content .form-check-input:checked + .form-check-label {
    color: #2a292f;
    font-weight: 400;
}

.categories-filter-search-btn {
    background: #2a292f;
    border: none;
    color: white;
    font-weight: 300;
    padding: 0.75rem 1rem;
    border-radius: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.categories-filter-search-btn:hover {
    background: rgba(42, 41, 47, 0.8);
}

.categories-filter-search-btn:focus {
    outline: none;
    box-shadow: none;
}

.categories-filter-search-btn .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background-color: #7292a9;
    color: white;
    font-weight: normal;
}

.categories-mobile-filter-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    z-index: 1000;
}

.categories-mobile-filter-btn {
    width: 100%;
    background: #2a292f;
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    opacity: 1;
}

.categories-mobile-filter-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.categories-mobile-filter-btn:hover {
    background: rgba(42, 41, 47, 0.8);
    color: white;
}

.categories-mobile-filter-btn:focus {
    background: rgba(42, 41, 47, 0.8);
    color: white;
    box-shadow: none;
}

.categories-btn-close-custom {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.categories-btn-close-custom:hover {
    opacity: 0.7;
}

.categories-btn-close-custom:focus {
    outline: none;
    box-shadow: none;
}

@media (max-width: 991.98px) {
    .search-page .d-flex {
        flex-direction: column;
    }
    
    .search-page .flex-grow-1 {
        width: 100%;
    }
    
    .search-filter-sidebar {
        position: static;
        top: auto;
    }
    
    .categories-page .d-flex {
        flex-direction: column;
    }
    
    .categories-page .flex-grow-1 {
        width: 100%;
    }
    
    .categories-filter-sidebar {
        position: static;
        top: auto;
    }
    
    body {
        padding-bottom: 80px;
    }
    
    .search-filter-sidebar {
        display: none !important;
    }
    
    .categories-filter-sidebar {
        display: none !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .search-filter-content .form-check-label {
        font-size: 0.85rem;
    }
    
    .search-filter-header {
        font-size: 0.95rem;
        padding: 0.6rem 0;
    }
    
    .categories-filter-content .form-check-label {
        font-size: 0.85rem;
    }
    
    .categories-filter-header {
        font-size: 0.95rem;
        padding: 0.6rem 0;
    }
}