.inter {
    margin-top: 140px;
    padding: 0 20px 20px;
    width: 100%;
    height: calc(100vh - 140px);
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
}

.inter-aside {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    min-height: 0; /* Добавляем это */

    &.hidden {
        display: none;
    }
}

.inter-aside-block {
    background-color: var(--accent-background);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
}

.inter-aside-list {
    background-color: var(--accent-background);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px;
    flex-grow: 1;
    overflow-x: hidden;
    overflow-y: auto;

    ::-webkit-scrollbar {
        width: 12px;
    }
    
    /* Track */
    &::-webkit-scrollbar-track {
        background: var(--accent-background);
    }
    
    &::-webkit-scrollbar-button {
        background: var(--background);
        height: 4px;
    }
       
    /* Handle */
    &::-webkit-scrollbar-thumb {
        width: 6px;
        background: var(--text);
        border-radius: 20px;
        border: 3px solid var(--background);
    }
      
    /* Handle on hover */
    &::-webkit-scrollbar-thumb:hover {
        background: var(--red); 
    }

    max-height: 100%; /* Добавляем это */
    min-height: 0; /* Добавляем это */
}

.aside-list-item {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.3s ease;

    &:hover {
        background-color: var(--background);
    }
}

.aside-list-item-title {
    font-weight: bold;
    color: var(--accent-text);
    line-height: 1.3;
}

.aside-list-item-subtitle {
    font-size: 15px;
    color: var(--text);
    line-height: 1.4;
}

.aside-list-item.active {
    border: 1px solid #4A4B4D;
}
.aside-list-item.active .aside-list-item-title{
    color: #E31E24;
}

.aside-list-item.active .aside-list-item-subtitle{
    color: #fff;
}

.map-wrapper {
    &.full-width {
        grid-column: 1 / -1;
    }
}

.map {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background-color: var(--accent-background);
    border: 1px solid var(--border);
    overflow: hidden;
}
.map iframe{
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

.map-btns {
    display: none;
}

.custom-marker {
    position: relative;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    cursor: pointer;
}
.balloon {
    position: absolute;
    top: 50%;
    right: 65px;
    transform: translateY(-53%);
    width: 320px;
    z-index: 1000;
}
.balloon-content {
    position: relative;
    background: var(--accent-background);
    z-index: 1;
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 20px;
}
.dark-theme .balloon-content {
    background: var(--accent-background);
}
.balloon-arrow {
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
}
.balloon-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 16px
}
.balloon-close-btn img{
    max-width: 40px;
    max-height: 40px;
}
.ballon-text{
    display: flex;
    justify-content: space-between;
    gap: 5px;
    margin-bottom: 4px;
}
.ballon-text b,
.ballon-text p{
    font-size: 15px;
    line-height: 140%;
    font-weight: 600;
    color: #A4A5A7;
}
.ballon-text p{
    color: var(--accent-text);
}
.dark-theme .ballon-text p{
    color: var(--accent-text);
}
.balloon-footer{
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
}
.balloon-footer .screen-card-btn{
    padding: 5px 20px;
}
.balloon-footer .screen-card-btn-icon{
    height: 36px;
}
.ymaps3x0--marker.active{
    z-index: 2 !important;
}
.map-districts{
    max-height: 500px;
    overflow: auto !important;
}
.selected-screen h6,
.selected-screen p,
.selected-screen span{
    color: var(--accent-text);
}
.selected-screen h6{
    font-size: 40px;
    line-height: 115%;
    font-weight: 800;
    margin-bottom: 8px;
}
.selected-screen p{
    line-height: 140%;
}
.selected-screen.inter-aside-block span{
    margin-bottom: 12px;
    display: block;
}
.selected-screen .aside-link{
    padding: 5px 20px;
}

@media screen and (max-width: calc(1200px - 1px)) {
    .inter {
        grid-template-columns: 1fr 2fr;
    }
}

/* 768px - 992px */
@media screen and (max-width: calc(992px - 1px)) {
    .inter {
        grid-template-columns: 5fr 7fr;
        grid-template-rows: 1fr auto;
    }
    .inter-aside-list {
        scrollbar-width: thin;
        scrollbar-color: #888 #f0f0f0;
    }
    .map-btns {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        grid-column: span 2;
    }
    .map-btn {
        padding-block: 15px;
        background-color: var(--accent-background);
        border-radius: 10px;

        color: var(--text);
        border: 1px solid var(--border);

        &.active {
            color: var(--accent-text);
            background:
                linear-gradient(var(--accent-background) 0 0) padding-box,
                linear-gradient(120deg, var(--accent-background) 20%, var(--red) 100%) border-box;
            border: 1px solid transparent;
        }
    }
}

/* 576px - 768px */
@media screen and (max-width: calc(768px - 1px)) {
    
}

/* 320px - 576px */
@media screen and (max-width: calc(576px - 1px)) {
    .balloon{
        width: 250px;
    }
    .ballon-text b, .ballon-text p{
        font-size: 13px;
    }
    .balloon-footer .screen-card-btn{
        padding: 5px 15px;
        font-size: 15px;
    }
    .balloon-img{
        height: 130px;
    }
    .balloon-content{
        padding: 15px;
    }
    .inter {
        position: relative;
    }
    .inter-aside {
        position: absolute;
        top: 0;
        left: 20px;
        transition: all 0.3s ease;
        z-index: 1;
        width: calc(100% - 40px);
        height: calc(100% - 90px);
        background-color: var(--background);

        &.hidden {
            display: flex;
            left: -100%;
        }
           
    }
    .map-wrapper {
        grid-column: 1 / -1;
    }
}