/* Плавающий виджет «Связаться с нами» (десктоп / планшет / мобилка) */
.kcw__panel {
    position: fixed;
    right: 48px;
    bottom: 152px;
    z-index: 100000;
    display: none;
    flex-direction: column;
    gap: 24px;
    box-sizing: border-box;
    width: 304px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 24px;
    background: #fff;
    border: 1px solid #DDE1EC;
    border-radius: 24px;
    box-shadow: 0 16px 32px 0 rgba(46, 46, 60, .16);
    font-family: var(--font);
    text-align: left;
}

.kcw.kcw_open .kcw__panel {
    display: flex;
}

/* Затемнение страницы при открытой карточке (макет: чёрный 50%) */
.kcw__overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.kcw.kcw_open .kcw__overlay {
    opacity: 1;
    pointer-events: auto;
}

.kcw.kcw_chat .kcw__overlay {
    opacity: 0;
    pointer-events: none;
}

.kcw__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kcw__title {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    color: #97A0BA;
}

.kcw__subtitle {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #97A0BA;
}

.kcw__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kcw__label {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    color: #0C1533;
}

.kcw__slash {
    color: #97A0BA;
}

.kcw__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.kcw__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-sizing: border-box;
    margin: 0;
    padding: 9px 12px;
    border: 0;
    border-radius: 24px;
    background: var(--orange);
    color: #fff;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s;
}

.kcw__badge:hover,
.kcw__badge:focus {
    background: var(--orange_buttonHover);
    color: #fff;
    text-decoration: none;
}

.kcw__badge:focus-visible,
.kcw__btn:focus-visible {
    outline: 2px solid #0C1533;
    outline-offset: 2px;
}

.kcw__btn {
    position: fixed;
    right: 48px;
    bottom: 48px;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 80px;
    height: 80px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 3px var(--error);
    cursor: pointer;
    transition: background-color .2s;
}

.kcw__btn:hover {
    background: var(--orange_buttonHover);
}

.kcw__icon {
    position: relative;
    z-index: 3;
    display: block;
}

/* Как на проде: статичное полупрозрачное кольцо-ореол 120% + пульсирующая обводка */
.kcw__pulse {
    position: absolute;
    left: -10%;
    top: -10%;
    width: 120%;
    height: 120%;
    border-radius: 50%;
    background: var(--orange);
    opacity: .4;
    z-index: 1;
    pointer-events: none;
}

.kcw__ring {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border: 1px solid var(--orange);
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
    -webkit-animation: kcwPulse 1.5s infinite;
    animation: kcwPulse 1.5s infinite;
}

.kcw.kcw_open .kcw__pulse,
.kcw.kcw_open .kcw__ring,
.kcw.kcw_chat .kcw__pulse,
.kcw.kcw_chat .kcw__ring {
    display: none;
}

@keyframes kcwPulse {
    50% {
        transform: scale(1, 1);
        opacity: 1;
    }

    100% {
        transform: scale(2, 2);
        opacity: 0;
    }
}

@-webkit-keyframes kcwPulse {
    50% {
        -webkit-transform: scale(1, 1);
        transform: scale(1, 1);
        opacity: 1;
    }

    100% {
        -webkit-transform: scale(2, 2);
        transform: scale(2, 2);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kcw__ring {
        display: none;
    }
}

.kcw .kcw__icon--close,
.kcw.kcw_open .kcw__icon--chat {
    display: none;
}

.kcw.kcw_open .kcw__icon--close {
    display: block;
}

/* пока открыт чат поддержки Evotor, наша кнопка скрыта */
.kcw.kcw_chat .kcw__btn {
    display: none;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .kcw__panel {
        right: 32px;
        bottom: 136px;
        width: 336px;
    }

    .kcw__btn {
        right: 32px;
        bottom: 32px;
    }
}

@media (max-width: 767px) {
    .kcw__panel {
        right: 24px;
        left: 24px;
        bottom: 88px;
        width: auto;
        max-height: calc(100vh - 120px);
    }

    .kcw__btn {
        right: 32px;
        bottom: 32px;
        width: 40px;
        height: 40px;
    }

    .kcw.kcw_open .kcw__btn {
        right: 24px;
        bottom: 24px;
    }

    .kcw__icon--chat {
        width: 21px;
        height: 21px;
    }

    .kcw__icon--close {
        width: 16px;
        height: 16px;
    }
}
