.fp-header {
    width: var(--wide);
    min-height: 64px;
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin: 23px auto 0;
    padding: 4px;
    color: #fff;
    background: rgba(247, 247, 247, .04);
    border-radius: 16px;
}

.inner-page .fp-header {
    background: rgba(24, 9, 29, 0.48);
}

.fp-header__left,
.fp-header__right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fp-header__left {
    flex: 1 1 auto;
    min-width: 0;
}

.fp-header__right {
    flex: 0 0 auto;
}

.fp-logo {
    width: 208px;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 14px;
    font-size: 23px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.05em;
    white-space: nowrap;
}

.brand-mark {
    width: 100%;
    height: 56px;
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0px;
}

.brand-mark img {
    width: 68px;
    max-width: none;
    height: 54px;
    flex: 0 0 68px;
    display: block;
    object-fit: contain;
    object-position: center;
}

.fp-logo .brand-mark img {
    width: 72px;
    height: 56px;
    flex-basis: 72px;
}

.brand-mark h3 {
    min-width: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.04em;
    white-space: nowrap;
}

.header-control,
.header-icon,
.header-callback {
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 0;
    background: rgba(255, 255, 255, .1);
    border-radius: 14px;
    transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease, opacity .2s ease;
}

.header-control {
    width: 124px;
    gap: 3px;
    font-size: 22px;
    font-weight: 500;
}

.header-icon {
    width: 56px;
    position: relative;
    flex: 0 0 56px;
    overflow: hidden;
}

.header-control img,
.header-icon img,
.header-callback img {
    width: 33px;
    height: 33px;
    object-fit: contain;
}

.fp-header__right .header-icon[aria-label="Telegram"] img {
    width: 30px;
    height: 30px;
}

.fp-header__right .header-icon[aria-label="WhatsApp"] img {
    width: 30px;
    height: 30px;
    filter: brightness(0) invert(1);
}

.header-phones {
    width: 190px;
    height: 56px;
    flex: 0 0 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.header-phone {
    display: block;
    color: #fff;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.12;
    white-space: nowrap;
    transition: color .2s ease;
}

.header-callback {
    width: 210px;
    gap: 12px;
    background: var(--indigo);
    font-size: 18px;
    font-weight: 500;
}

.header-control:hover,
.header-icon:hover {
    background: rgba(255, 255, 255, .18);
    transform: translateY(-1px);
}

.header-phone:hover {
    color: rgba(255, 255, 255, .72);
}

.header-callback:hover {
    background: #4d0db8;
    box-shadow: 0 14px 30px rgba(57, 8, 148, .28);
    transform: translateY(-1px);
}

.cart span {
    position: absolute;
    top: 5px;
    right: 4px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    color: #18091d;
    background: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.site-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: scaleX(.98);
    transform-origin: left center;
    transition: max-width .28s ease, opacity .18s ease, transform .28s ease;
}

.site-search.is-open {
    max-width: min(760px, 100%);
    pointer-events: auto;
    opacity: 1;
    transform: scaleX(1);
}

.site-search__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 0 16px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 16px;
    box-shadow: none;
}

.site-search__panel img {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
}

.site-search__panel input {
    min-width: 0;
    flex: 1 1 auto;
    color: #fff;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 17px;
}

.site-search__panel input::placeholder {
    color: rgba(255, 255, 255, .46);
}

.site-search__panel input::-webkit-search-cancel-button,
.site-search__panel input::-webkit-search-decoration {
    display: none;
}

.site-search__panel button {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 0;
    border-radius: 9px;
    font-size: 20px;
    line-height: 1;
}

.fp-header__left > [data-search-open] {
    transition: width .24s ease, flex-basis .24s ease, opacity .18s ease, transform .24s ease, background .2s ease;
}

body.search-open .fp-header__left > [data-search-open] {
    width: 0;
    flex-basis: 0;
    opacity: 0;
    transform: scale(.92);
    pointer-events: none;
}

@media (max-width: 1200px) {
    .fp-header {
        width: var(--wide);
    }

    .fp-header__right {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .site-search.is-open {
        max-width: min(560px, 100%);
    }
}

@media (max-width: 900px) {
    .fp-header,
    .fp-header__left,
    .fp-header__right {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .fp-logo,
    .header-control,
    .header-callback {
        width: auto;
        padding-left: 16px;
        padding-right: 16px;
    }

    .fp-logo {
        width: 196px;
        padding-right: 8px;
        padding-left: 8px;
    }
}

@media (max-width: 640px) {
    body {
        padding-top: 72px;
    }

    .fp-header {
        width: calc(100vw - 24px);
        min-height: 0;
        position: fixed;
        top: 12px;
        left: 50%;
        z-index: 90;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 48px 48px 48px;
        grid-template-rows: 48px auto;
        column-gap: 4px;
        row-gap: 0;
        align-items: center;
        margin-top: 0;
        padding: 4px;
        border-radius: 14px;
        isolation: isolate;
        transform: translateX(-50%);
        transition:
            top .48s cubic-bezier(.22, 1, .36, 1),
            width .48s cubic-bezier(.22, 1, .36, 1),
            padding .48s cubic-bezier(.22, 1, .36, 1),
            border-radius .48s cubic-bezier(.22, 1, .36, 1),
            box-shadow .48s ease;
    }

    .fp-header::before {
        position: absolute;
        z-index: 0;
        inset: 0;
        content: "";
        background: #18091d;
        border-radius: inherit;
        opacity: 0;
        -webkit-clip-path: circle(0 at 50% 0);
        clip-path: circle(0 at 50% 0);
        transition:
            opacity .14s ease,
            -webkit-clip-path .56s cubic-bezier(.22, 1, .36, 1),
            clip-path .56s cubic-bezier(.22, 1, .36, 1);
        pointer-events: none;
    }

    .fp-logo,
    .header-control,
    .header-icon,
    .header-callback,
    .header-phones,
    .site-search {
        position: relative;
        z-index: 1;
    }

    .fp-header__left,
    .fp-header__right {
        display: contents;
    }

    .fp-logo {
        order: 1;
        grid-column: 1;
        grid-row: 1;
        width: auto;
        min-width: 0;
        max-width: 190px;
        height: 48px;
        padding: 0 4px;
        font-size: 19px;
        border-radius: 12px;
    }

    .fp-logo .brand-mark {
        width: 100%;
        height: 48px;
        flex-basis: auto;
        gap: 6px;
    }

    .fp-logo .brand-mark img {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .fp-logo .brand-mark h3 {
        font-size: 17px;
    }

    .header-control,
    .header-icon,
    .header-callback {
        height: 48px;
        border-radius: 12px;
        font-size: 14px;
    }

    .fp-header__left .header-icon {
        order: 2;
        grid-column: 2;
        grid-row: 1;
    }

    .cart {
        order: 3;
        grid-column: 3;
        grid-row: 1;
    }

    .header-control {
        order: 4;
        grid-column: 4;
        grid-row: 1;
        width: 48px;
        padding: 0;
        font-size: 0;
        gap: 0;
    }

.header-icon {
        width: 48px;
    }

    .header-phones,
    .fp-header__right .header-icon:not(.cart),
    .header-callback {
        display: none;
    }

    .header-control img,
    .header-icon img,
    .header-callback img {
        width: 24px;
        height: 24px;
    }

    .cart span {
        top: 2px;
        right: 2px;
    }

    body:not(.inner-page) .fp-header {
        width: var(--wide);
        top: 16px;
        column-gap: 4px;
        row-gap: 0;
        margin-top: 0;
        background: rgba(255, 255, 255, .08);
    }

    body:not(.inner-page) {
        padding-top: 76px;
    }

    .fp-header.is-mobile-scrolled,
    body:not(.inner-page) .fp-header.is-mobile-scrolled {
        width: 100vw;
        top: 0;
        padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 8px;
        border-radius: 0 0 22px 22px;
        box-shadow: 0 18px 42px rgba(24, 9, 29, .24);
    }

    .fp-header.is-mobile-scrolled::before {
        opacity: 1;
        -webkit-clip-path: circle(150% at 50% 0);
        clip-path: circle(150% at 50% 0);
    }

    body:not(.inner-page) .fp-logo {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
        padding-right: 4px;
        padding-left: 4px;
        margin-right: auto;
    }

    body:not(.inner-page) .header-icon,
    body:not(.inner-page) .header-control {
        flex: 0 0 48px;
    }

    .site-search {
        width: 100%;
        max-width: 100%;
        max-height: 0;
        grid-column: 1 / -1;
        grid-row: 2;
        order: 5;
        margin-top: 0;
        opacity: 0;
        transform: none;
        pointer-events: none;
        transition:
            max-height .32s cubic-bezier(.22, 1, .36, 1),
            margin-top .32s cubic-bezier(.22, 1, .36, 1),
            opacity .2s ease;
    }

    .site-search.is-open {
        max-width: 100%;
        max-height: 48px;
        margin-top: 4px;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    body.search-open .fp-header__left > [data-search-open] {
        width: 48px;
        flex-basis: 48px;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .site-search__panel {
        width: 100%;
        height: 48px;
        border-radius: 12px;
    }

    .site-search__panel img {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
    .fp-header,
    .fp-header::before {
        transition-duration: .01ms;
    }
}
