/* Базовый контейнер */
#mortgage { }
.mortgage-widget {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    flex-direction: row-reverse;
    gap: 20px;
}

.mortgage-widget__controls {



    width: 400px;

}

.mortgage-widget__list{background: #fff;  border-radius: 20px; flex:1;min-height: 300px;}
.mortgage-widget__tabs {

    padding: 20px;
    padding-bottom: 0;

}

.mortgage-widget__body {
    padding: 20px;
    min-height: 80px;
}

/* Состояния */
.mortgage-loading,
.mortgage-empty,
.mortgage-error {
    padding: 18px;
    border-radius: 14px;
    background: #f7f7f7;
    font-size: 14px;
    line-height: 1.4;
}

.mortgage-error {
    color: #b42318;
    background: #fef3f2;
}

/* Контролы */
.mortgage-controls {
    display: grid;
    gap: 18px;
    padding: 30px;
    background: #ffff;
    border-radius: 20px;
    position: sticky;
    top: 90px;
}

.mortgage-controls__title {
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
    color: #111;
}

.mortgage-price-static {
    display: grid;
    gap: 10px;
}

.mortgage-slider__value.mortgage-price-static__value {
    font-size: 24px;

}



.mortgage-loan-amount {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #ececec;
}

.mortgage-loan-amount__label {
    font-size: 14px;
    line-height: 1.3;
    color: #444;
}

.mortgage-loan-amount__value {
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
    color: #111;
    text-align: right;
    white-space: nowrap;
}

.mortgage-slider {
    display: grid;
    gap: 10px;
}

.mortgage-slider__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 5px;
    flex-direction: column;
}

.mortgage-slider__label {
    font-size: 14px;
    line-height: 1.3;
    color: #444;
}

.mortgage-slider__value {
    font-size: 24px;
    line-height: 1.3;
    font-weight: 600;
    color: #3577ff;
    text-align: right;
    white-space: nowrap;
}

.mortgage-slider__value-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
}

.mortgage-slider__value-extra {
    font-size: 20px;
    line-height: 1.3;
    font-weight: 500;
    color: #7a7a7a;
    text-align: right;
    white-space: nowrap;
}

.mortgage-slider__track {
    margin: 6px 2px 0;
}

.mortgage-slider__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    line-height: 1.2;
    color: #8a8a8a;
}

/* noUiSlider */
.mortgage-slider .noUi-target {
    border: 0;
    box-shadow: none;
    background: #ececec;
    height: 8px;
    border-radius: 999px;
}

.mortgage-slider .noUi-connects {
    border-radius: 999px;
}

.mortgage-slider .noUi-connect {
    background: #3577ff;
}

.mortgage-slider .noUi-horizontal .noUi-handle {
    width: 20px;
    height: 20px;
    right: -10px;
    top: -6px;
    border-radius: 50%;
    border: 2px solid #3577ff;
    background: #fff;
    box-shadow: none;
    cursor: grab;
}

.mortgage-slider .noUi-handle:before,
.mortgage-slider .noUi-handle:after {
    display: none;
}

.mortgage-slider .noUi-handle:active {
    cursor: grabbing;
}

.mortgage-slider .noUi-touch-area {
    border-radius: 50%;
}

.mortgage-slider .noUi-horizontal {
    height: 8px;
}

/* Вкладки */
.mortgage-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mortgage-tabs__btn {
    appearance: none;
    border: 1px solid #dfdfdf;
    background: #fff;
    color: #222;
    border-radius: 999px;
    padding:10px 20px;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.mortgage-tabs__btn:hover {
    border-color: #bdbdbd;
}

.mortgage-tabs__btn.is-active {
    background: #3577ff;
    border-color: #3577ff;
    color: #fff;
}

.mortgage-tabs__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    background: rgba(0, 0, 0, 0.06);
    display: none;
}

.mortgage-tabs__btn.is-active .mortgage-tabs__count {
    background: rgba(255, 255, 255, 0.18);
}

/* Список программ */
.mortgage-programs {
    display: grid;
    gap: 16px;
}

.mortgage-program {

}

.mortgage-program__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
    display: none;
}

.mortgage-program__title {
    font-size: 18px;
    line-height: 1.25;
    font-weight: 600;
    color: #111;
}

.mortgage-program__count {
    font-size: 13px;
    line-height: 1.2;
    color: #777;
    white-space: nowrap;
}

.mortgage-program__banks {
    display: grid;
    gap: 12px;
}

/* Карточка банка */
.mortgage-bank {
    border: 1px solid #f0f0f0;
    border-radius: 14px;
    padding: 14px;
    background: #fbfbff;
}

.mortgage-bank__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mortgage-bank__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.mortgage-bank__logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex: 0 0 auto;
}

.mortgage-bank__name {
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
    color: #111;
    min-width: 0;
}

.mortgage-bank__rate {
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    width: 25%;
}

.mortgage-bank__grid {
    display: flex;
    gap: 0px;
    justify-content: space-between;

}

.mortgage-bank__cell {
    min-width: 0;
    width: 25%;
}

.mortgage-bank__cell-label {
    font-size: 12px;
    line-height: 1.2;
    color: #8a8a8a;
    margin-bottom: 4px;
}

.mortgage-bank__cell-value {
    font-size: 14px;
    line-height: 1.35;
    color: #111;
    font-weight: 500;
    word-break: break-word;
}


@media (max-width: 1358px) {

    .mortgage-bank__rate{width: 25%; }
}

@media (max-width: 1140px) {
    .mortgage-widget{flex-direction: column}
    .mortgage-widget__controls{width: 100%}
    .mortgage-bank__rate{width: 25%; }
}

/* Адаптив */
@media (max-width: 767px) {
    .mortgage-widget {

    }

    .mortgage-program {

    }

    .mortgage-program__head,
    .mortgage-bank__top,
    .mortgage-slider__top {

    }

    .mortgage-program__count,
    .mortgage-slider__value,

    .mortgage-loan-amount__value {
        white-space: normal;
        text-align: left;
    }

    .mortgage-slider__value-wrap {
        justify-content: center;
        flex-wrap: wrap;
    }

    .mortgage-bank__grid {
        grid-template-columns: 1fr;
    }

    .mortgage-tabs {

    }

    .mortgage-tabs::-webkit-scrollbar {
        height: 6px;
    }

    .mortgage-tabs::-webkit-scrollbar-thumb {
        background: #d7d7d7;
        border-radius: 999px;
    }

    .mortgage-bank__rate{width: 50%; }
    .mortgage-bank__grid{flex-wrap: wrap; gap: 0}
    .mortgage-bank__cell{width: 50%; margin-bottom: 10px}
}