/* Isolated floating contact control; never changes the shared page shell. */
.contact-widget {
    position: fixed;
    right: max(18px, env(safe-area-inset-right, 0px));
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
    z-index: 1400; /* Below the compact navigation (1600) and photo dialogs (2000+). */
    width: 52px;
    height: 52px;
    font-family: 'Manrope', sans-serif;
}

.contact-widget[hidden],
.contact-widget .contact-widget__links[hidden],
body.menu-open .contact-widget,
body.modal-open .contact-widget {
    display: none;
}

.contact-widget .contact-widget__toggle,
.contact-widget .contact-widget__link {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 50%;
    color: #fff;
    -webkit-text-fill-color: #fff;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    box-shadow: 0 5px 15px rgba(28, 53, 70, 0.2);
    transition: filter 160ms ease, box-shadow 160ms ease;
    -webkit-tap-highlight-color: transparent;
}

.contact-widget .contact-widget__toggle {
    background: linear-gradient(150deg, #678393, #3d5e73);
    box-shadow: 0 6px 20px rgba(28, 53, 70, 0.25), inset 0 1px rgba(255, 255, 255, 0.18);
}

.contact-widget .contact-widget__links {
    position: absolute;
    right: 2px;
    bottom: 64px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.contact-widget .contact-widget__links > li {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
}

.contact-widget .contact-widget__link {
    width: 48px;
    height: 48px;
}

.contact-widget [data-messenger="max"] { background: linear-gradient(145deg, #168be9, #7650e9); }
.contact-widget [data-messenger="telegram"] { background: #229ed9; }
.contact-widget [data-messenger="whatsapp"] { background: #1b9c62; }

.contact-widget .contact-widget__link:disabled {
    opacity: 0.65;
    filter: saturate(0.6);
    cursor: not-allowed;
    box-shadow: none;
}

.contact-widget .contact-widget__icon {
    display: block;
    width: 25px;
    height: 25px;
    pointer-events: none;
}

.contact-widget .contact-widget__link > i {
    display: block;
    font-size: 25px;
    line-height: 1;
    pointer-events: none;
}

.contact-widget .contact-widget__toggle:focus-visible,
.contact-widget .contact-widget__link:focus-visible {
    outline: 3px solid #183b55;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #fff;
}

@media (hover: hover) and (pointer: fine) {
    .contact-widget .contact-widget__toggle:hover,
    .contact-widget .contact-widget__link:not(:disabled):hover {
        filter: brightness(1.09);
    }
}

@media (max-width: 640px), (max-height: 480px) {
    .contact-widget {
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        width: 48px;
        height: 48px;
    }
    .contact-widget .contact-widget__toggle { width: 48px; height: 48px; }
    .contact-widget .contact-widget__links { bottom: 58px; right: 0; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .contact-widget .contact-widget__toggle,
    .contact-widget .contact-widget__link { transition: none; }
}

@media print { .contact-widget { display: none; } }
