/* =============================================
   Виджет: контакты + scroll-to-top (правый нижний угол)
   ============================================= */

:root {
    --stte-bg: rgba(30, 30, 40, 0.94);
    --stte-accent: #2D7FFF;
    --stte-accent-dark: #012ECD;
    --stte-max: #6a3cff;
    --stte-tg: #29a9eb;
    --stte-wa: #25d366;
    --stte-offset: 20px;
    --stte-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.stte-root {
    position: fixed;
    right: var(--stte-offset);
    bottom: var(--stte-offset);
    z-index: 9990;
    pointer-events: none;
}

.stte-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: auto;
}

/* ─── Кнопка "Наверх" ─── */
.stte-top {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stte-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    transition: transform 0.3s ease, opacity 0.3s ease, background 0.25s ease, color 0.25s ease, visibility 0.3s;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.9);
    order: -1;
}

.stte-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.stte-top:hover {
    background: linear-gradient(135deg, var(--stte-accent) 0%, var(--stte-accent-dark) 100%);
    color: #fff;
    transform: translateY(-3px) scale(1);
    box-shadow: 0 14px 34px rgba(1, 46, 205, 0.45);
}

.stte-top:active { transform: translateY(0) scale(0.96); }

/* ─── Раскрывающееся меню ─── */
.stte-contacts__menu {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: var(--stte-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform-origin: bottom right;
    animation: stte-menu-in 0.25s ease forwards;
}

.stte-contacts__menu.is-open { display: flex; }

@keyframes stte-menu-in {
    from { opacity: 0; transform: translateY(12px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.stte-contacts__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.stte-contacts__item:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(3px);
    color: #fff;
}

.stte-contacts__icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    color: inherit;
    transition: background 0.2s ease;
}

.stte-contacts__item--max .stte-contacts__icon { color: var(--stte-max); }
.stte-contacts__item--tg  .stte-contacts__icon { color: var(--stte-tg); }
.stte-contacts__item--wa  .stte-contacts__icon { color: var(--stte-wa); }

.stte-contacts__item--max:hover .stte-contacts__icon { background: rgba(106, 60, 255, 0.30); }
.stte-contacts__item--tg:hover  .stte-contacts__icon { background: rgba(41, 169, 235, 0.28); }
.stte-contacts__item--wa:hover  .stte-contacts__icon { background: rgba(37, 211, 102, 0.28); }

/* ─── Главная кнопка "Связаться" ─── */
.stte-contacts__toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    background: linear-gradient(135deg, var(--stte-accent) 0%, var(--stte-accent-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(1, 46, 205, 0.40);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    white-space: nowrap;
}

.stte-contacts__toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(1, 46, 205, 0.55);
}

.stte-contacts__toggle:active { transform: translateY(0); }

.stte-contacts__toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.stte-contacts__toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 rgba(45, 127, 255, 0.55);
    animation: stte-pulse 2.4s infinite;
    pointer-events: none;
}

@keyframes stte-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(45, 127, 255, 0.55); }
    70%  { box-shadow: 0 0 0 22px rgba(45, 127, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(45, 127, 255, 0); }
}

/* ─── Адаптив виджета ─── */
@media (max-width: 767px) {
    :root { --stte-offset: 14px; }

    .stte-top {
        width: 46px;
        height: 46px;
    }

    .stte-contacts__toggle {
        width: 52px;
        height: 52px;
        padding: 0;
        justify-content: center;
    }

    .stte-contacts__toggle-text { display: none; }

    .stte-contacts__menu { padding: 8px; }

    .stte-contacts__item {
        padding: 10px;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
    }

    .stte-contacts__label { display: none; }

    .stte-contacts__icon {
        width: 26px;
        height: 26px;
        background: transparent;
    }
}

/* ─── Скрыть старый виджет ─── */
#scrollToTopExt { display: none !important; }