/* Projects map — layout like alfahorizont.ru */
.projects-map {
    position: relative;
    z-index: 1;
    background: #fff;
    overflow: hidden;
}

.projects-map,
.projects-map *,
.menu-maps,
.ymap-info-popup,
.projects-popup,
.projects-popup * {
    font-family: "Montserrat", sans-serif;
}

.projects-map__inner {
    display: grid;
    grid-template-columns: minmax(280px, 33.333%) minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: stretch;
    min-height: 640px;
}

.projects-map__sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    align-self: stretch;
    padding: 40px 30px 40px;
    border-right: 1px solid #e5e5e5;
    box-sizing: border-box;
}

.projects-map__title {
    margin-bottom: 48px;
    font-weight: 700;
    font-size: 36px;
    line-height: 120%;
    letter-spacing: -0.01em;
    color: #323232;
}

.menu-maps {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    font-weight: 600;
    font-size: 20px;
    line-height: 140%;
    color: #323232;
}

.menu-maps li {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0 0 36px;
    padding: 0 0 16px;
    border-bottom: 2px solid #e5e5e5;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}

.menu-maps li span {
    width: 18px;
    min-width: 18px;
    height: 18px;
    margin-right: 14px;
    border-radius: 50%;
}

.menu-maps li:after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -2px;
    left: 0;
    display: block;
    width: 0;
    height: 2px;
    transition: width 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}

.menu-maps li:hover:after,
.menu-maps li.active:after {
    width: 100%;
}

.menu-maps li:first-child span,
.menu-maps li:first-child:after {
    background-color: #3700ff;
}

.menu-maps li:nth-child(2) span,
.menu-maps li:nth-child(2):after {
    background: #00b2ff;
}

.menu-maps li:last-child span,
.menu-maps li:last-child:after {
    background: #26e2d7;
}

.menu-maps li.active:first-child {
    color: #3700ff;
}

.menu-maps li.active:nth-child(2) {
    color: #00b2ff;
}

.menu-maps li.active:last-child {
    color: #26e2d7;
}

.projects-map__all {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 56px;
    margin-top: 24px;
    padding: 0 36px 0 28px;
    border: 1px solid #e5e5e5;
    border-radius: 999px;
    background: #fff;
    font-family: "Montserrat", sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 56px;
    color: #323232;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.4s, border-color 0.4s, background 0.4s;
}

.projects-map__all-dot {
    width: 12px;
    height: 12px;
    margin-right: 14px;
    border-radius: 50%;
    background: #3700ff;
    transition: background 0.4s;
}

.projects-map__all:hover {
    color: #fff;
    background: #3700ff;
    border-color: #3700ff;
}

.projects-map__all:hover .projects-map__all-dot {
    background: #fff;
}

.projects-map__map-wrap {
    position: relative;
    align-self: stretch;
    min-height: 640px;
    height: 100%;
    background: #f5f5f5;
}

#yandexMap {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Light gray map look like alfahorizont */
#yandexMap .ymaps-2-1-map [class*="ground-pane"],
#yandexMap [class*="ground-pane"] {
    filter: grayscale(1) brightness(1.08) contrast(0.92) saturate(0);
}

.ymap-marker {
    width: 53px;
    height: 53px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ymap-marker img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ymap-cluster {
    width: 53px;
    height: 53px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
}

.ymap-cluster__count {
    margin-top: -10px;
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.ymap-info-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    z-index: 1000;
    min-width: 220px;
    max-width: 320px;
    margin-bottom: 10px;
    padding: 14px 18px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(-50%);
    pointer-events: auto;
    font-size: 14px;
    line-height: 1.5;
    color: #323232;
}

.ymap-info-popup p {
    margin: 0 0 6px;
}

.ymap-info-popup p:last-child {
    margin-bottom: 0;
}

.ymap-info-popup .text__xs {
    font-size: 12px;
    font-weight: 700;
}

.ymap-info-popup__arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
    transform: translateX(-50%);
}

.projects-popup {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(24, 29, 29, 0.55);
}

.projects-popup.is-open {
    display: flex;
}

.projects-popup__dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 28px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.projects-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: #323232;
    cursor: pointer;
}

.projects-popup__cat {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #3700ff;
}

.projects-popup__place {
    margin-bottom: 8px;
    font-size: 13px;
    color: #757575;
}

.projects-popup__title {
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    color: #181d1d;
}

.projects-popup__desc {
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.5;
    color: #4a4a4a;
}

.projects-popup__image {
    display: block;
    width: 100%;
    max-height: 240px;
    margin-bottom: 16px;
    border-radius: 8px;
    object-fit: cover;
}

.projects-popup__link {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: #3700ff;
    text-decoration: none;
}

.projects-popup__link:hover {
    text-decoration: underline;
}

body.projects-popup-open {
    overflow: hidden;
}

@media (max-width: 1023px) {
    .projects-map__inner {
        grid-template-columns: 1fr;
    }

    .projects-map__sidebar {
        padding: 32px 20px 24px;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
    }

    .menu-maps {
        flex-direction: row;
        overflow-x: auto;
        gap: 0;
    }

    .menu-maps li {
        margin-right: 20px;
        margin-bottom: 16px;
    }

    .projects-map__map-wrap {
        position: relative;
        height: 480px;
        min-height: 480px;
    }

    #yandexMap {
        position: absolute;
        inset: 0;
        height: 100%;
        min-height: 100%;
    }
}
