/* ——— Блок «Квартира + шахматка» на генплане ——— */

.proekt-chess-section {
    background-color: var(--color-neutral-0);
    color: var(--color-neutral-900);
}

.proekt-chess-section__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 84px 64px;
    box-sizing: border-box;
}

.proekt-chess-section__header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}

.proekt-chess-section__title {
    margin: 0;
    font-size: 32px;
    font-weight: 500;
    line-height: 40px;
    letter-spacing: -0.32px;
}

.proekt-chess-section__address {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-neutral-400);
}

.proekt-chess-section__layout {
    display: flex;
    flex-direction: column;
    gap: 48px;
    align-items: stretch;
}

.proekt-chess-section__detail,
.proekt-chess-section__aside {
    min-width: 0;
}

.proekt-chess-section__detail,
.proekt-chess-section__chess-content {
    position: relative;
}

.proekt-chess-section__detail-content,
.proekt-chess-section__chess-inner {
    min-width: 0;
}

.proekt-chess-section__preloader {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
}

.proekt-chess-section__preloader.is-visible {
    display: flex;
}

.proekt-chess-section.is-loading-detail .proekt-chess-section__preloader.js-proekt-chess-preloader-detail,
.proekt-chess-section.is-loading-chess .proekt-chess-section__preloader.js-proekt-chess-preloader-chess {
    display: flex;
}

.proekt-chess-section__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-neutral-200);
    border-top-color: var(--color-red-500);
    border-radius: 50%;
    animation: proekt-chess-spin 0.8s linear infinite;
}

@keyframes proekt-chess-spin {
    to {
        transform: rotate(360deg);
    }
}

.proekt-chess-section__chess-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    border-radius: 16px;
    background: var(--color-neutral-0);
}

.proekt-chess-section__chess-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.proekt-chess-section__chess-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--color-neutral-700);
    cursor: pointer;
}

.proekt-chess-section__filters {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
}

.proekt-chess-section__filter {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.proekt-chess-section__filter--rooms {
    flex: 0 1 auto;
}

.proekt-chess-section__filter--section {
    flex: 0 0 240px;
}

.proekt-chess-section__filter-label {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 14px;
    color: var(--color-neutral-400);
}

.proekt-chess-section__filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.proekt-chess-section__filter-chip {
    position: relative;
    display: inline-flex;
}

.proekt-chess-section__filter-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.proekt-chess-section__filter-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--color-neutral-100);
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: var(--color-neutral-700);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.proekt-chess-section__filter-chip-icon {
    display: none;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

.proekt-chess-section__filter-chip input:checked + span {
    background: #fdeded;
    color: var(--color-red-600);
    font-weight: 500;
}

.proekt-chess-section__filter-chip input:checked + span .proekt-chess-section__filter-chip-icon {
    display: block;
}

.proekt-chess-section__select-wrap {
    position: relative;
    width: 100%;
}

.proekt-chess-section__select {
    width: 100%;
    min-height: 44px;
    padding: 10px 40px 10px 16px;
    border: 1px solid var(--color-neutral-200);
    border-radius: 8px;
    background: var(--color-neutral-0);
    color: var(--color-neutral-900);
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    appearance: none;
    cursor: pointer;
}

.proekt-chess-section__select-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    background: url('./images/icon-chevron-down.svg') no-repeat center / 11.5px 6.5px;
    pointer-events: none;
}

.proekt-chess-section__overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: rgba(17, 17, 17, 0.48);
}

.proekt-chess-section__overlay[hidden] {
    display: none !important;
}

/* Tablet / mobile modal chess */
@media (max-width: 1279px) {
    .proekt-chess-section__inner {
        padding: 32px 32px 48px;
    }

    .proekt-chess-section__detail {
        width: 100%;
        max-width: none;
    }

    .proekt-chess-section__layout {
        gap: 0;
    }

    .proekt-chess-section__aside {
        display: none;
    }

    .proekt-chess-section__chess-close {
        display: inline-flex;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__aside {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: fixed;
        inset: 0;
        z-index: 130;
        padding: 32px;
        overflow-y: auto;
        box-sizing: border-box;
        background: var(--color-neutral-0);
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__chess-panel {
        width: 100%;
        max-width: none;
        min-height: 0;
        padding: 0;
        border-radius: 0;
        gap: 24px;
        align-items: center;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__chess-head {
        align-self: flex-end;
        width: 100%;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__filters {
        flex-direction: row;
        align-items: flex-start;
        gap: 48px;
        width: 576px;
        max-width: 100%;
        align-self: center;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__filter--section {
        flex: 0 0 240px;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__chess-content {
        width: 100%;
        align-self: stretch;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__overlay {
        display: block;
    }
}

@media (max-width: 767px) {
    .proekt-chess-section__inner {
        padding: 24px 16px 32px;
    }

    .proekt-chess-section__title {
        font-size: 24px;
        line-height: 32px;
        letter-spacing: -0.12px;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__aside {
        padding: 24px 16px 32px;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__chess-panel {
        align-items: stretch;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__filters {
        flex-direction: column;
        gap: 16px;
        width: 100%;
        align-self: stretch;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__filter {
        width: 100%;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__filter--rooms {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__filter--section {
        flex: none;
        width: 100%;
    }

    .proekt-chess-section.is-chess-open .proekt-chess-section__filter-options {
        width: 100%;
    }

    .proekt-chess-section.is-chess-open .chess-2026 {
        gap: 24px;
    }

    .proekt-chess-section.is-chess-open .chess-2026__legend {
        order: -1;
        padding-top: 0;
    }

    .proekt-chess-section.is-chess-open .chess-2026__body {
        order: 0;
        width: 100%;
    }
}

/* Desktop: фиксированная ширина карточки и растягивающаяся шахматка */
@media (min-width: 1280px) {
    .proekt-chess-section__layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .proekt-chess-section__detail {
        flex: 0 0 548px;
        width: 548px;
        max-width: 548px;
    }

    .proekt-chess-section__aside {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .proekt-chess-section__chess-panel {
        width: 100%;
        padding: 24px 0;
    }

    .proekt-chess-section__filters {
        width: 576px;
        max-width: 100%;
        align-self: center;
    }
}

/* Desktop: chess always visible */
@media (min-width: 1280px) {
    .proekt-chess-section__overlay {
        display: none !important;
    }
}
