/* Страница «Ипотека» — вёрстка по Figma (узлы 161:12195 / 161:12249 / 161:12302) */

body.mortgage-page {
    background: #F5F5F5;
}

/* ---- Баннер ---- */

.mortgage-banner-block {
    margin-bottom: 24px;
}

.mortgage-banner {
    width: 100%;
    display: flex;
    gap: 16px;
    height: 270px;
}

.mortgage-banner__info {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 18px;
    align-items: stretch;
    overflow: hidden;
    border-radius: 4px;
    background: var(--Surface-White, #FFFFFF);
    padding-right: 16px;
}

.mortgage-banner__illustration {
    flex-shrink: 0;
    width: 349px;
    height: 270px;
    object-fit: cover;
    object-position: 45% 50%;
    display: block;
}

.mortgage-banner__text {
    flex: 1;
    min-width: 0;
    padding: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.mortgage-banner__title {
    margin: 0;
    font-size: 22px;
    font-weight: 500;
    line-height: 24px;
    color: var(--Text-Primary, #1E2433);
}

.mortgage-banner__desc {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    color: var(--Text-Primary, #1E2433);
}

.mortgage-banner__promo {
    position: relative;
    flex: 0 0 446.67px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--Brand-Secondary, #454452);
}

.mortgage-banner__calc-icon {
    position: absolute;
    width: 252px;
    height: 252px;
    left: calc(50% + 166.33px - 126px);
    top: calc(50% - 9px - 126px);
}

.mortgage-banner__arrow {
    position: absolute;
    left: 172px;
    top: 66px;
    width: 101px;
    height: 97px;
}

.mortgage-banner__promo-title {
    position: absolute;
    left: 20px;
    top: 46px;
    transform: translateY(-50%);
    width: 338px;
    margin: 0;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
    color: #FFFFFF;
}

.mortgage-banner__promo-sub {
    position: absolute;
    left: 20px;
    top: 91px;
    transform: translateY(-50%);
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: #FFFFFF;
    white-space: nowrap;
}

.mortgage-banner__banks-icon {
    position: absolute;
    left: 19.67px;
    top: calc(50% - 9px - 16px);
    width: 88px;
    height: 32px;
}

.btn.mortgage-banner__promo-btn {
    position: absolute;
    left: 20px;
    top: 198px;
    width: 406px;
}

/* ---- Банки ---- */

.mortgage-banks-block {
    margin-bottom: 60px;
}

.mortgage-banks {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12.8px;
}

.mortgage-banks__card {
    height: 114px;
    border-radius: 8px;
    background: var(--Surface-White, #FFFFFF);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mortgage-banks__card img {
    max-width: 85%;
    max-height: 82%;
    object-fit: contain;
    display: block;
}

.mortgage-banks__card .mortgage-banks__alfa {
    width: 79%;
}

/* ---- Калькулятор ---- */

.mortgage-calc-block {
    margin-bottom: 77px;
}

.mortgage-calc__title {
    margin: 0 0 20px;
    width: 100%;
    line-height: 38px;
    color: #1E2529;
}

.mortgage-calc {
    width: 100%;
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.mortgage-calc__inputs {
    flex: 1;
    min-width: 0;
    background: var(--Surface-White, #FFFFFF);
    border-radius: 4px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mortgage-calc__results {
    flex: 1;
    min-width: 0;
    background: var(--Surface-White, #FFFFFF);
    border-radius: 4px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Слайдер-поле */

.calc-field {
    width: 100%;
}

.calc-field__label {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: var(--Text-Primary, #1E2433);
}

.calc-field__box {
    position: relative;
    height: 50px;
    border-radius: 4px;
    background: #F5F5F5;
}

.calc-field__value {
    position: absolute;
    left: 12px;
    bottom: 15px;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    color: var(--Text-Primary, #1E2433);
    white-space: nowrap;
}

.calc-field__track {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 27%;
    background: #D4B46B;
    border-bottom-left-radius: 6px;
    pointer-events: none;
}

.calc-field__range {
    position: absolute;
    left: 0;
    /* Правка по фидбеку: хит-зона ползунка 40px (было 16) — комфортный тап.
       Зона растёт вверх в серый бокс (значение там — просто текст, не инпут);
       bottom подобран так, чтобы визуальный центр кружка остался на треке. */
    bottom: -18px;
    width: 100%;
    height: 40px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.calc-field__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #D4B46B;
    border: 1px solid #FFFFFF;
    box-sizing: border-box;
}

.calc-field__range::-moz-range-thumb {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #D4B46B;
    border: 1px solid #FFFFFF;
    box-sizing: border-box;
}

.calc-field__limits {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.1;
    color: var(--Text-Secondary, #8B8B8B);
    white-space: nowrap;
}

/* Результаты */

.mortgage-calc__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 97px;
    row-gap: 19px;
}

.calc-result {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-result__label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--Text-Primary, #1E2433);
    white-space: nowrap;
}

.calc-result__value {
    margin: 0;
    font-size: 30px;
    font-weight: 500;
    line-height: 20px;
    color: #B89A54;
    white-space: nowrap;
}

.mortgage-calc__divider {
    border-top: 1px solid #CFCFCF;
    margin: 20px 0;
}

.mortgage-calc__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mortgage-calc__actions .btn {
    width: 100%;
    font-weight: 700; /* правка по фидбеку: текст в кнопках жирнее */
}

/* ---- Семейная ипотека ---- */

.mortgage-family-block {
    background: var(--Surface-White, #FFFFFF);
    margin-bottom: 80px;
}

.mortgage-family-block .block-content {
    padding-top: 57px;
    padding-bottom: 53px;
}

.mortgage-family {
    width: 100%;
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: flex-start;
}

.mortgage-family__left {
    width: 371px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mortgage-family__promo {
    width: 100%;
    height: 249px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.mortgage-family__conditions {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.mortgage-family__conditions-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 16px;
    color: #1E2529;
}

/* Без display:flex — во flex-контейнере li перестают быть list-item и буллеты пропадают. */
.mortgage-family__conditions-list {
    margin: 0;
    padding: 0 0 0 21px;
    list-style: disc;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    color: #071817;
}

.mortgage-family__conditions-list li {
    margin-bottom: 18px;
}

.mortgage-family__conditions-list li:last-child {
    margin-bottom: 0;
}

.mortgage-family__right {
    width: 683px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.mortgage-family__title {
    margin: 0 0 40px;
    line-height: 38px;
    color: #1E2529;
}

.mortgage-family__params {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    column-gap: 44px;
    row-gap: 34px;
    margin-bottom: 60px;
}

.family-param {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.family-param__label {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    color: var(--Text-Secondary, #8B8B8B);
    white-space: nowrap;
}

.family-param__value {
    margin: 0;
    font-size: 30px;
    font-weight: 500;
    line-height: 20px;
    color: var(--Text-Primary, #1E2433);
    white-space: nowrap;
}

.mortgage-family__infobox {
    border: 1px solid #C1B28F;
    border-radius: 4px;
    background: rgba(191, 185, 169, 0.1);
    padding: 20px 35px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
    min-height: 264px;
    box-sizing: border-box;
}

.mortgage-family__infobox-text {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    color: #1E2529;
}

.mortgage-family__infobox-text a {
    color: #B98E2B;
    text-decoration: none;
}

.mortgage-family__infobox-heading {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 16px;
    color: #1E2529;
}

.mortgage-family__features {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.family-feature {
    width: 178px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.family-feature--w200 {
    width: 200px;
}

.family-feature--w158 {
    width: 158px;
}

.family-feature__icon {
    width: 52px;
    height: 52px;
    display: block;
}

.family-feature__text {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    color: var(--Text-Secondary, #8B8B8B);
}

/* ---- Laptop (Figma-фрейм 990) ---- */

@media (max-width: 1279px) {
    .mortgage-banner-block {
        margin-bottom: 30px;
    }

    .mortgage-banner__illustration {
        display: none;
    }

    .mortgage-banner__info {
        padding: 0 30px;
        min-width: 280px;
    }

    .mortgage-banner__promo {
        flex-shrink: 1;
        min-width: 400px;
    }

    .mortgage-banks-block {
        margin-bottom: 40px;
    }

    .mortgage-banks {
        gap: 8px;
    }

    .mortgage-banks__card {
        height: 86px;
    }

    .mortgage-calc-block {
        margin-bottom: 40px;
    }

    .mortgage-calc {
        gap: 12px;
    }

    .mortgage-calc__inputs,
    .mortgage-calc__results {
        padding: 20px;
    }

    .mortgage-calc__grid {
        column-gap: 70px;
    }

    .mortgage-family-block {
        margin-bottom: 60px;
    }

    .mortgage-family-block .block-content {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    /* колонки становятся строками: «Семейная ипотека» сверху, промо-фото с условиями снизу */
    .mortgage-family {
        flex-direction: column;
        gap: 40px;
    }

    .mortgage-family__right {
        width: 100%;
    }

    .mortgage-family__left {
        width: 100%;
        flex-direction: row;
        gap: 20px;
        align-items: flex-start;
    }

    .mortgage-family__promo {
        width: 308px;
        height: 207px;
        flex-shrink: 0;
    }

    .mortgage-family__infobox {
        min-height: 220px;
        padding: 20px 35px;
    }
}

/* ---- Mobile (Figma-фрейм 360) ---- */

@media (max-width: 768px) {
    .mortgage-banner-block {
        display: none;
    }

    .mortgage-banks-block {
        margin-bottom: 24px;
    }

    .mortgage-banks {
        grid-template-columns: repeat(2, 1fr);
    }

    .mortgage-calc-block {
        margin-bottom: 40px;
    }

    .mortgage-calc {
        flex-direction: column;
        gap: 12px;
    }

    .mortgage-calc__inputs,
    .mortgage-calc__results {
        padding: 14px;
    }

    /* На тач-экране хит-зона ползунка ещё выше — 48px. */
    .calc-field__range {
        bottom: -22px;
        height: 48px;
    }

    .mortgage-calc__grid {
        column-gap: 19px;
        row-gap: 20px;
    }

    .calc-result__label {
        white-space: normal;
    }

    .calc-result__value {
        font-size: 20px;
        line-height: 1;
    }

    .mortgage-family-block {
        margin-bottom: 0;
    }

    .mortgage-family-block .block-content {
        padding-top: 20px;
        padding-bottom: 40px;
    }

    .mortgage-family__left {
        flex-direction: column;
        gap: 20px;
    }

    .mortgage-family__promo {
        width: 100%;
        height: 213px;
    }

    .mortgage-family__title {
        margin-bottom: 30px;
    }

    .mortgage-family__params {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 30px;
        row-gap: 30px;
        margin-bottom: 30px;
    }

    .family-param__value {
        font-size: 20px;
        line-height: 1;
    }

    .family-param__label {
        white-space: normal;
    }

    .mortgage-family__infobox {
        padding: 14px;
        min-height: 0;
    }

    .mortgage-family__features {
        flex-direction: column;
        gap: 30px;
    }
}
