.vpechatay-support-trigger[hidden],
.vpechatay-support-panel[hidden],
.vpechatay-support-dialog:not([open]),
.b24-widget-button-wrapper.vpechatay-support-provider {
    display: none !important;
}

.vpechatay-support-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 7px;
    border: 1px solid #dcbba3;
    border-radius: 12px;
    background: #fff3e6;
    color: #78340b;
    font: 800 13px/1 var(--vp-body, sans-serif);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
}

.vpechatay-support-trigger svg {
    flex: none;
}

.vpechatay-support-trigger:active {
    background: #f9e3cb;
    border-color: #b47a51;
}

.vpechatay-support-trigger[data-support-placement][aria-expanded="true"] {
    border-color: var(--vp-accent-strong, #a84d0c);
    background: var(--vp-accent-strong, #a84d0c);
    color: #fff;
}

.vpechatay-support-trigger:not([aria-expanded="true"]) {
    box-shadow: inset 0 0 0 1px rgba(212, 147, 62, 0.12);
}

@supports (offset-path: border-box) {
    @media (prefers-reduced-motion: no-preference) {
        .vpechatay-support-trigger[data-support-placement]:not([hidden]):not(:disabled)::after {
            position: absolute;
            inset: 0 auto auto 0;
            width: 14px;
            height: 5px;
            border-radius: 999px;
            background:
                radial-gradient(circle at 74% 50%, #fff4bd 0 1px, #eda33b 1.4px 2px, transparent 2.8px),
                linear-gradient(90deg, transparent 5%, rgba(201, 111, 32, 0.68) 65%, transparent 90%);
            filter: drop-shadow(0 0 2px #e6a14e);
            pointer-events: none;
            content: "";
            offset-path: border-box;
            offset-anchor: center;
            offset-rotate: auto;
            animation: vp-support-perimeter 60s linear infinite;
        }

        html:has(
            dialog[open],
            .bx-livechat-show,
            .vp-constructor-page [role="dialog"][aria-modal="true"]:not([hidden])
        ) .vpechatay-support-trigger::after,
        .vpechatay-support-trigger:is([aria-expanded="true"], :focus-visible)::after {
            visibility: hidden;
            animation-play-state: paused;
        }
    }
}

@keyframes vp-support-perimeter {
    0% { opacity: 0; offset-distance: 0%; }
    0.45% { opacity: 1; }
    5.7% { opacity: 1; }
    6.33% { opacity: 0; offset-distance: 100%; }
    100% { opacity: 0; offset-distance: 100%; }
}

.vpechatay-support-trigger[data-support-placement="bar"] {
    grid-column: 6;
}

.vpechatay-support-trigger[data-support-placement="menu"] {
    width: 100%;
    justify-content: start;
    padding-inline: 16px;
}

@media (min-width: 761px) and (max-width: 1360px) {
    .vpechatay-support-in-header .vpechatay-shell__header .vpechatay-shell__bar {
        grid-template-columns: max-content max-content minmax(max-content, 1fr) repeat(3, max-content);
        grid-template-areas: "brand menu contacts cart account support";
        gap: clamp(8px, 1.05vw, 14px);
    }

    .vpechatay-support-in-header .vpechatay-shell__brand {
        grid-area: brand;
    }

    .vpechatay-support-in-header .vpechatay-shell__menu-button {
        grid-area: menu;
        justify-self: start;
    }

    .vpechatay-support-in-header .vpechatay-shell__bar .vpechatay-shell__contacts {
        grid-area: contacts;
        justify-self: center;
    }

    .vpechatay-support-in-header .vpechatay-shell__cart-link {
        grid-area: cart;
    }

    .vpechatay-support-in-header .vpechatay-shell__bar > :is(.vpechatay-shell__account, .vpechatay-shell__account-link) {
        grid-area: account;
    }

    .vpechatay-support-in-header .vpechatay-support-trigger[data-support-placement="bar"] {
        grid-area: support;
    }

    .vpechatay-support-in-header .vpechatay-shell__account-text {
        display: block;
        max-width: 9ch;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (min-width: 761px) and (max-width: 1100px) {
    .vpechatay-support-in-header .vpechatay-shell__header .vpechatay-shell__brand img {
        width: clamp(158px, 17.5vw, 194px);
    }

    .vpechatay-support-in-header .vpechatay-shell__menu-button,
    .vpechatay-support-in-header .vpechatay-shell__account-link {
        padding-inline: 10px;
    }
}

@media (min-width: 761px) and (max-width: 940px) {
    .vpechatay-support-in-header .vpechatay-shell__header .vpechatay-shell__bar {
        grid-template-columns: max-content minmax(0, 1fr) repeat(3, max-content);
        grid-template-areas:
            "brand menu cart account support"
            "contacts contacts contacts contacts contacts";
        row-gap: 4px;
        padding-block: 6px;
    }

    .vpechatay-support-in-header .vpechatay-shell__bar .vpechatay-shell__contacts {
        width: 100%;
        justify-content: center;
        gap: 12px;
        padding-top: 3px;
        border-top: 1px solid var(--vp-line);
    }
}

@media (min-width: 1361px) {
    .vpechatay-support-in-header .vpechatay-shell__header .vpechatay-shell__bar {
        grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
        gap: clamp(11px, 1vw, 16px);
    }

    .vpechatay-support-in-header .vpechatay-shell__header .vpechatay-shell__brand img {
        width: clamp(178px, 13.2vw, 260px);
    }

    .vpechatay-support-in-header .vpechatay-shell__nav > a,
    .vpechatay-support-in-header .vpechatay-shell__nav-group > summary {
        padding-inline: 6px;
    }
}

@media (max-width: 800px) {
    [data-support-placement="editor"] > span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

.vpechatay-support-rail {
    position: fixed;
    z-index: 51;
    right: 12px;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    display: grid;
    justify-items: end;
    gap: 8px;
}

.vpechatay-support-rail:empty {
    display: none;
}

.vpechatay-support-panel {
    border: 1px solid #e6d3bf;
    border-radius: 18px;
    background: #fffaf3;
    padding: 8px;
}

.vpechatay-support-panel[data-support-placement="strip"] {
    width: min(666px, calc(100% - 64px));
    margin: 0 max(32px, calc((100% - var(--vp-shell-width, 1680px)) / 2)) 10px auto;
    box-shadow: 0 8px 26px rgba(66, 38, 18, 0.09);
}

.vpechatay-support-panel[data-support-placement="rail"] {
    width: 204px;
    max-height: calc(100dvh - 100px);
    overflow: auto;
    grid-row: 1;
    box-shadow: 0 8px 25px rgba(45, 28, 17, 0.12);
}

.vpechatay-support-panel__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-inline: 6px 0;
}

.vpechatay-support-panel__heading h2 {
    margin: 0;
    color: var(--vp-ink, #221b16);
    font: 750 20px/1.18 var(--vp-display, Georgia, serif);
}

.vpechatay-support-panel__heading button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #e6d3bf;
    border-radius: 12px;
    background: #fffaf3;
    color: var(--vp-ink, #221b16);
    cursor: pointer;
}

.vpechatay-support-dialog {
    position: fixed;
    width: min(460px, calc(100vw - 24px));
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #e6d3bf;
    border-radius: 18px;
    background: #fffaf3;
    box-shadow: 0 20px 60px rgba(45, 28, 17, 0.3);
}

.vpechatay-support-dialog::backdrop {
    background: rgba(37, 29, 22, 0.55);
}

html:has(.vpechatay-support-dialog[open]),
html:has(.vpechatay-support-dialog[open]) .vpechatay-shell__viewport {
    overflow: hidden;
}

.vpechatay-support-dialog .vpechatay-support-panel {
    border: 0;
    padding: 10px;
}

.vpechatay-support-panel [data-b24-crm-button-block] {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: minmax(44px, auto);
    gap: 6px 8px;
    margin: 4px 0 0;
    padding: 0;
    animation: none !important;
    opacity: 1;
    visibility: visible;
}

.vpechatay-support-panel a.vpechatay-support-channel {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: 5px 9px;
    border: 1px solid #e8d8c8;
    border-radius: 10px;
    background: #fffaf3 !important;
    color: var(--vp-ink, #221b16);
    font: 750 13px/1.2 var(--vp-body, sans-serif);
    text-decoration: none;
    box-shadow: none;
    transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
}

.vpechatay-support-panel a.vpechatay-support-channel[data-support-kind="action"] {
    border-color: #e3c9b0;
    background: #fff3e6 !important;
    color: #78340b;
    font-weight: 800;
}

.vpechatay-support-panel a.vpechatay-support-channel[data-support-kind="social"] {
    border-color: transparent;
}

.vpechatay-support-panel a.vpechatay-support-channel[data-support-kind]:active {
    border-color: #cfaa8a;
    background: #f8e4d0 !important;
    color: #78340b;
}

.vpechatay-support-trigger[data-support-placement]:focus-visible,
.vpechatay-support-panel a.vpechatay-support-channel:focus-visible,
.vpechatay-support-panel__heading button:focus-visible {
    outline: 2px solid #87471f;
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .vpechatay-support-trigger:not([aria-expanded="true"]):hover,
    .vpechatay-support-panel__heading button:hover {
        border-color: #b47a51;
        background: #fff3e6;
    }

    .vpechatay-support-panel a.vpechatay-support-channel[data-support-kind]:hover {
        border-color: #cfaa8a;
        background: #f9eadb !important;
        color: #78340b;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vpechatay-support-trigger,
    .vpechatay-support-panel a.vpechatay-support-channel {
        transition: none;
    }
}

.vpechatay-support-panel a.vpechatay-support-channel > i,
.vpechatay-support-panel a.vpechatay-support-channel::before,
.vpechatay-support-panel a.vpechatay-support-channel::after {
    display: none !important;
    content: none !important;
}

.vpechatay-support-channel[data-support-kind="action"] {
    grid-column: span 4;
}

.vpechatay-support-channel[data-support-kind="social"] {
    grid-column: span 3;
    order: 1;
}

.vpechatay-support-channel__label {
    white-space: nowrap;
}

.vpechatay-support-channel__glyph,
.vpechatay-support-channel__logo {
    display: block;
    flex: none;
}

.vpechatay-support-channel__glyph {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #8b3c09;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vpechatay-support-channel__logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    transform: scale(0.86);
}

.vpechatay-support-panel[data-support-placement="rail"] .vpechatay-support-channel {
    grid-column: 1 / -1;
}

.vpechatay-support-dialog .vpechatay-support-channel[data-support-kind="action"] {
    grid-column: 1 / -1;
}

.vpechatay-support-dialog .vpechatay-support-channel[data-support-kind="social"] {
    grid-column: span 6;
}

@media (max-width: 360px) {
    .vpechatay-support-dialog a.vpechatay-support-channel[data-support-kind="social"] {
        gap: 5px;
        padding-inline: 5px;
        font-size: 12px;
    }

    .vpechatay-support-dialog .vpechatay-support-channel__logo {
        width: 26px;
        height: 26px;
    }
}
