/* Shared social buttons: consistent monochrome state and blue hover. */
.header__socials ul.soc_seti>li>a,
.header__socials ul.soc_seti>li>button,
.box_contact_f ul.soc_seti>li>a,
.box_contact_f ul.soc_seti>li>button {
    transition: transform .2s ease, filter .2s ease, color .2s ease, border-color .2s ease;
}

/* Keep the passive artwork on hover. The whole icon is tinted below, so the
   incorrectly scaled active PNG is no longer displayed. */
.header__socials ul.soc_seti li a.vk,
.header__socials ul.soc_seti li a.vk:hover,
.header__socials ul.soc_seti li a.vk:focus-visible {
    background-image: url(/local/templates/.default/images/vk.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.header__socials ul.soc_seti li a.tg,
.header__socials ul.soc_seti li a.tg:hover,
.header__socials ul.soc_seti li a.tg:focus-visible {
    background-image: url(/local/templates/.default/images/tg-passive.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.box_contact_f ul.soc_seti li a.vk,
.box_contact_f ul.soc_seti li a.vk:hover,
.box_contact_f ul.soc_seti li a.vk:focus-visible {
    background-image: url(/local/templates/.default/images/vk_f.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.box_contact_f ul.soc_seti li a.tg,
.box_contact_f ul.soc_seti li a.tg:hover,
.box_contact_f ul.soc_seti li a.tg:focus-visible {
    background-image: url(/local/templates/.default/images/tg-footer-passive.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.header__socials ul.soc_seti>li>a:hover,
.header__socials ul.soc_seti>li>a:focus-visible,
.box_contact_f ul.soc_seti>li>a:hover,
.box_contact_f ul.soc_seti>li>a:focus-visible {
    transform: translateY(-2px);
    filter: brightness(0) saturate(100%) invert(43%) sepia(98%) saturate(1574%) hue-rotate(164deg) brightness(95%) contrast(98%);
}

/* MAX uses the original logo shape, but it is monochrome in the header/footer. */
.header__socials ul.soc_seti li button.max,
.box_contact_f ul.soc_seti li button.max {
    display: grid;
    place-items: center;
    background-image: none;
    color: #000;
}

.header__socials ul.soc_seti li button.max::before,
.box_contact_f ul.soc_seti li button.max::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background: url(/local/templates/.default/images/max-mono-dark.svg) no-repeat center / contain;
    filter: none;
    transition: filter .2s ease;
}

.box_contact_f ul.soc_seti li button.max {
    color: #fff;
    border-color: #fff;
}

.box_contact_f ul.soc_seti li button.max::before {
    background-image: url(/local/templates/.default/images/max-mono-white.svg);
    filter: none;
}

.header__socials ul.soc_seti li button.max:hover,
.header__socials ul.soc_seti li button.max:focus-visible,
.box_contact_f ul.soc_seti li button.max:hover,
.box_contact_f ul.soc_seti li button.max:focus-visible {
    color: #039be5;
    border-color: #039be5;
    transform: translateY(-2px);
}

.header__socials ul.soc_seti li button.max:hover::before,
.header__socials ul.soc_seti li button.max:focus-visible::before,
.box_contact_f ul.soc_seti li button.max:hover::before,
.box_contact_f ul.soc_seti li button.max:focus-visible::before {
    filter: brightness(0) saturate(100%) invert(43%) sepia(98%) saturate(1574%) hue-rotate(164deg) brightness(95%) contrast(98%);
}

.header__socials ul.soc_seti>li>a:focus-visible,
.header__socials ul.soc_seti>li>button:focus-visible,
.box_contact_f ul.soc_seti>li>a:focus-visible,
.box_contact_f ul.soc_seti>li>button:focus-visible,
.floating-messengers .fixed-button:focus-visible,
.floating-to-top:focus-visible {
    outline: 2px solid #039be5;
    outline-offset: 3px;
}

/* MAX branch panel. Social-menu styles must apply only to the round buttons,
   never to the links inside this panel. */
.header__socials .max-contacts__panel,
.box_contact_f .max-contacts__panel {
    box-sizing: border-box;
    width: 330px;
    max-width: calc(100vw - 30px);
    overflow: hidden;
    z-index: 1100;
}

.header__socials .max-contacts__panel {
    top: calc(100% + 10px);
    right: 0;
    bottom: auto;
}

/* In the footer the panel must overlay the page upwards. Opening it downwards
   adds its height to the document and creates the unwanted empty scroll area. */
.box_contact_f .max-contacts__panel {
    top: auto;
    right: 0;
    bottom: calc(100% + 10px);
}

.max-contacts__panel .max-contacts__title {
    position: relative;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 14px 50px 14px 18px;
    color: #111;
    background: #fff;
    line-height: 18px;
    white-space: nowrap;
}

.max-contacts__panel .max-contacts__title::after {
    content: none;
}

.max-contacts__title-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.max-contacts__title-arrow {
    display: inline-block;
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    margin-top: -3px;
    border-right: 1px solid #aaa;
    border-bottom: 1px solid #aaa;
    transform: rotate(45deg);
}

.max-contacts__close {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color .2s ease, transform .2s ease;
}

.max-contacts__close::before,
.max-contacts__close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 1.5px;
    background: #777;
}

.max-contacts__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.max-contacts__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.max-contacts__close:hover,
.max-contacts__close:focus-visible {
    background: #f2f2f2;
    outline: none;
}

.max-contacts__close:hover::before,
.max-contacts__close:hover::after,
.max-contacts__close:focus-visible::before,
.max-contacts__close:focus-visible::after {
    background: #039be5;
}

.max-contacts__panel .max-contacts__list {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-height: 350px;
    margin: 0;
    padding: 4px 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    text-align: left;
}

.max-contacts__panel .max-contacts__list>li {
    display: block;
    float: none !important;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 0;
}

.max-contacts__panel .max-contacts__list>li+li {
    border-top: 1px solid #f0f0f0;
}

.max-contacts__panel .max-contacts__list>li>a {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0 !important;
    padding: 10px 18px;
    color: #111;
    background: #fff !important;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    line-height: 18px;
    white-space: normal;
    overflow-wrap: break-word;
    text-align: left;
    text-decoration: none;
    filter: none !important;
    transform: none !important;
    transition: color .2s ease, background-color .2s ease;
}

.max-contacts__panel .max-contacts__list>li>a>span,
.max-contacts__panel .max-contacts__list>li>a>small {
    display: block;
    width: 100%;
}

.max-contacts__panel .max-contacts__list>li>a>span {
    font-weight: 600;
}

.max-contacts__panel .max-contacts__list>li>a>small {
    margin-top: 2px;
    color: #777;
    font-size: 12px;
    line-height: 16px;
}

.max-contacts__panel .max-contacts__list>li>a:hover,
.max-contacts__panel .max-contacts__list>li>a:focus-visible {
    color: #f41818;
    background: #f7f7f7 !important;
    outline: none;
}

.max-contacts__panel .max-contacts__list>li>a:hover>small,
.max-contacts__panel .max-contacts__list>li>a:focus-visible>small {
    color: #555;
}

/* Floating MAX and Telegram stay coloured and use the requested compact size. */
.floating-messengers {
    right: 25px;
    bottom: 25px;
    gap: 10px;
    transition: bottom .3s ease;
}

.floating-messengers.has-to-top {
    bottom: 89px;
}

.floating-messengers .fixed-button {
    width: 54px;
    height: 54px;
}

.floating-messengers .fixed-button--max img {
    width: 31px;
    height: 31px;
}

.floating-messengers .fixed-button--telegram svg {
    width: 23px;
    height: auto;
}

.max-contacts--floating .max-contacts__panel {
    right: calc(100% + 12px);
}

/* Shared red scroll-to-top button. */
.floating-to-top {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 199;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    outline: none;
    background: #f41818;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    cursor: pointer;
    transform: translateY(10px);
    transition: opacity .25s ease, visibility .25s ease, transform .25s ease, background-color .2s ease, box-shadow .2s ease;
}

.floating-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.floating-to-top:hover {
    background: #000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
    transform: translateY(-2px);
}

.calc-go-to.is-global-top-replaced {
    display: none !important;
}

@media (min-width: 577px) {
    .header__socials {
        flex: 0 0 172px;
        width: 172px;
        max-width: 172px;
    }

    .header__socials ul.soc_seti {
        justify-content: center;
    }
}

@media (max-width: 576px) {

    .mobile-header .max-contacts__panel,
    .box_contact_f .max-contacts__panel,
    .max-contacts--floating .max-contacts__panel {
        position: fixed;
        top: auto;
        right: 12px;
        bottom: auto;
        left: 12px;
        width: auto;
        max-width: none;
        z-index: 2500;
    }

    .floating-messengers {
        right: 25px;
        bottom: 25px;
        gap: 10px;
    }

    .floating-messengers .fixed-button,
    .floating-to-top {
        width: 52px;
        height: 52px;
    }

    .floating-messengers .fixed-button--max img {
        width: 30px;
        height: 30px;
    }

    .floating-messengers .fixed-button--telegram svg {
        width: 22px;
    }

    .floating-messengers.has-to-top {
        bottom: 87px;
    }

    .floating-to-top {
        right: 25px;
        bottom: 25px;
    }

    .max-contacts-panel-open .floating-messengers,
    .max-contacts-panel-open .floating-to-top {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .max-contacts__panel .max-contacts__list {
        max-height: var(--max-panel-list-height, 290px);
    }

    .footer {
        box-sizing: border-box;
        padding: 32px 15px 45px;
    }

    .footer>.container {
        padding-right: 0;
        padding-left: 0;
    }

    .footer>.container>.row {
        margin-right: 0;
        margin-left: 0;
    }

    .footer>.container>.row>[class*='col-'] {
        padding-right: 10px;
        padding-left: 10px;
    }

    .footer .box_bottom_menu {
        margin-top: 20px;
        padding: 0;
    }

    .footer .box_bottom_menu ul.bottom_menu,
    .footer .box_bottom_menu ul.dop_menu_f {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 240px;
        margin: 0 auto 12px;
    }

    .footer .tel_f,
    .footer .time_f,
    .footer .mail_f {
        display: block;
        width: fit-content;
        max-width: 100%;
        margin: 0 auto 12px;
    }

    .footer .box_contact_f ul.soc_seti {
        display: flex;
        justify-content: center;
        gap: 8px;
        width: fit-content;
        margin: 16px auto 0;
        padding: 0;
        overflow: visible;
    }
}

@media (prefers-reduced-motion: reduce) {

    .floating-messengers,
    .floating-to-top,
    .header__socials ul.soc_seti>li>a,
    .header__socials ul.soc_seti>li>button,
    .box_contact_f ul.soc_seti>li>a,
    .box_contact_f ul.soc_seti>li>button {
        transition: none;
    }
}