.cpx-modal {
    box-sizing: border-box;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
    color: var(--cpx-text);
}

.cpx-modal::backdrop {
    background: rgb(0 0 0 / 40%);
}

.cpx-modal__panel {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 113px;
    padding: 24px;
    border-radius: 16px;
    background: var(--cpx-white-1);
    box-shadow: 0 0 6.5px rgb(0 0 0 / 40%);
}

.cpx-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cpx-grey-2);
    cursor: pointer;
}

.cpx-modal__close:hover {
    color: var(--cpx-grey-3);
}

.cpx-modal__body {
    max-width: 100%;
    text-align: center;
}

.cpx-modal__body :is(p, h2) {
    margin: 0;
}

.cpx-modal__foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cpx-modal__action {
    width: 121px;
}

html:has(.cpx-modal[open]) {
    overflow: hidden;
}

.wa-order-dialog.cpx-modal--webasyst {
    .cpx-modal__backdrop {
        background: rgb(0 0 0 / 25%);
    }

    .wa-dialog-body.cpx-modal__panel {
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        min-height: 0;
        max-width: calc(100% - 32px);
        max-height: calc(100dvh - 32px);
        padding: 24px;
        border: 0;
        border-radius: 16px;
        color: var(--cpx-text);
        background: var(--cpx-white-1);
        box-shadow: 0 0 6.5px rgb(0 0 0 / 40%);
    }

    .wa-dialog-body .wa-dialog-header.cpx-modal__header {
        position: relative;
        display: block;
        flex: 0 0 auto;
        width: 100%;
        margin: 0;
        padding: 0 0 12px;
        border: 0;
        border-bottom: 1px solid var(--cpx-grey-2);
        border-radius: 0;
        background: transparent;

        > div {
            display: block;
        }
    }

    .cpx-modal__header .cpx-modal__title {
        min-height: 20px;
        margin: 0;
        padding-right: 28px;
        color: var(--cpx-text);
        overflow-wrap: anywhere;
    }

    .wa-dialog-header .wa-close-wrapper.cpx-modal__close {
        top: 0;
        right: 0;
        display: flex;
        width: 20px;
        height: 20px;
        padding: 0;
        color: var(--cpx-grey-2);

        &:hover {
            color: var(--cpx-grey-3);
        }
    }

    .wa-dialog-body .wa-dialog-content.cpx-modal__body {
        min-height: 0;
        max-height: none;
        padding: 16px 0 0;
        color: inherit;
        text-align: left;
    }

    @media (width <= 760px) {
        .wa-dialog-body.cpx-modal__panel {
            padding: 16px;
        }
    }
}
