.roof-catalog-calc {
    padding: 30px 0 60px;
}

.roof-catalog-calc .subtitle {
    margin-bottom: 10px;
}

.roof-catalog-note,
.roof-catalog-muted {
    color: #8b8f9a;
    font-size: 16px;
    line-height: 1.4;
}

.roof-catalog-step {
    margin: 28px 0;
}

.roof-catalog-step h3 {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 500;
}

.roof-choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 18px;
}

.roof-choice-grid-colors,
.roof-choice-grid-offers {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
}

.roof-choice-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 160px;
    padding: 12px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: #fff;
    color: #202020;
    text-align: left;
    cursor: pointer;
    transition: .2s;
}

.roof-choice-card:hover,
.roof-choice-card.is-active {
    border-color: #744a9b;
    box-shadow: 0 0 0 4px rgba(116, 74, 155, .12);
}

.roof-choice-card img,
.roof-choice-noimg {
    width: 100%;
    height: 105px;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 10px;
    background: #f2f2f6;
}

.roof-choice-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9a9a9a;
    font-size: 14px;
}

.roof-choice-card span {
    display: block;
    font-size: 16px;
    line-height: 1.25;
}

.roof-choice-card strong {
    display: block;
    margin-top: 8px;
    color: #744a9b;
    font-size: 16px;
}

.roof-choice-card small {
    display: block;
    margin-top: 4px;
    color: #8b8f9a;
    font-size: 13px;
    line-height: 1.25;
}

.roof-catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px 28px;
}

.roof-catalog-grid label,
.roof-catalog-field {
    display: block;
    color: #8b8f9a;
    font-size: 17px;
}

.roof-catalog-grid select,
.roof-catalog-field input {
    width: 100%;
    height: 50px;
    margin-top: 8px;
    padding: 0 16px;
    border: 1px solid #9da4b3;
    border-radius: 12px;
    background: #fff;
    color: #202020;
    font-size: 18px;
    outline: none;
}

.roof-catalog-grid select:focus,
.roof-catalog-field input:focus {
    border-color: #744a9b;
    box-shadow: 0 0 0 3px rgba(116, 74, 155, .12);
}

.roof-catalog-grid .inp-danger,
.roof-catalog-field input.inp-danger {
    border-color: #e04b4b;
}

.roof-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 34px;
    margin-bottom: 28px;
}

.roof-type-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.roof-type-card input {
    position: absolute;
    left: 14px;
    bottom: 14px;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #744a9b;
    z-index: 2;
}

.roof-type-card img {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 12px;
    transition: .2s;
}

.roof-type-card input:checked+img {
    border-color: #744a9b;
    box-shadow: 0 0 0 4px rgba(116, 74, 155, .12);
}

.roof-catalog-size-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px 28px;
}

.roof-catalog-field span {
    display: block;
}

.roof-catalog-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 260px;
    height: 58px;
    margin-top: 10px;
    padding: 0 28px;
    border: 0;
    border-radius: 14px;
    background: #744a9b;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: .2s;
    text-decoration: none;
}

.roof-catalog-btn:hover {
    background: #623c88;
    color: #fff;
}

.roof-catalog-alert {
    margin: 18px 0;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 16px;
}

.roof-catalog-alert-info {
    background: #eef2ff;
    color: #2d3a76;
}

.roof-catalog-alert-danger {
    background: #ffecec;
    color: #9f1d1d;
}

.roof-catalog-alert-success {
    background: #e7f7df;
    color: #2b6c17;
}

.roof-catalog-empty {
    padding: 18px;
    border-radius: 12px;
    background: #fff;
    color: #8b8f9a;
}

.roof-catalog-result-summary {
    margin: 28px 0 18px;
    padding: 18px 22px;
    border-radius: 12px;
    background: #fff;
}

.roof-catalog-result-summary p {
    margin: 5px 0;
    font-size: 17px;
}

.roof-catalog-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
}

.roof-catalog-table th,
.roof-catalog-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e3e5ea;
    text-align: left;
    vertical-align: top;
    font-size: 16px;
}

.roof-catalog-table th {
    font-weight: 600;
    background: #f7f7fa;
}

.roof-catalog-table tfoot td {
    font-weight: 700;
    background: #f7f7fa;
}

.roof-catalog-table small {
    display: block;
    margin-top: 4px;
    color: #8b8f9a;
    font-size: 13px;
}

.roof-catalog-table .is-not-basket td {
    color: #8b8f9a;
}

.roof-catalog-basket-link {
    display: inline-flex;
    align-items: center;
    min-height: 58px;
    margin-left: 18px;
    color: #744a9b;
    text-decoration: underline;
}

@media (max-width: 991px) {

    .roof-choice-grid,
    .roof-choice-grid-colors,
    .roof-choice-grid-offers,
    .roof-catalog-grid,
    .roof-type-grid,
    .roof-catalog-size-grid {
        grid-template-columns: 1fr;
    }

    .roof-catalog-basket-link {
        margin-left: 0;
        margin-top: 12px;
    }
}

/* Виды металлочерепицы: временно только названия, без изображений. */
.roof-choice-grid-products {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.roof-choice-card-product {
    min-height: 92px;
    justify-content: center;
    padding: 18px 16px;
}

.roof-choice-card-product span {
    font-size: 17px;
}

/* Покрытие и цвет выбираются одной карточкой. Группа = раздел ИБ 24, карточка = элемент цвета. */
.roof-coating-groups {
    display: block;
}

.roof-coating-group+.roof-coating-group {
    margin-top: 30px;
}

.roof-coating-group h4 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
}

.roof-choice-card-compact {
    min-height: 58px;
    justify-content: center;
    padding: 13px 18px;
}

.roof-choice-card-offer {
    max-width: 420px;
}

@media (max-width: 991px) {
    .roof-choice-grid-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .roof-choice-grid-products {
        grid-template-columns: 1fr;
    }
}

.roof-catalog-select-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 430px;
    margin: 0 0 28px;
    color: rgba(14, 14, 14, 0.884);
}

.roof-catalog-select-label>span {
    font-size: 16px;
}

.roof-catalog-select-label select {
    width: 100%;
    height: 52px;
    padding: 0 46px 0 18px;
    border: 1px solid #d8d4df;
    border-radius: 14px;
    background: #fff;
    font: inherit;
    color: inherit;
    appearance: auto
}

.roof-catalog-offer-inline {
    margin: 0 0 32px
}

.roof-selected-offer {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    border: 1px solid #e3dbea;
    border-radius: 14px;
    background: #faf8fc
}

.roof-selected-offer strong {
    margin-left: auto
}

.roof-selected-offer s {
    color: #999
}

.roof-choice-card small {
    display: block;
    margin-top: 6px;
    color: #777
}

.roof-choice-card strong {
    display: block;
    margin-top: 7px
}

.roof-catalog-field {
    flex-direction: column
}

.roof-screw-recommendation {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    max-width: 920px;
    padding: 20px;
    border: 1px solid #e2dbea;
    border-radius: 16px;
    background: #fff;
}

.roof-screw-recommendation img {
    width: 150px;
    height: 120px;
    object-fit: contain;
}

.roof-screw-recommendation__label {
    margin-bottom: 6px;
    color: #744a9b;
    font-size: 14px;
    font-weight: 600;
}

.roof-screw-recommendation__name {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
}

.roof-screw-recommendation__color,
.roof-screw-recommendation__qty {
    margin-top: 5px;
    color: #8b8f9a;
    font-size: 15px;
}

.roof-screw-recommendation__price {
    margin-top: 9px;
    color: #744a9b;
    font-size: 18px;
    font-weight: 700;
}

.roof-screw-change {
    min-width: 130px;
    height: 46px;
    padding: 0 20px;
    border: 1px solid #744a9b;
    border-radius: 12px;
    background: #fff;
    color: #744a9b;
    font-size: 16px;
    cursor: pointer;
}

.roof-screw-change:hover {
    background: #744a9b;
    color: #fff;
}

.roof-screw-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
}

.roof-screw-modal.is-open {
    display: block;
}

.roof-screw-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 18, 24, .55);
}

.roof-screw-modal__dialog {
    position: relative;
    width: min(1120px, calc(100% - 32px));
    max-height: calc(100vh - 48px);
    margin: 24px auto;
    padding: 30px;
    overflow-y: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .25);
}

.roof-screw-modal__dialog h3 {
    margin: 0 50px 5px 0;
    font-size: 26px;
    font-weight: 500;
}

.roof-screw-modal__close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #f2eef6;
    color: #4c3563;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.roof-screw-modal__grid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    margin-top: 22px;
}

.roof-screw-modal-card {
    min-height: 245px;
}

.roof-screw-modal-card img {
    height: 125px;
    object-fit: contain;
}

.roof-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .roof-screw-recommendation {
        grid-template-columns: 92px 1fr;
        gap: 15px;
    }

    .roof-screw-recommendation img {
        width: 92px;
        height: 92px;
    }

    .roof-screw-change {
        grid-column: 1 / -1;
        width: 100%;
    }

    .roof-screw-modal__dialog {
        padding: 22px 16px;
    }

    .roof-screw-modal__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .roof-screw-modal__grid {
        grid-template-columns: 1fr;
    }
}

#roofCatalogThickness,
#roofCatalogLengths {
    max-width: 430px;
    width: 100%;
    height: 52px;
    padding: 0 46px 0 18px;
    border: 1px solid #d8d4df;
    border-radius: 14px;
    background: #fff;
    font: inherit;
    color: inherit
}

#roofCatalogThickness:disabled,
#roofCatalogLengths:disabled {
    background: #f5f3f7;
    color: #999;
    cursor: not-allowed
}

/* Итоговый расчёт: листы показываются штуками, с возможностью корректировки. */
.roof-catalog-result {
    margin-top: 28px;
}

.roof-catalog-result-note {
    margin-bottom: 12px;
    color: #8b8f9a;
    font-size: 15px;
}

.roof-catalog-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
    background: #fff;
}

.roof-catalog-table {
    min-width: 1050px;
    margin: 0 0 22px;
}

.roof-catalog-table td strong {
    font-weight: 500;
}

.roof-result-qty {
    display: inline-grid;
    grid-template-columns: 42px 70px 42px;
    align-items: center;
    min-height: 44px;
    overflow: hidden;
    border: 1px solid #cfc5da;
    border-radius: 12px;
    background: #fff;
}

.roof-result-qty__button {
    width: 42px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #744a9b;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.roof-result-qty__button:hover {
    background: #f5f0f9;
}

.roof-result-qty input {
    width: 70px;
    height: 44px;
    padding: 0 6px;
    border: 0;
    border-right: 1px solid #e1d9e8;
    border-left: 1px solid #e1d9e8;
    outline: 0;
    background: #fff;
    text-align: center;
    font: inherit;
    appearance: textfield;
}

.roof-result-qty input::-webkit-inner-spin-button,
.roof-result-qty input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.roof-catalog-total {
    margin: 18px 0;
    font-size: 20px;
    font-weight: 500;
}

@media (max-width: 767px) {
    .roof-catalog-result-note {
        font-size: 14px;
    }
}

.roof-result-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #f7f5fa;
    font-size: 15px;
}

.roof-result-summary strong {
    font-weight: 600;
}

/* Выбор группы кровельного материала. */
.roof-choice-grid-materials {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.roof-choice-grid-materials .roof-choice-card-product {
    min-height: 82px;
}

/* Форма отправки расчёта менеджеру. */
.roof-manager-form {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid #e2dbea;
    border-radius: 16px;
    background: #fff;
}

.roof-manager-form h3 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 500;
}

.roof-manager-form>p {
    margin: 0 0 20px;
    color: #777;
}

.roof-manager-form__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.roof-manager-form__grid label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.roof-manager-form__grid input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid #d8d4df;
    border-radius: 12px;
    background: #fff;
    color: #202020;
    font: inherit;
    outline: none;
}

.roof-manager-form__grid input:focus {
    border-color: #744a9b;
    box-shadow: 0 0 0 3px rgba(116, 74, 155, .12);
}

.roof-manager-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
}

.roof-catalog-btn:disabled {
    background: #c9c5cd;
    color: #fff;
    cursor: not-allowed;
}

.roof-catalog-btn:disabled:hover {
    background: #c9c5cd;
}

@media (max-width: 767px) {

    .roof-choice-grid-materials,
    .roof-manager-form__grid {
        grid-template-columns: 1fr;
    }

    .roof-manager-form {
        padding: 18px;
    }

    .roof-manager-form__actions .roof-catalog-btn {
        width: 100%;
        min-width: 0;
    }
}