.floating-contacts {
    position: fixed;
    right: calc(24px + env(safe-area-inset-right, 0px));
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 850;
}

.floating-contacts-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ffbb00;
    color: #141519;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 0.2s, transform 0.2s;
}

.floating-contacts-toggle:hover {
    background: #ffca38;
}

.floating-contacts-toggle:active {
    transform: scale(0.95);
}

.floating-contacts-close-icon,
.floating-contacts-toggle[aria-expanded="true"] .floating-contacts-open-icon {
    display: none;
}

.floating-contacts-toggle[aria-expanded="true"] .floating-contacts-close-icon {
    display: block;
}

.floating-contacts-links {
    position: absolute;
    right: 2px;
    bottom: calc(100% + 16px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: max-content;
    max-width: calc(100vw - 60px - env(safe-area-inset-right, 0px) - env(safe-area-inset-left, 0px));
    max-height: calc(100vh - 120px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px));
    max-height: calc(100dvh - 120px - env(safe-area-inset-bottom, 0px) - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    padding: 4px;
    animation: floating-contacts-reveal 0.2s ease-out;
}

.floating-contacts-links[hidden] {
    display: none;
}

.floating-contacts-link {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    border-radius: 50%;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.4;
    text-decoration: none;
    touch-action: manipulation;
}

.floating-contacts-link:hover .floating-contacts-icon {
    filter: brightness(1.12);
}

.floating-contacts-icon {
    display: flex;
    flex: 0 0 52px;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #48525e;
}

.floating-contacts-whatsapp {
    background: #20c85a;
}

.floating-contacts-whatsapp-symbol {
    display: block;
    filter: brightness(0) invert(1);
}

.floating-contacts-telegram {
    background: #229ed9;
}

.floating-contacts-toggle:focus-visible,
.floating-contacts-link:focus-visible {
    outline: 3px solid #1c69d4;
    outline-offset: 3px;
}

@keyframes floating-contacts-reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .floating-contacts {
        right: calc(16px + env(safe-area-inset-right, 0px));
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .floating-contacts-toggle {
        width: 56px;
        height: 56px;
    }

    .floating-contacts-links {
        right: 0;
        gap: 10px;
        max-width: calc(100vw - 32px - env(safe-area-inset-right, 0px) - env(safe-area-inset-left, 0px));
    }

    .floating-contacts-icon {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .floating-contacts-toggle {
        transition: none;
    }

    .floating-contacts-links {
        animation: none;
    }
}
