.maxber-popup-wrap {
    width: 100%;
    text-align: center;
}

.maxber-popup-wrap.maxber-align-left { text-align: left; }
.maxber-popup-wrap.maxber-align-center { text-align: center; }
.maxber-popup-wrap.maxber-align-right { text-align: right; }

.maxber-popup-wrap {
}

.maxber-popup-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 16px 28px;
    border: 2px solid var(--maxber-button-bg, #28316f);
    border-radius: 0;
    background: var(--maxber-button-bg, #28316f);
    color: var(--maxber-button-text, #fff);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .25s ease, color .25s ease;
}

.maxber-popup-open:hover,
.maxber-popup-open:focus {
    background: var(--maxber-button-hover-bg, #fff);
    color: var(--maxber-button-hover-text, #28316f);
}

.maxber-popup {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483646 !important;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 20px;
    box-sizing: border-box;
}

.maxber-popup.is-open {
    display: flex !important;
}

.maxber-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 17, 45, .84);
    backdrop-filter: blur(2px);
}

.maxber-popup-dialog {
    position: relative;
    z-index: 2;
    width: min(680px, calc(100vw - 40px));
    max-height: min(86vh, 760px);
    max-height: min(86dvh, 760px);
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
    background: #ffcc00;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
    text-align: left;
}

.maxber-popup-scroll {
    max-height: min(86vh, 760px);
    max-height: min(86dvh, 760px);
    padding: 30px 34px 28px;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.maxber-popup-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 20 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #28316f;
    color: #fff;
    font-size: 27px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,.2);
}

.maxber-popup-dialog h2 {
    margin: 0 48px 7px 0;
    padding: 0;
    color: #28316f;
    font-size: clamp(27px, 3vw, 34px);
    font-weight: 700;
    line-height: 1.15;
}

.maxber-popup-description {
    margin: 0 48px 20px 0;
    color: #28316f;
    font-size: 15px;
    line-height: 1.45;
}

.maxber-popup-form,
.maxber-popup-form .wpcf7 {
    width: 100%;
}

.maxber-popup-form .wpcf7 p {
    margin: 0 0 10px;
}

.maxber-popup-form label {
    display: block;
    color: #28316f;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.maxber-popup-form .wpcf7-form-control-wrap {
    display: block;
    margin-top: 4px;
}

.maxber-popup-form input[type="text"],
.maxber-popup-form input[type="email"],
.maxber-popup-form input[type="tel"],
.maxber-popup-form input[type="number"],
.maxber-popup-form select,
.maxber-popup-form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid rgba(40, 49, 111, .12);
    border-radius: 0;
    outline: none;
    background: #fff;
    color: #333;
    font-size: 14px;
    box-sizing: border-box;
}

.maxber-popup-form input:focus,
.maxber-popup-form select:focus,
.maxber-popup-form textarea:focus {
    border-color: #28316f;
    box-shadow: 0 0 0 2px rgba(40, 49, 111, .14);
}

.maxber-popup-form textarea {
    min-height: 88px;
    resize: vertical;
}

.maxber-popup-form input[type="checkbox"] {
    width: auto;
    margin-right: 7px;
}

.maxber-popup-form input[type="submit"] {
    display: inline-flex;
    min-height: 44px;
    padding: 11px 23px;
    border: 2px solid var(--maxber-button-bg, #28316f);
    border-radius: 0;
    background: #28316f;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.maxber-popup-form input[type="submit"]:hover {
    background: #fff;
    color: #28316f;
}

.maxber-popup-form .wpcf7-response-output {
    margin: 15px 0 0;
}

body.maxber-popup-lock {
    overflow: hidden !important;
}

@media (max-width: 767px) {
    .maxber-popup {
        padding: 10px;
    }

    .maxber-popup-dialog {
        width: calc(100vw - 20px);
        max-height: 92vh;
        max-height: 92dvh;
    }

    .maxber-popup-scroll {
        max-height: 92vh;
        max-height: 92dvh;
        padding: 24px 18px 22px;
    }

    .maxber-popup-close {
        top: 7px !important;
        right: 7px !important;
        width: 35px;
        height: 35px;
    }

    .maxber-popup-dialog h2,
    .maxber-popup-description {
        margin-right: 42px;
    }
}
