:root {
    --header-height: 72px; 
}

.legal-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.content-container {
    min-width: 100%;
    padding: 0 16px;
}

.content-container h2 {
    /* Костыль. Фиксит погрешность скролла до заголовка */
    scroll-margin-top: 50rem;
}

.header {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 0;
    box-sizing: border-box; 
    background: #fff;
    box-shadow: inset 0 -1px 0 #0000001a;
    z-index: 100;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.header-container {
    padding: 8px 16px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header.is-menu-open {
    box-shadow: none;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.header-brand .logo-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: brightness(0)
            saturate(100%)
            invert(64%)
            sepia(11%)
            saturate(6717%)
            hue-rotate(342deg)
            brightness(97%)
            contrast(92%);
}

.header-brand .logo-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--bs-primary);
}




@keyframes expand-menu {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.menu-container {
    display: none;
    position: fixed;
    top: var(--header-height);
    right: 0;
    left: 0;
    background-color: #fff;/* #f6f6f9; */
    overflow: hidden;
    overflow-y: auto;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    z-index: 99;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0 32px 0;
    animation: expand-menu 0.3s ease;
    max-height: calc(100vh - var(--header-height));
}

.menu-container.is-menu-open {
    display: block;
}

.expanded-menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px; 
    gap: 8px;
}

.menu-items-wrapper {
    width: 100%;
    padding: 0 16px;
    border-radius: 16px;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    text-decoration: none;
}

.menu-item.active {
    pointer-events: none;
    text-decoration: none;
    color: var(--bs-primary);
}

.menu-item .menu-item__text {
    font-weight: 600; 
    color: var(--color-text-secondary);
}

.menu-item .menu-item__arrow {
    color: var(--bs-gray-600);
}




.legal-menu {
    display: none;
}


.show-on-mobile {
    display: block;
}


@media (min-width: 1024px) {
    
    .legal-container {
        display: grid;
        grid-template-columns: 230px 1fr;
        column-gap: 32px;
        align-items: start;
    }
    
    .content-container {
        padding: 0;
    }
    
    
    
    .legal-menu {
        display: block;
        position: sticky;
        top: calc(var(--header-height) + 24px);
        text-align: start;
    }
    .legal-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .legal-menu__item {
        border-right: 1px solid rgba(0, 0, 0, 0.1);
    }
    .legal-menu__item a {
        display: inline-block;
        padding: 0.75rem 1.25rem;
        color: var(--color-text-secondary);
        text-decoration: none;
        font-weight: 500;
        transition: all 0.2s;
    }
    .legal-menu__item a:hover {
        color: var(--bs-primary);
    }
    .legal-menu__item a.active {
        font-weight: 600;
        color: #000;
        pointer-events: none;
    }
    .legal-menu__item:has(a.active) {
        border-right: 1px solid var(--bs-primary);
    }
    
    .show-on-mobile {
        display: none;
    }

    
    .container-max-width {
        max-width: 1400px;
        margin: 0 auto;
    }
    
}