/* 外层容器 */
.wc-cat-filter {
    width: 240px;
    border: 1px solid #ddd;
    padding: 0;
    background: #fff;
    font-family: inherit;
    margin-bottom:20px;
}

/* 标题 */
.wc-cat-filter .filter-title {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    padding: 15px;
    border-bottom: 1px solid #ddd;
}
.wc-cat-filter .filter-title svg{
    display: none;
    width: 20px;
    height: 20px;
    background-color: #000000;
    fill: #ffffff;
    border-radius: 5px;
    margin-left: 5px;
    cursor: pointer;
}

/* 分类列表 */
.filter-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    --label-svg-flex: 0.5;
    --label-span-flex: 2;
}
.filter-cat-list svg{
    width: 11px;
    height: 13px;
    fill: currentColor;
    margin: 5px;
    flex: var(--label-svg-flex);
}
.filter-cat-list .level-0{
    --level:0;
    border-bottom: 1px solid #eee;
}
.filter-cat-list .level-0 a span{
    flex: 1;
}
.filter-cat-list .level-0 ul{
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.filter-cat-list .level-0 ul.open{
    max-height: 600px;
}
.filter-cat-list .level-1{
    --level:1;
}

/* --- 兼容 label + a 两种结构 --- */
.filter-cat-list li label,
.filter-cat-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    color: #222;
    text-decoration: none;
    white-space: break-spaces;
    word-break: break-all;
}

/* hover */
.filter-cat-list li label:hover,
.filter-cat-list li a:hover {
    color: #f6985b;
}

/* checkbox */
.filter-cat-list input[type="checkbox"] {
    transform: scale(1.2);
    flex: 0.1;
}

/* 子分类缩进 */
.filter-cat-list li label,
.filter-cat-list li a {
    padding-left: calc(15px + var(--level, 0) * 12px);
}

.filter-cat-list li label span{
    flex: var(--label-span-flex);
}

/* active 高亮（复选和单选都适用） */
.filter-cat-list li.active > label,
.filter-cat-list li.active > a {
    color: #f6985b;
    font-weight: 600;
}

/* 复选框黑底白字（单选不影响） */
.filter-cat-list input[type="checkbox"]:checked + label,
.filter-cat-list input[type="checkbox"]:checked ~ label {
    background: #000;
    color: #fff !important;
    font-weight: 600;
}

.filter-cat-list input[type="checkbox"]:checked {
    accent-color: #fff;
}
@media (max-width: 1100px) {
    .wc-cat-filter{
        width: 200px;
    }
}
@media (max-width: 900px) {
    .wc-cat-filter{
        width: 100%;
    }
    .wc-cat-filter .filter-title{
        justify-content: center;
    }
    .wc-cat-filter .filter-title svg.active{
        display: unset;
    }
    .filter-cat-list{
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }
    .filter-cat-list.active{
        max-height: 200px;
        overflow-y: auto;
    }
    .filter-cat-list li label:not(:has(svg)) span{
        flex: calc(var(--label-span-flex) + var(--label-svg-flex));
    }
}