.bew-category-tree {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #f3f4f6;
    overflow: hidden;
}

.bew-category-tree__header {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
}

.bew-category-tree__header h3 {
    font-size: 18px;
    font-weight: 800;
    color: #181818;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}

.bew-category-tree__nav {
    padding: 8px;
}

.bew-category-tree__category {
    margin-bottom: 4px;
}

/* Rows */
.bew-category-tree__category-row,
.bew-category-tree__subcategory-row {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Toggle buttons */
.bew-category-tree .bew-category-tree__toggle {
    all: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.bew-category-tree__toggle:hover {
    background: #f3f4f6;
}

.bew-category-tree__toggle svg {
    width: 14px;
    height: 14px;
    color: #9ca3af;
    transition: transform 0.2s;
    pointer-events: none;
}

.bew-category-tree__subcategory-row .bew-category-tree__toggle svg {
    width: 12px;
    height: 12px;
}

.bew-category-tree__toggle--expanded svg {
    transform: rotate(90deg);
}

/* Links */
.bew-category-tree__category-link {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    padding: 6px 4px;
    border-radius: 4px;
    transition: color 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Align items without toggle to match items with toggle */
.bew-category-tree__category-row > .bew-category-tree__category-link:first-child {
    margin-left: 26px;
}

.bew-category-tree__category-link:hover {
    color: #ED2024;
}

.bew-category-tree__category-link--active {
    color: #ED2024;
    font-weight: 700;
}

.bew-category-tree__subcategory-link {
    flex: 1;
    font-size: 14px;
    color: #4b5563;
    text-decoration: none;
    padding: 4px 0;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bew-category-tree__subcategory-row > .bew-category-tree__subcategory-link:first-child {
    margin-left: 24px;
}

.bew-category-tree__subcategory-link:hover {
    color: #ED2024;
}

.bew-category-tree__subcategory-link--active {
    color: #ED2024;
    font-weight: 700;
    background: rgba(237, 32, 36, 0.05);
}

.bew-category-tree__leaf-link {
    display: block;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    padding: 4px 0;
    line-height: 1.3;
    transition: color 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bew-category-tree__leaf-link:hover {
    color: #ED2024;
}

/* Counts */
.bew-category-tree__count {
    font-size: 10px;
    color: #9ca3af;
    padding-right: 8px;
    flex-shrink: 0;
}

/* Collapsible sections */
.bew-category-tree__children {
    padding-left: 26px;
    display: none;
}

.bew-category-tree__children.bew-category-tree__children--open {
    display: block;
}

.bew-category-tree__leaves {
    padding-left: 32px;
    display: none;
}

.bew-category-tree__leaves.bew-category-tree__leaves--open {
    display: block;
}
