.ray-contact {
    position: fixed;
    right: 24px;
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 200;
    font: inherit;
    text-align: left;
}

.ray-contact,
.ray-contact * {
    box-sizing: border-box;
}

.ray-contact[hidden],
.ray-contact__panel[hidden] {
    display: none;
}

.ray-contact button,
.ray-contact a {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.ray-contact button {
    cursor: pointer;
}

.ray-contact a {
    text-decoration: none;
}

.ray-contact__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 56px;
    padding: 0 22px;
    border: 1px solid var(--ray-accent, #181818);
    border-radius: 9999px;
    background: var(--ray-accent, #181818);
    color: #fff;
    box-shadow: 0 6px 24px rgb(0 0 0 / 16%);
    font-size: 15px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.ray-contact__icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
}

.ray-contact__chevron {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    transition: transform 180ms ease;
}

.ray-contact.is-open .ray-contact__chevron {
    transform: rotate(180deg);
}

.ray-contact__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(376px, calc(100vw - 32px));
    max-height: 70vh;
    max-height: min(70dvh, 600px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 20px;
    border: 1px solid #e6e6e6;
    border-radius: 24px;
    background: #fff;
    color: #181818;
    box-shadow: 0 12px 48px rgb(0 0 0 / 16%);
}

.ray-contact__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.ray-contact__title {
    margin: 0;
    color: #181818;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
}

.ray-contact__close {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #e6e6e6;
    border-radius: 50%;
    background: #fff;
    color: #181818;
}

.ray-contact__branch + .ray-contact__branch {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e6e6e6;
}

.ray-contact__branch-title {
    margin: 0;
    color: #181818;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.ray-contact__address {
    margin: 4px 0 8px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.ray-contact__phone {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #181818;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.4;
}

.ray-contact__messengers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.ray-contact__messenger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    background: #f7f7f7;
    color: #181818;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
}

.ray-contact button:focus-visible,
.ray-contact a:focus-visible {
    outline: 3px solid #181818;
    outline-offset: 3px;
}

body > .ray-contact .ray-contact__toggle,
body > .ray-contact .ray-contact__phone,
body > .ray-contact .ray-contact__messenger {
    font-weight: 400;
}

.body .mobileMenu .ray-mobile-contacts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
    font: inherit;
}

.body .mobileMenu .ray-mobile-contacts::before {
    display: none;
    content: none;
}

.body .mobileMenu .ray-mobile-contact {
    min-width: 0;
    margin: 0;
    padding: 16px;
    border-radius: 16px;
    background: #f6f6f6;
    color: #181818;
}

.body .mobileMenu .ray-mobile-contact__station {
    margin: 0 0 4px;
    color: #666;
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
}

.body .mobileMenu .ray-mobile-contact__phone {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    color: #181818;
    font-size: 18px;
    font-weight: 400;
    line-height: 26px;
    text-decoration: none;
}

.body .mobileMenu .ray-mobile-contact__address {
    margin: 0;
    color: #666;
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
}

.body .mobileMenu .ray-mobile-contact__messengers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.body .mobileMenu .ray-mobile-contact__messenger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    color: #181818;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.body .mobileMenu .ray-mobile-contact__messenger svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

.body .mobileMenu .ray-mobile-contact a:focus-visible {
    outline: 2px solid #181818;
    outline-offset: 3px;
}

@media (hover: hover) {
    .ray-contact__toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 28px rgb(0 0 0 / 24%);
    }

    .ray-contact__close:hover,
    .ray-contact__messenger:hover {
        border-color: #181818;
        background: #fff;
    }

    .ray-contact__phone:hover {
        text-decoration: underline;
        text-underline-offset: 3px;
    }
}

@media (max-width: 600px) {
    .ray-contact {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .ray-contact__panel {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ray-contact__toggle,
    .ray-contact__chevron {
        transition: none;
    }

    .ray-contact__toggle:hover {
        transform: none;
    }
}

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