.rb-sidebar {
    position: sticky;
    top: 94px;

    align-self: start;

    max-height: calc(100vh - 118px);
    overflow-y: auto;

    background: var(--rb-surface);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius-lg);
}

.rb-sidebar__mobile-header {
    display: none;
}

.rb-sidebar__section {
    padding: 20px;

    border-bottom: 1px solid var(--rb-border);
}

.rb-sidebar__section:last-child {
    border-bottom: 0;
}

.rb-sidebar__title {
    margin-bottom: 12px;

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: var(--rb-text-muted);
}

.rb-sidebar__section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 8px;
}

.rb-sidebar__section-heading .rb-sidebar__title {
    margin: 0;
}

.rb-sidebar__section-heading > a {
    font-size: 13px;
    font-weight: 600;

    color: var(--rb-primary);
}

.rb-sidebar-user {
    display: flex;
    flex-direction: column;

    margin-bottom: 14px;
}

.rb-sidebar-user__label {
    margin-bottom: 3px;

    font-size: 12px;

    color: var(--rb-text-muted);
}

.rb-sidebar-links {
    display: grid;
    gap: 6px;

    margin-bottom: 16px;
}

.rb-sidebar-links a {
    padding: 8px 0;

    font-size: 14px;
    font-weight: 600;
}

.rb-sidebar-auth {
    margin-bottom: 14px;
}

.rb-sidebar-auth__register {
    display: block;

    margin-top: 10px;

    text-align: center;
    font-size: 13px;
    font-weight: 600;

    color: var(--rb-text-muted);
}

.rb-sidebar-search {
    display: grid;
    gap: 8px;
}

.rb-sidebar-search input {
    width: 100%;

    padding: 11px 12px;

    color: var(--rb-text);

    background: var(--rb-background);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius-sm);
    outline: none;
}

.rb-sidebar-search input:focus {
    border-color: var(--rb-primary);
}

.rb-sidebar-search button {
    padding: 10px 12px;

    font-weight: 700;

    color: #ffffff;
    background: var(--rb-dark);
    border: 0;
    border-radius: var(--rb-radius-sm);
}

.rb-category-tree {
    margin: 0;
    padding: 0;

    list-style: none;
}

.rb-category-tree__row {
    display: flex;
    align-items: center;

    min-height: 38px;
}

.rb-category-tree__link {
    flex: 1;

    padding: 8px 4px;

    font-size: 14px;
    font-weight: 600;
}

.rb-category-tree__item.is-active > .rb-category-tree__row
.rb-category-tree__link {
    color: var(--rb-primary);
}

.rb-category-tree__toggle {
    position: relative;

    width: 32px;
    height: 32px;

    background: transparent;
    border: 0;
    border-radius: 50%;
}

.rb-category-tree__toggle:hover {
    background: var(--rb-background);
}

.rb-category-tree__toggle span::before,
.rb-category-tree__toggle span::after {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 10px;
    height: 1px;

    content: "";

    background: var(--rb-text);
    transform:
        translate(-50%, -50%);
}

.rb-category-tree__toggle span::after {
    transform:
        translate(-50%, -50%)
        rotate(90deg);

    transition: transform 0.2s ease;
}

.rb-category-tree__item.is-open >
.rb-category-tree__row
.rb-category-tree__toggle
span::after {
    transform:
        translate(-50%, -50%)
        rotate(0);
}

.rb-category-tree__children {
    display: none;

    padding-left: 12px;
}

.rb-category-tree__item.is-open >
.rb-category-tree__children {
    display: block;
}

.rb-category-tree--level-1 {
    padding-left: 6px;

    border-left: 1px solid var(--rb-border);
}

.rb-category-tree--level-2 {
    padding-left: 10px;
}

.rb-category-tree--level-1
.rb-category-tree__link,
.rb-category-tree--level-2
.rb-category-tree__link {
    font-size: 13px;
    font-weight: 500;
}

.rb-sidebar-overlay {
    display: none;
}

@media (max-width: 1080px) {
    .rb-sidebar {
        position: fixed;
        z-index: 1001;
        top: 0;
        bottom: 0;
        left: 0;

        width: min(340px, 88vw);
        max-height: none;

        border: 0;
        border-radius: 0;

        transform: translateX(-105%);
        transition: transform 0.25s ease;

        box-shadow: var(--rb-shadow);
    }

    body.rb-sidebar-open .rb-sidebar {
        transform: translateX(0);
    }

    .rb-sidebar__mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;

        padding: 18px 20px;

        border-bottom: 1px solid var(--rb-border);
    }

    .rb-sidebar__close {
        width: 38px;
        height: 38px;

        font-size: 28px;
        line-height: 1;

        background: transparent;
        border: 0;
    }

    .rb-sidebar-overlay {
        position: fixed;
        z-index: 1000;
        inset: 0;

        display: block;

        pointer-events: none;

        opacity: 0;
        background: rgba(0, 0, 0, 0.55);

        transition: opacity 0.25s ease;
    }

    body.rb-sidebar-open .rb-sidebar-overlay {
        pointer-events: auto;

        opacity: 1;
    }
}