/* IB4 2026-10-29: кнопка «Напишите нам» (KB#26544). Цвета и размеры — по требованиям маркетинга (Карина, msg 2018). */
.ib4c {
    --ib4c-size: 56px;
    --ib4c-ico: 40px;
    --ib4c-gap: 24px;
    position: fixed;
    right: calc(var(--ib4c-gap) + env(safe-area-inset-right, 0px));
    bottom: calc(var(--ib4c-gap) + var(--ib4c-lift, 0px) + env(safe-area-inset-bottom, 0px));
    z-index: 100; /* ниже шапки сайта (101): её меню перекрывают кнопку; модальные окна и попапы — тоже выше */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: "Ubuntu", "Arial", sans-serif;
    font-size: 15px;
    line-height: 1.3;
    color: #1D2638;
    -webkit-tap-highlight-color: transparent;
    transition: bottom .2s ease;
}
.ib4c[hidden],
.ib4c.ib4c--typing,
.no-scroll .ib4c,
.no-scroll-mobile .ib4c {
    display: none !important;
}
.ib4c *,
.ib4c *::before,
.ib4c *::after {
    box-sizing: border-box;
}

/* Главная кнопка */
.ib4c__btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--ib4c-size);
    height: var(--ib4c-size);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #EF046D;
    box-shadow: 0 6px 18px rgba(239, 4, 109, .35);
    cursor: pointer;
    transition: background-color .15s ease;
}
.ib4c__btn:hover,
.ib4c__btn:active,
.ib4c--open .ib4c__btn {
    background: #D10360;
}
.ib4c__btn:focus {
    outline: none;
}
.ib4c__btn:focus-visible {
    outline: 3px solid #2B9DD9;
    outline-offset: 3px;
}
.ib4c__btn svg {
    display: block;
    width: 26px;
    height: 26px;
}
.ib4c__btn .ib4c__i-close {
    display: none;
    width: 24px;
    height: 24px;
}
.ib4c--open .ib4c__i-open {
    display: none;
}
.ib4c--open .ib4c__i-close {
    display: block;
}

/* Меню: открывается на месте кнопки, значки — столбиком над кнопкой */
.ib4c__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: max-content;
    min-width: 224px;
    max-width: min(300px, calc(100vw - 32px));
    max-height: calc(100vh - var(--ib4c-size) - var(--ib4c-gap) - var(--ib4c-lift, 0px) - 40px);
    overflow-y: auto;
    padding: 14px 8px 12px 18px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(29, 38, 56, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transform-origin: 100% 100%;
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.ib4c--open .ib4c__menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .16s ease, transform .16s ease;
}
.ib4c__head {
    margin: 0 0 6px;
    padding-right: 10px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    color: #1D2638;
}
.ib4c__item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: calc(var(--ib4c-ico) + 8px);
    padding: 4px 0;
    color: #1D2638;
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
}
.ib4c__item:hover,
.ib4c__item:focus-visible {
    color: #EF046D;
    text-decoration: none;
}
.ib4c__item:focus {
    outline: none;
}
.ib4c__item:focus-visible .ib4c__ico {
    outline: 2px solid #2B9DD9;
    outline-offset: 2px;
}
.ib4c__label {
    flex: 1 1 auto;
    white-space: nowrap;
}
.ib4c__ico {
    display: block;
    flex: 0 0 var(--ib4c-ico);
    width: var(--ib4c-ico);
    height: var(--ib4c-ico);
    border-radius: 50%;
}
.ib4c__foot {
    margin-top: 6px;
    padding-right: 10px;
    font-size: 12px;
    line-height: 1.35;
    color: #8B90A0;
}
.ib4c--night #contact-call,
.ib4c--no-messengers #contact-max,
.ib4c--no-messengers #contact-vk,
.ib4c--no-messengers #contact-tg {
    display: none;
}
.ib4c__phone-m {
    display: none;
}

/* Подсказка — только на компьютере, по наведению */
.ib4c__tip {
    position: absolute;
    right: calc(100% + 12px);
    bottom: calc((var(--ib4c-size) - 40px) / 2);
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 8px 0 14px;
    background: #FFFFFF;
    border: 1px solid #EF046D;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(29, 38, 56, .08);
    color: #1D2638;
    font-size: 15px;
    line-height: 1.25;
    white-space: nowrap;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateX(6px);
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.ib4c--tip .ib4c__tip {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .15s ease, transform .15s ease;
}
.ib4c--night .ib4c__tip {
    width: 330px;
    padding-top: 7px;
    padding-bottom: 7px;
    border-radius: 24px;
    white-space: normal;
}
.ib4c__tip-logo {
    display: block;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
}
.ib4c__tip-text {
    flex: 1 1 auto;
}
.ib4c__tip-close {
    display: flex;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8B90A0;
    cursor: pointer;
}
.ib4c__tip-close:hover,
.ib4c__tip-close:focus-visible {
    background: #FDE6F0;
    color: #D10360;
    outline: none;
}

@media (max-width: 767px), (pointer: coarse) {
    .ib4c__phone-d {
        display: none;
    }
    .ib4c__phone-m {
        display: inline;
    }
    .ib4c__tip {
        display: none;
    }
}
@media (max-width: 767px) {
    .ib4c {
        --ib4c-size: 52px;
        --ib4c-ico: 36px;
        --ib4c-gap: 16px;
    }
    .ib4c__btn svg {
        width: 24px;
        height: 24px;
    }
    .ib4c__menu {
        padding: 12px 8px 10px 16px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .ib4c,
    .ib4c * {
        transition: none !important;
    }
}
@media print {
    .ib4c {
        display: none !important;
    }
}
