/* Основной контейнер виджета */
.contact-widget {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    
    /* Изначально весь виджет скрыт, он плавно проявится через JS */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Контейнер со списком мессенджеров */
.contact-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Класс, который активирует появление мессенджеров */
.contact-widget.active .contact-links {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Общие стили для кнопок-ссылок */
.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    position: relative;
}

.contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

/* Текстовые подсказки при наведении на ПК */
.contact-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 70px;
    background-color: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

@media (hover: hover) {
    .contact-btn:hover::before {
        opacity: 1;
        visibility: visible;
    }
}

/* Цвета брендов мессенджеров */
.btn-whatsapp { background-color: #25D366; }
.btn-telegram { background-color: #0088cc; }
.btn-viber { background-color: #7360F2; }

/* --- КАСКАДНАЯ ЗАДЕРЖКА ПОЯВЛЕНИЯ ИКОНОК --- */
/* Поочередное появление снизу вверх при открытии */
.contact-widget.active .btn-viber {
    transition-delay: 0.05s;
}
.contact-widget.active .btn-telegram {
    transition-delay: 0.15s;
}
.contact-widget.active .btn-whatsapp {
    transition-delay: 0.25s;
}

/* Стили главной кнопки-триггера */
.btn-main {
    background-color: #007bff;
    cursor: pointer;
    border: none;
    outline: none;
}

/* Иконки внутри кнопок */
.contact-btn i {
    font-size: 24px;
    transition: transform 0.4s ease;
}

/* Анимация крестика на главной кнопке при открытии */
.contact-widget.active .btn-main i {
    transform: rotate(135deg);
}

/* Изменение цвета главной кнопки при активации на красный */
.contact-widget.active .btn-main {
    background-color: #dc3545;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .contact-widget {
        bottom: 20px;
        right: 20px;
    }
    .contact-btn {
        width: 50px;
        height: 50px;
    }
    .contact-btn i {
        font-size: 22px;
    }
    .contact-btn::before {
        display: none; /* Отключаем подсказки на телефонах */
    }
}
