.wcfc,
.wcfc * {
    box-sizing: border-box;
}

.wcfc {
    position: fixed;
    right: clamp(16px, 2vw, 28px);
    bottom: clamp(16px, 2vw, 28px);
    z-index: 99990;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-family: Montserrat, sans-serif;
}

.wcfc__messenger-group {
    position: relative;
}

.wcfc__main-button,
.wcfc__main-button:visited,
.wcfc__main-button:hover,
.wcfc__main-button:focus,
.wcfc__main-button:active {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 8px 24px rgba(17, 17, 17, 0.16);
    transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.wcfc__main-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(17, 17, 17, 0.2);
}

.wcfc__main-button:focus-visible,
.wcfc__messenger-link:focus-visible {
    outline: 3px solid rgba(214, 132, 95, 0.42);
    outline-offset: 4px;
}

.wcfc__main-button--messenger {
    color: #fff;
    background: #D6845F;
}

.wcfc__main-button--messenger:hover,
.wcfc__main-button--messenger:focus {
    color: #fff;
    background: #C5724F;
}

.wcfc.is-open .wcfc__main-button--messenger,
.wcfc.is-open .wcfc__main-button--messenger:hover,
.wcfc.is-open .wcfc__main-button--messenger:focus {
    color: #171717;
    background: #fff;
}

.wcfc__main-button--phone,
.wcfc__main-button--phone:visited,
.wcfc__main-button--phone:hover,
.wcfc__main-button--phone:focus,
.wcfc__main-button--phone:active {
    color: #fff;
    background: #171717;
}

.wcfc__main-button--phone:hover,
.wcfc__main-button--phone:focus {
    color: #fff;
    background: #292929;
}

.wcfc__main-button svg {
    display: block;
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wcfc__main-button--phone > svg {
    width: 100%;
    height: 100%;
    max-width: none;
    stroke: none;
}

.wcfc__phone-close {
    display: none;
    align-items: center;
    justify-content: center;
}

.wcfc__phone-close svg {
    display: block;
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wcfc.is-callback-open .wcfc__main-button--phone,
.wcfc.is-callback-open .wcfc__main-button--phone:visited,
.wcfc.is-callback-open .wcfc__main-button--phone:hover,
.wcfc.is-callback-open .wcfc__main-button--phone:focus,
.wcfc.is-callback-open .wcfc__main-button--phone:active {
    color: #171717;
    background: #fff;
}

.wcfc.is-callback-open .wcfc__main-button--phone > svg {
    display: none;
}

.wcfc.is-callback-open .wcfc__phone-close {
    display: flex;
}

.wcfc__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcfc__icon--close {
    display: none;
}

.wcfc.is-open .wcfc__icon--chat {
    display: none;
}

.wcfc.is-open .wcfc__icon--close {
    display: flex;
}

.wcfc__menu {
    position: absolute;
    right: 3px;
    bottom: calc(100% + 14px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.94);
    transform-origin: bottom center;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.wcfc.is-open .wcfc__menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.wcfc__messenger-link,
.wcfc__messenger-link:visited,
.wcfc__messenger-link:hover,
.wcfc__messenger-link:focus,
.wcfc__messenger-link:active {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    background: transparent;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(17, 17, 17, 0.14);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.wcfc__messenger-link:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 9px 22px rgba(17, 17, 17, 0.18);
}

.wcfc__messenger-link img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
}

.wcfc-popup-phone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 100%;
    margin: 4px 0 0;
    text-align: center;
    font-family: Montserrat, sans-serif;
}

.wcfc-popup-phone__label {
    color: #747474;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

.wcfc-popup-phone__number,
.wcfc-popup-phone__number:visited,
.wcfc-popup-phone__number:hover,
.wcfc-popup-phone__number:focus,
.wcfc-popup-phone__number:active {
    color: #171717;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
}

.wcfc-popup-phone__number:hover,
.wcfc-popup-phone__number:focus {
    color: #D6845F;
}

@media (max-width: 767px) {
    .wcfc {
        right: 16px;
        bottom: 16px;
        gap: 10px;
    }

    .wcfc__main-button,
    .wcfc__main-button:visited,
    .wcfc__main-button:hover,
    .wcfc__main-button:focus,
    .wcfc__main-button:active {
        width: 54px;
        height: 54px;
        min-width: 54px;
        min-height: 54px;
    }

    .wcfc__messenger-link,
    .wcfc__messenger-link:visited,
    .wcfc__messenger-link:hover,
    .wcfc__messenger-link:focus,
    .wcfc__messenger-link:active {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }

    .wcfc__menu {
        right: 3px;
        bottom: calc(100% + 12px);
        gap: 9px;
    }

    .wcfc-popup-phone__label {
        font-size: 12px;
    }

    .wcfc-popup-phone__number,
    .wcfc-popup-phone__number:visited,
    .wcfc-popup-phone__number:hover,
    .wcfc-popup-phone__number:focus,
    .wcfc-popup-phone__number:active {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wcfc__main-button,
    .wcfc__menu,
    .wcfc__messenger-link {
        transition: none;
    }
}

@media print {
    .wcfc {
        display: none !important;
    }
}
