/* ==========================================================================
   Плавающий виджет мессенджеров «Сахар» — ВАРИАНТ 6: живое приветствие.

   Внизу справа аватар администратора. Через несколько секунд над ним
   всплывает сообщение: сначала «печатает…», затем текст и три кнопки
   мессенджеров. Клик по аватару открывает и закрывает окно.

   Файл самодостаточный: переменные объявлены на .wv, чтобы не засорять :root.
   ========================================================================== */

.wv {
    --wv-gold: #dcb36e;
    --wv-gold-grad: linear-gradient(-27deg, #dcb36e 0%, #f4d5aa 100%);
    --wv-tg: linear-gradient(180deg, #37B4F0 0%, #229ED9 100%);
    --wv-wa: linear-gradient(180deg, #34DE68 0%, #1BD741 100%);
    --wv-max: linear-gradient(140deg, #A03BE0 0%, #6C2FD9 50%, #1B5CF0 100%);
    --wv-ease: cubic-bezier(.34, 1.4, .64, 1);
    --wv-font: "GothamPro", "Helvetica Neue", Arial, sans-serif;
    --wv-serif: "Playfair Display", Georgia, serif;
}

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

.wv {
    font-family: var(--wv-font);
    -webkit-tap-highlight-color: transparent;
}

.wv a {
    text-decoration: none;
}

.wv svg {
    display: block;
}

/* ==========================================================================
   6. Живое приветствие: аватар администратора + всплывающее сообщение
   ========================================================================== */

.wv--6 {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.wv--6 .wv-bubble {
    position: relative;
    width: 340px;
    margin-bottom: 16px;
    padding: 16px 16px 14px;
    border-radius: 18px 18px 4px 18px;
    background: #fbf6ee;
    color: #1b1b1b;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .5);
    transform-origin: bottom right;
    transform: scale(.6) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform .5s var(--wv-ease), opacity .25s;
}

.wv--6.is-greet .wv-bubble,
.wv--6.is-open .wv-bubble {
    transform: none;
    opacity: 1;
    pointer-events: auto;
}

.wv--6 .wv-name {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #a07a3c;
    margin-bottom: 6px;
}

.wv--6 .wv-msg {
    font: 400 17px/1.35 var(--wv-serif);
    margin: 0 0 12px;
}

/* «печатает…» */
.wv--6 .wv-typing {
    display: inline-flex;
    gap: 4px;
    padding: 6px 0 10px;
}

.wv--6 .wv-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c8a46a;
    animation: wv-dots 1.1s infinite;
}

.wv--6 .wv-typing i:nth-child(2) {
    animation-delay: .15s;
}

.wv--6 .wv-typing i:nth-child(3) {
    animation-delay: .3s;
}

@keyframes wv-dots {
    0%, 60%, 100% {
        transform: none;
        opacity: .4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.wv--6.is-typed .wv-typing {
    display: none;
}

.wv--6:not(.is-typed) .wv-msg,
.wv--6:not(.is-typed) .wv-chips {
    display: none;
}

/* ---------- кнопки мессенджеров ---------- */
.wv--6 .wv-chips {
    display: flex;
    gap: 6px;
}

.wv--6 .wv-chip {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    border-radius: 18px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    transition: transform .2s, filter .2s;
}

.wv--6 .wv-chip:hover {
    transform: translateY(-2px);
    filter: brightness(1.07);
}

.wv--6 .wv-chip svg {
    width: 16px;
    height: 16px;
}

.wv--6 .wv-chip--tg {
    background: var(--wv-tg);
}

.wv--6 .wv-chip--wa {
    background: var(--wv-wa);
}

.wv--6 .wv-chip--max {
    background: var(--wv-max);
}

/* ---------- крестик ---------- */
.wv--6 .wv-bclose {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.wv--6 .wv-bclose svg {
    width: 12px;
    height: 12px;
}

/* ---------- аватар ---------- */
.wv--6 .wv-avatar {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    padding: 2px;
    border: 0;
    cursor: pointer;
    background: var(--wv-gold-grad);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .55);
}

.wv--6 .wv-avatar-in {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #0e0e0e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wv-gold);
    font: italic 400 26px/1 var(--wv-serif);
}

.wv--6 .wv-dot {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2fd65c;
    border: 2px solid #0e0e0e;
}

.wv--6 .wv-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #f24841;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wv--6.is-open .wv-badge,
.wv--6.is-seen .wv-badge {
    display: none;
}

/* ------------------------------------------------------------ телефон */
@media (max-width: 767px) {
    .wv--6 {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .wv--6 .wv-bubble {
        width: calc(100vw - 28px);
    }

    .wv--6 .wv-avatar {
        width: 58px;
        height: 58px;
    }

    .wv--6 .wv-avatar-in {
        font-size: 23px;
    }
}

/* --------------------------------------------- уменьшение движения */
@media (prefers-reduced-motion: reduce) {
    .wv *,
    .wv *::before,
    .wv *::after {
        transition: none !important;
        animation: none !important;
    }
}
