.ms-cat-filter {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 20px;
}

.ms-cat-filter__header {
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.ms-cat-filter__items {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

/* Parent group */
.ms-cat-group {
    display: flex;
    flex-direction: column;
}

.ms-cat-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 4px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    user-select: none;
    transition: background .1s;
}

.ms-cat-group__header:hover {
    background: #fafafa;
}

.ms-cat-group__name {
    flex: 1;
}

.ms-cat-group__arrow {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #aaa;
}

.ms-cat-group__arrow::after {
    content: '';
    border: solid #aaa;
    border-width: 0 1.5px 1.5px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(-45deg);
    margin-top: 1px;
    transition: transform .2s, margin .2s;
}

.ms-cat-group.open .ms-cat-group__arrow::after {
    transform: rotate(45deg);
    margin-top: -3px;
}

.ms-cat-group__children {
    display: none;
    flex-direction: column;
    padding-left: 12px;
}

.ms-cat-group.open .ms-cat-group__children {
    display: flex;
}

/* Filter items (both leaf and children) */
.ms-cat-filter__item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 4px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    user-select: none;
    transition: background .1s;
}

.ms-cat-filter__item:hover {
    background: #fafafa;
}

.ms-cat-filter__item input[type="checkbox"] {
    display: none;
}

.ms-cat-filter__name {
    flex: 1;
}

.ms-cat-filter__item.active .ms-cat-filter__name {
    color: #d32f2f;
    font-weight: 700;
}

/* Tags */
.ms-cat-filter__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.ms-cat-filter__tag {
    background: #f0f0f0;
    border-radius: 20px;
    padding: 3px 10px 3px 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ms-cat-filter__tag a {
    color: #999;
    text-decoration: none;
    font-size: 16px;
    line-height: 1;
}

.ms-cat-filter__tag a:hover {
    color: #333;
}

/* Actions */
.ms-cat-filter__actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.ms-cat-filter__apply {
    flex: 1;
    background: #d32f2f;
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s;
}

.ms-cat-filter__apply:hover {
    background: #b71c1c;
}

.ms-cat-filter__clear {
    background: #f5f5f5;
    color: #555;
    border: 1px solid #e0e0e0;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background .15s;
}

.ms-cat-filter__clear:hover {
    background: #ebebeb;
    color: #333;
}
