/* Messenger widget — фиксированный блок мессенджеров слева */

:root {
    --mw-violet: #630778;
    --mw-violet-dark: #4a0559;
    --mw-violet-light: #f5ecf8;
    --mw-tg: #2AABEE;
    --mw-tg-2: #229ED9;
    --mw-wa: #25D366;
    --mw-wa-2: #128C7E;
    --mw-text: #1f1f2e;
    --mw-muted: #6b7280;
    --mw-bg: #ffffff;
    --mw-border: #ececf2;
    --mw-shadow-lg: 0 24px 60px rgba(31, 31, 46, .28);
    --mw-shadow-md: 0 8px 28px rgba(31, 31, 46, .18);
}

/* ===== Trigger ===== */
.mw-trigger {
    position: fixed;
    left: 20px;
    bottom: 110px;
    z-index: 999998;
    width: 66px;
    height: 155px;
    padding: 10px 0;
    margin: 0;
    border-radius: 44px;
    background: var(--color-violet);
    box-shadow: var(--mw-shadow-md);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mw-pulse 2.4s ease-out infinite;

}
.mw-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(31, 31, 46, .24);
}
.mw-trigger:focus-visible {
    outline: 2px solid var(--mw-violet);
    outline-offset: 3px;
}

@keyframes mw-pulse {
    0%   { box-shadow: var(--mw-shadow-md), 0 0 0 0 rgba(99,7,120,.40); }
    70%  { box-shadow: var(--mw-shadow-md), 0 0 0 22px rgba(99,7,120,0); }
    100% { box-shadow: var(--mw-shadow-md), 0 0 0 0 rgba(99,7,120,0); }
}

/* Вертикальная стопка иконок в триггере */
.mw-trigger__icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 50px;
}
.mw-trigger__icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: -12px;
    background: #fff;
}
.mw-trigger__icon:first-child {
    margin-top: 0;
}
.mw-trigger__icon svg,
.mw-trigger__icon img {
    width: 100%;
    height: 100%;
    display: block;
}
.mw-trigger__icon--tg {
    color: var(--mw-tg);
    z-index: 3;
}
.mw-trigger__icon--tg svg { fill: currentColor; }
.mw-trigger__icon--max {
    z-index: 2;
    background: var(--color-violet);
}
.mw-trigger__icon--max img {
    padding: 0;
}
.mw-trigger__icon--wa {
    z-index: 1;
    color: var(--mw-wa);
}
.mw-trigger__icon--wa svg { fill: currentColor; }

.mw-trigger.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(.8);
    animation: none;
}

/* ===== Overlay (на всю страницу при открытии) ===== */
.mw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 30, .35);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s ease;
    z-index: 999998;
}
.mw-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Modal ===== */
.mw-modal {
    position: fixed;
    left: 20px;
    bottom: 30px;
    z-index: 999999;
    width: 360px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 60px);
    background: var(--mw-bg);
    border-radius: 20px;
    box-shadow: var(--mw-shadow-lg);
    padding: 22px 20px 18px;
    opacity: 0;
    transform: translateY(20px) scale(.96);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    color: var(--mw-text);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mw-modal.is-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
.mw-header {
    padding-right: 48px;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.mw-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: #f6f6f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
    padding: 0;
    z-index: 2;
}
.mw-close svg path {
    transition: stroke .2s ease;
}
.mw-close:hover {
    background: #efefef;
}
.mw-close:hover svg path {
    stroke: var(--mw-violet);
}
.mw-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--mw-text);
    letter-spacing: -0.05em;
}
.mw-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: normal;
    color: var(--mw-muted);
    margin-top: 8px;
    padding: 4px 10px 4px 8px;
    background: #f0fdf4;
    border-radius: 20px;
    font-weight: 500;
}
.mw-subtitle__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mw-wa);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, .6);
    animation: mw-dot-pulse 1.8s ease-out infinite;
}
@keyframes mw-dot-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, .6); }
    70%  { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Messengers list */
.mw-messengers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}
.mw-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--mw-text);
    background: #f7f7fb;
    border: 1px solid var(--mw-border);
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.mw-msg:hover {
    background: #fff;
    border-color: #d8d8e6;
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(31, 31, 46, .08);
    text-decoration: none;
    color: var(--mw-text);
}
.mw-msg__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    overflow: hidden;
}
.mw-msg__icon svg,
.mw-msg__icon img {
    width: 36px;
    height: 36px;
    display: block;
}
.mw-msg--tg .mw-msg__icon { color: var(--mw-tg); }
.mw-msg--tg .mw-msg__icon svg { fill: currentColor; }
.mw-msg--max .mw-msg__icon { padding: 2px; }
.mw-msg__name {
    font-size: 16px;
    font-weight: 600;
}

.mw-msg__name-tg{
    font-size: 12px;
    line-height: 1.35;
    color: var(--mw-text);
    font-weight: 400;
}

.mw-msg__name-tg strong{
    font-size: 16px;
}

/* WhatsApp block */
.mw-whatsapp {
    margin-bottom: 12px;
}
.mw-whatsapp__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--mw-text);
    background: #f0fdf4;
    border: 1px solid #d6f5e1;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.mw-whatsapp__link:hover {
    background: #e7fbef;
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, .12);
    text-decoration: none;
    color: var(--mw-text);
}
.mw-whatsapp__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--mw-wa);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
}
.mw-whatsapp__icon svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}
.mw-whatsapp__text {
    font-size: 13px;
    line-height: 1.35;
    color: var(--mw-text);
}
.mw-whatsapp__text strong {
    font-size: 16px;
    font-weight: 600;
    display: inline-block;
    margin-right: 4px;
}

/* Director button */
.mw-director {
    margin-bottom: 14px;
}
.mw-director__link {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--mw-violet) 0%, var(--mw-violet-dark) 100%);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    position: relative;
    overflow: hidden;
}
.mw-director__link::after {
    content: "→";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: .8;
    transition: transform .2s ease, opacity .2s ease;
}
.mw-director__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 7, 120, .35);
    filter: brightness(1.06);
    text-decoration: none;
    color: #fff;
}
.mw-director__link:hover::after {
    transform: translateY(-50%) translateX(3px);
    opacity: 1;
}
.mw-director__title {
    font-size: 13px;
    opacity: .85;
    line-height: 1;
}
.mw-director__subtitle {
    font-size: 16px;
    font-weight: 700;
    margin-top: 5px;
    line-height: 1.2;
}

/* Footer trust — чипы */
.mw-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--mw-border);
    border-radius: 0;
}
.mw-trust {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mw-text);
    padding: 6px 12px;
    background: #fff;
    border-radius: 20px;
    flex: 1;
    justify-content: center;
    border: 1px solid #c8becc;
}
.mw-trust svg {
    width: 20px;
    height: 20px;
    color: var(--mw-wa);
    flex: 0 0 20px;
}

/* ===== Adaptive ===== */

@media(max-width: 1600px){
    .mw-trigger__icon{
        width: 45px;
        height: 45px;
    }
    .mw-trigger__icons{
        width: 45px;
    }
    .mw-trigger{
        width: 58px;
        height: 142px;
    }
}

@media (max-width: 991px) {
    .mw-trigger { bottom: 95px; }
    .mw-modal   { bottom: 24px; }
}

@media (max-width: 767px) {
    .mw-trigger {
        left: 14px;
        bottom: 85px;
        width: 55px;
        height: 120px;
    }
    .mw-trigger__icon { width: 40px; height: 40px; margin-top: -10px; }
    .mw-modal {
        left: 14px;
        right: 14px;
        width: auto;
        max-width: none;
        bottom: 20px;
        max-height: calc(100vh - 40px);
        padding: 20px 18px 16px;
    }
}

@media (max-width: 480px) {
    .mw-trigger { bottom: 78px; }
    .mw-modal   { bottom: 16px; padding: 18px 16px 14px; max-height: calc(100vh - 32px); }
    .mw-title { font-size: 19px; }
    .mw-msg__name { font-size: 15px; }
}
