.quick-pay-modal {
    width: min(1020px, calc(100vw - 28px));
}

body .modal {
    z-index: 10000030;
}

.quick-pay-modal .order-call__title {
    margin-bottom: 14px;
    font-size: 34px;
    line-height: 1.05;
    text-transform: none;
}

.quick-pay-modal__lead {
    margin: 0 0 24px;
    color: #7d8495;
    font-size: 15px;
    line-height: 1.45;
    text-align: center;
}

.quick-pay-modal__nav {
    display: flex;
    gap: 26px;
    margin-bottom: 26px;
    justify-content: flex-start;
}

.quick-pay-modal__nav-tab {
    padding: 0;
    border: 0;
    background: transparent;
    color: #7d8495;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    transition: color .2s ease;
}

.quick-pay-modal__nav-tab:focus,
.quick-pay-modal__nav-tab:focus-visible,
.quick-pay-modal__nav-tab:hover {
    outline: none;
    box-shadow: none;
}

.quick-pay-modal__nav-tab.is-active {
    color: #0f2137;
}

.quick-pay-modal__nav-tab.is-disabled {
    opacity: .45;
    cursor: not-allowed;
    position: relative;
}

.quick-pay-modal__nav-tab.is-disabled[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    z-index: 5;
    padding: 10px 12px;
    border-radius: 12px;
    min-width: 230px;
    max-width: 280px;
    background: #0f2137;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    opacity: 1;
    white-space: normal;
}

.quick-pay-modal__section {
    display: none;
}

.quick-pay-modal__section.is-active {
    display: block;
}

.quick-pay-modal__sections {
    min-height: 0;
}

.quick-pay-modal__body {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.quick-pay-modal__form,
.quick-pay-modal__delivery-form {
    align-items: stretch;
}

.quick-pay-modal__delivery-form {
    box-sizing: border-box;
    width: min(760px, 100%);
    margin: 4px auto 0;
    padding: 26px;
    border: 1px solid #dbe5f0;
    border-radius: 22px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    box-shadow: 0 18px 42px rgba(15, 33, 55, 0.06);
}

.quick-pay-modal__delivery-form .order-call__input {
    width: 100%;
    height: 54px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: #fff;
}

.quick-pay-modal__delivery-form .order-call__input--textarea {
    min-height: 136px;
    padding-top: 16px;
    resize: vertical;
}

.quick-pay-modal__delivery-form .order-call__btn {
    width: auto;
    min-width: 280px;
    max-width: 100%;
    height: 52px;
    margin: 8px auto 0;
    padding: 0 34px;
    border-radius: 14px;
    align-self: center;
}

.quick-pay-modal__form .order-call__input:first-child,
.quick-pay-modal__delivery-form .order-call__input:first-child {
    margin-bottom: 16px;
}

.quick-pay-modal__email-note {
    margin: -4px 0 12px;
    color: #7d8495;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}

.quick-pay-modal__form .order-call__checkbox-label,
.quick-pay-modal__delivery-form .order-call__checkbox-label {
    margin-bottom: 0;
}

.quick-pay-modal__delivery-message {
    margin-top: 12px;
    color: #0f7a40;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

.quick-pay-modal__delivery-success {
    box-sizing: border-box;
    width: min(640px, 100%);
    margin: 12px auto 0;
    padding: 44px 34px;
    border: 1px solid #dbe5f0;
    border-radius: 26px;
    background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
    box-shadow: 0 18px 42px rgba(15, 33, 55, 0.08);
    text-align: center;
}

.quick-pay-modal__success-icon {
    position: relative;
    width: 74px;
    height: 74px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #22b36b;
    box-shadow: 0 14px 30px rgba(34, 179, 107, 0.22);
}

.quick-pay-modal__success-icon::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 24px;
    height: 34px;
    border-right: 5px solid #fff;
    border-bottom: 5px solid #fff;
    transform: translate(-50%, -58%) rotate(45deg);
}

.quick-pay-modal__success-title {
    color: #0f2137;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.1;
}

.quick-pay-modal__success-text {
    max-width: 500px;
    margin: 14px auto 0;
    color: #7d8495;
    font-size: 17px;
    line-height: 1.55;
}

.quick-pay-modal__success-text a {
    color: #006b99;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.quick-pay-sbp {
    width: 100%;
}

.quick-pay-sbp__method-panel {
    display: none;
}

.quick-pay-sbp__method-panel.is-active {
    display: block;
}

.quick-pay-sbp__text {
    margin: 0 0 18px;
    color: #7d8495;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
    white-space: nowrap;
}

.quick-pay-sbp__qr-box {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 390px;
    padding: 18px 0 0;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(15, 33, 55, 0.12);
    overflow: hidden;
}

.quick-pay-sbp__download {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 22px rgba(15, 33, 55, 0.16);
    color: #163047;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, color .2s ease;
}

.quick-pay-sbp__download:hover,
.quick-pay-sbp__download:focus-visible {
    color: #eb3824;
    box-shadow: 0 10px 26px rgba(15, 33, 55, 0.2);
    transform: translateY(-1px);
}

.quick-pay-sbp__download svg {
    width: 20px;
    height: 20px;
}

.quick-pay-sbp__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    min-height: 390px;
    width: 100%;
    padding-top: 110px;
    color: #7d8495;
    font-size: 16px;
    line-height: 1.45;
    text-align: center;
}

.quick-pay-sbp__placeholder-text {
    max-width: 320px;
}

.quick-pay-sbp__loader {
    width: 44px;
    height: 44px;
    border: 3px solid #dce4ef;
    border-top-color: #eb3824;
    border-radius: 50%;
    animation: quick-pay-spin .8s linear infinite;
}

.quick-pay-sbp__loader[hidden],
.quick-pay-sbp__status-icon[hidden],
.quick-pay-sbp__retry[hidden],
.quick-pay-sbp__download[hidden] {
    display: none;
}

.quick-pay-sbp__status-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    position: relative;
}

.quick-pay-sbp__status-icon.is-success {
    background: #26b05a;
}

.quick-pay-sbp__status-icon.is-success::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 17px;
    height: 30px;
    border-right: 5px solid #fff;
    border-bottom: 5px solid #fff;
    transform: translate(-50%, -58%) rotate(45deg);
}

.quick-pay-sbp__status-icon.is-failed {
    background: #e94b3c;
}

.quick-pay-sbp__status-icon.is-failed::before,
.quick-pay-sbp__status-icon.is-failed::after {
    content: "";
    position: absolute;
    left: 34px;
    top: 18px;
    width: 5px;
    height: 36px;
    background: #fff;
    border-radius: 999px;
}

.quick-pay-sbp__status-icon.is-failed::before {
    transform: rotate(45deg);
}

.quick-pay-sbp__status-icon.is-failed::after {
    transform: rotate(-45deg);
}

.quick-pay-sbp__qr {
    display: none;
    width: min(100%, 330px);
    height: auto;
    margin: 8px auto 0;
    align-self: flex-start;
    line-height: 0;
}

.quick-pay-sbp.is-ready .quick-pay-sbp__qr {
    display: block;
}

.quick-pay-sbp.is-ready .quick-pay-sbp__placeholder {
    display: none;
}

.quick-pay-sbp__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 18px;
}

.quick-pay-sbp__actions .order-call__btn {
    margin-bottom: 0;
}

.quick-pay-sbp__actions .is-disabled {
    pointer-events: none;
    opacity: .55;
}

.quick-pay-sbp__retry {
    background: #fff;
    border: 1px solid #eb3824;
    color: #eb3824;
}

.quick-pay-sbp__error {
    margin-top: 12px;
    color: #d93025;
    font-size: 14px;
    line-height: 1.4;
}

.quick-pay-sbp__items-box {
    max-height: 420px;
    overflow: auto;
    border: 1px solid #e4e9f1;
    border-radius: 20px;
    background: #fff;
}

.quick-pay-sbp__items {
    width: 100%;
}

.quick-pay-sbp__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.quick-pay-sbp__table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 14px 12px;
    background: #f7f9fc;
    color: #7d8495;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    border-bottom: 1px solid #e4e9f1;
}

.quick-pay-sbp__table th.quick-pay-sbp__th-product {
    text-align: left;
}

.quick-pay-sbp__table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid #edf1f6;
    vertical-align: middle;
    color: #0f2137;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

.quick-pay-sbp__table tbody tr:last-child td {
    border-bottom: 0;
}

.quick-pay-sbp__col-check {
    width: 48px;
}

.quick-pay-sbp__col-product {
    width: auto;
}

.quick-pay-sbp__col-qty {
    width: 100px;
}

.quick-pay-sbp__col-price {
    width: 120px;
}

.quick-pay-sbp__col-actions {
    width: 92px;
}

.quick-pay-sbp__bulk {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #e4e9f1;
    background: #fff;
}

.quick-pay-sbp__bulk-text {
    color: #7d8495;
    font-size: 14px;
    line-height: 1.4;
}

.quick-pay-sbp__bulk-btn,
.quick-pay-sbp__remove-btn {
    padding: 0;
    border: 0;
    background: transparent;
    color: #eb3824;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.quick-pay-sbp__bulk-btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
}

.quick-pay-sbp__product-cell {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    text-align: left;
}

.quick-pay-sbp__product-thumb {
    width: 58px;
    height: 58px;
    border-radius: 12px;
    object-fit: cover;
    background: #f3f5f9;
}

.quick-pay-sbp__product-name {
    display: block;
    color: #0f2137;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.quick-pay-sbp__product-name:hover {
    color: #0c5e84;
}

.quick-pay-sbp__product-meta {
    margin-top: 4px;
    color: #7d8495;
    font-size: 13px;
    line-height: 1.35;
}

.quick-pay-sbp__checkbox {
    width: 18px;
    height: 18px;
    accent-color: #eb3824;
}

.quick-pay-sbp__empty {
    padding: 24px 16px;
    color: #7d8495;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.quick-pay-sbp__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e4e9f1;
}

.quick-pay-sbp__summary-label {
    color: #7d8495;
    font-size: 15px;
}

.quick-pay-sbp__summary-value {
    color: #0f2137;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.quick-pay-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    display: none;
    max-width: 320px;
    padding: 16px 18px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 33, 55, 0.18);
    cursor: pointer;
}

.quick-pay-toast.is-visible {
    display: block;
}

.quick-pay-toast__title {
    color: #0f2137;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.quick-pay-toast__text {
    margin-top: 6px;
    color: #7d8495;
    font-size: 14px;
    line-height: 1.4;
}

@keyframes quick-pay-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 767px) {
    .modal {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: 4px;
    }

    .modal::before {
        display: none;
    }

    .modal__container.click {
        margin: 0;
        padding: 16px 10px 10px;
        width: calc(100vw - 8px);
        max-width: none;
        max-height: calc(100dvh - 8px);
        border-radius: 24px 24px 0 0;
    }

    .modal__container.click.modal-open {
        display: block;
    }

    .modal__container.click .modal__close {
        top: 16px;
        right: 16px;
        width: 20px;
        height: 20px;
        z-index: 8;
    }

    .quick-pay-modal {
        width: 100%;
        height: calc(100dvh - 32px);
        max-height: calc(100dvh - 32px);
        padding: 10px 8px 8px;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        border-radius: 0;
        overscroll-behavior: contain;
    }

    .quick-pay-modal .order-call__title {
        margin-bottom: 6px;
        padding: 0 32px;
        font-size: 20px;
        line-height: 1.08;
        text-align: center;
    }

    .quick-pay-modal__lead {
        margin-bottom: 10px;
        font-size: 11px;
        line-height: 1.3;
    }

    .quick-pay-modal__nav {
        gap: 8px;
        margin-bottom: 10px;
        overflow-x: auto;
        padding: 0 2px 4px;
        flex-wrap: nowrap;
    }

    .quick-pay-modal__nav-tab {
        flex: 0 0 auto;
        padding: 7px 12px;
        border-radius: 999px;
        background: #f3f7fb;
        font-size: 13px;
    }

    .quick-pay-modal__nav-tab.is-active {
        background: #e8f4fb;
    }

    .quick-pay-modal__sections {
        flex: 1 1 auto;
        min-height: 0;
    }

    .quick-pay-modal__section.is-active {
        display: flex;
        flex-direction: column;
        min-height: 100%;
    }

    .quick-pay-modal__body {
        grid-template-columns: 1fr;
        gap: 10px;
        align-content: start;
    }

    .quick-pay-modal__form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        align-items: start;
    }

    .quick-pay-modal__form .order-call__input {
        height: 44px;
        margin-bottom: 0;
    }

    .quick-pay-modal__form .order-call__input:first-child {
        margin-bottom: 0;
    }

    .quick-pay-modal__form input[name="email"],
    .quick-pay-modal__email-note,
    .quick-pay-modal__form .order-call__checkbox-label {
        grid-column: 1 / -1;
    }

    .quick-pay-modal__email-note {
        margin: 0;
        font-size: 10px;
        line-height: 1.25;
    }

    .quick-pay-modal__form .order-call__checkbox-label {
        align-items: flex-start;
        margin-bottom: 0;
        padding-left: 26px;
        gap: 6px;
    }

    .quick-pay-modal__form .order-call__checkbox-descr {
        font-size: 11px;
        line-height: 1.15;
    }

    .quick-pay-modal__form .order-call__checkbox-check + .order-call__checkbox-span {
        top: 0;
        width: 18px;
        height: 18px;
        border-radius: 5px;
        border-width: 1.5px;
    }

    .quick-pay-modal__delivery-form {
        margin-top: 0;
        padding: 16px;
        border-radius: 18px;
    }

    .quick-pay-modal__delivery-form .order-call__input {
        height: 52px;
        margin-bottom: 12px;
    }

    .quick-pay-modal__delivery-form .order-call__input--textarea {
        min-height: 120px;
    }

    .quick-pay-modal__delivery-form .order-call__btn {
        min-width: min(260px, 100%);
    }

    .quick-pay-modal__delivery-success {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .quick-pay-modal__success-title {
        font-size: 28px;
    }

    .quick-pay-modal__success-text {
        font-size: 15px;
    }

    .quick-pay-sbp__text {
        margin-bottom: 8px;
        font-size: 11px;
        line-height: 1.25;
        white-space: normal;
    }

    .quick-pay-sbp__qr-box {
        min-height: 164px;
        padding: 8px;
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(15, 33, 55, 0.10);
    }

    .quick-pay-sbp__download:not([hidden]) {
        display: inline-flex;
    }

    .quick-pay-sbp__download {
        top: 8px;
        right: 8px;
        width: 34px;
        height: 34px;
    }

    .quick-pay-sbp__download svg {
        width: 18px;
        height: 18px;
    }

    .quick-pay-sbp__placeholder {
        justify-content: center;
        min-height: 148px;
        padding: 10px 8px;
        gap: 10px;
        font-size: 12px;
    }

    .quick-pay-sbp__qr {
        width: min(100%, 144px);
        margin-top: 0;
        align-self: center;
    }

    .quick-pay-sbp__actions {
        margin-top: 8px;
    }

    .quick-pay-sbp__actions .order-call__btn {
        min-height: 42px;
        padding: 8px 10px;
        font-size: 13px;
        white-space: normal;
    }

    .quick-pay-sbp__summary-value {
        font-size: 24px;
    }

    .quick-pay-sbp__items-box {
        max-height: 340px;
    }

    .quick-pay-sbp__table {
        min-width: 620px;
    }

    .quick-pay-toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
        max-width: none;
    }
}

@media (max-width: 420px) {
    .modal__container.click {
        width: calc(100vw - 4px);
        max-height: calc(100dvh - 4px);
        padding-right: 8px;
        padding-left: 8px;
        border-radius: 22px 22px 0 0;
    }

    .quick-pay-modal {
        height: calc(100dvh - 24px);
        max-height: calc(100dvh - 24px);
        padding-right: 6px;
        padding-left: 6px;
    }

    .quick-pay-modal .order-call__title {
        font-size: 18px;
    }

    .quick-pay-modal__form {
        grid-template-columns: 1fr;
    }

    .quick-pay-sbp__qr-box {
        min-height: 152px;
    }

    .quick-pay-sbp__placeholder {
        min-height: 136px;
    }

    .quick-pay-sbp__qr {
        width: min(100%, 136px);
    }
}
