/* ===================== */
/* Обертка для блока и ripple */
.popup-contacts-wrapper {
    position: fixed;
    right: 75px;
    bottom: 75px;
    width: 80px;
    height: 80px;
}

/* ===================== */
/* Ripple круги */
.popup-contacts-ripples {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    transform: translate(-50%, -50%);
    z-index: 50; /* за блоком */
}

.popup-contacts-ripples .ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    border: 3px solid rgba(5, 108, 242, 0.5);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0.5;
    pointer-events: none;
    animation: ripple 2s infinite;
}

/* При hover или открытом блоке скрываем ripple */
.popup-contacts-wrapper:hover .ripple,
.popup-contacts-wrapper .popup-contacts.is-open ~ .popup-contacts-ripples .ripple {
    opacity: 0;
}

/* Смещение анимации для разных кругов */
.popup-contacts-ripples .ripple:nth-child(1) { animation-delay: 0s; }
.popup-contacts-ripples .ripple:nth-child(2) { animation-delay: 0.5s; }
.popup-contacts-ripples .ripple:nth-child(3) { animation-delay: 1s; }

@keyframes ripple {
    0% {
        transform: scale(0.3);
        opacity: 0.5;
        border-width: 3px;
    }
    70% {
        opacity: 0.3;
        border-width: 2.5px;
    }
    100% {
        transform: scale(2);
        opacity: 0;
        border-width: 2px;
    }
}

/* ===================== */
/* Контейнер блока */
.popup-contacts {
    width: 80px;
    height: 80px;
    background: linear-gradient(90deg, #0540F2 0%, #056CF2 100%);
    border-radius: 50%;
    cursor: pointer;
    z-index: 100; /* выше ripple */
    position: absolute;
    bottom: 0;
    right: 0;
    overflow: hidden;
    transition:
        width 0.35s ease 0.2s,
        height 0.35s ease 0.2s,
        border-radius 0.35s ease 0.2s;
}

/* ===================== */
/* Иконка */
.popup-contacts__icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 42px;
    transition: opacity 0.2s ease 0.45s;
}

/* ===================== */
/* Контент */
.popup-contacts__content {
    position: absolute;
    inset: 0;
    padding: 20px;
    background: linear-gradient(90deg, #0540F2 0%, #056CF2 100%);
    color: #fff;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.25s ease 0s, transform 0.25s ease 0s;
    border-radius: 16px;
}

.popup-contacts__content p a {
  color: #fff !important;
  font-size: 1.2rem;
}

/* ===================== */
/* Desktop hover */
@media (hover: hover) and (pointer: fine) {
    .popup-contacts:hover .popup-contacts__icon { opacity: 0; transition-delay: 0s; }
    .popup-contacts:hover { width: 320px; height: 180px; border-radius: 16px; transition-delay: 0.2s; }
    .popup-contacts:hover .popup-contacts__content { opacity: 1; transform: translateY(0); pointer-events: auto; transition-delay: 0.45s; }
}

/* ===================== */
/* Mobile open */
.popup-contacts.is-open .popup-contacts__icon { opacity: 0; transition-delay: 0s; }
.popup-contacts.is-open { width: 320px; height: 180px; border-radius: 16px; transition-delay: 0.2s; }
.popup-contacts.is-open .popup-contacts__content { opacity: 1; transform: translateY(0); pointer-events: auto; transition-delay: 0.45s; }

/* ===================== */
/* Обратная анимация */
.popup-contacts:not(:hover):not(.is-open) .popup-contacts__content { opacity: 0; transform: translateY(10px); transition-delay: 0s; }
.popup-contacts:not(:hover):not(.is-open) { width: 80px; height: 80px; border-radius: 50%; transition-delay: 0.25s; }
.popup-contacts:not(:hover):not(.is-open) .popup-contacts__icon { opacity: 1; transition-delay: 0.45s; }
