/*
 * Виджет-заглушка чата, заменяющий Chatwoot/circle-menu: кнопка + окно с
 * переходом на диалог с оператором в мессенджере MAX (QR-код на десктопе,
 * прямая ссылка на мобильных/планшетах).
 */
.max-widget-bubble {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 100px;
    background: #0089cb url("../images/icons/operator.png") no-repeat center center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
    cursor: pointer;
    z-index: 2147483000;
}
.max-widget-bubble:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
}
.max-widget-bubble.is-open {
    background-image: none;
}
.max-widget-bubble svg {
    width: 24px;
    height: 24px;
    margin: 20px;
}
.max-widget-bubble__close-icon {
    display: none;
}
.max-widget-bubble.is-open .max-widget-bubble__close-icon {
    display: block;
}

@media (max-width: 768px) {
    .max-widget-bubble {
        right: 24px;
        bottom: 24px;
        width: 40px;
        height: 40px;
        background-size: 40px 40px;
    }
}

.max-widget-window {
    position: fixed;
    right: 20px;
    bottom: 104px;
    width: 400px;
    height: calc(90% - 64px - 20px);
    max-height: 640px;
    min-height: 250px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 40px rgba(0, 0, 0, .16);
    overflow: hidden;
    z-index: 2147483001;
    display: none;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.max-widget-window.is-open {
    display: flex;
}

.max-widget-header {
    position: relative;
    flex: 0 0 auto;
    background: #fff;
    padding: 24px 44px 16px 20px;
}
.max-widget-header__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #16181d;
    margin: 0 0 8px;
}
.max-widget-header__subtitle {
    font-size: 15px;
    line-height: 1.4;
    color: #64748b;
    margin: 0;
}
.max-widget-header__close {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #9aa2b1;
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease;
}
.max-widget-header__close:hover {
    color: #16181d;
}

.max-widget-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    background: #eef0f5;
    padding: 20px;
    overflow: auto;
}
.max-widget-qr-area {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.max-widget-qr-card {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    line-height: 0;
}
.max-widget-qr-caption {
    margin: 0;
    width: 100%;
    font-size: 15px;
    line-height: 1.4;
    color: #16181d;
    text-align: center;
}
.max-widget-cta {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #00356D;
    color: #fff;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 10px;
}
.max-widget-cta__icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}
.max-widget-cta__text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

@media only screen and (max-width: 667px) {
    .max-widget-window {
        top: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: none;
    }
}
