/*
 * Шапка, меню на телефоне, окно поиска и подвал сайта (реестр, AD-124).
 * Разметка — layout/_site_header.html.twig и _site_footer.html.twig,
 * поведение — site.js. Подключается на всех страницах, после стилей темы.
 *
 * Цвета прежние: шапка коралловая, подвал — коралловая половина и переход от
 * белого к розовому. Значки — общий набор (user/_icons.html.twig), контуром:
 * на шапке белые, в меню и шторке — коралловые на розовых плитках.
 *
 * Тема задаёт правила голым тегам: `* { margin: 0; padding: 0; border: none }`,
 * `a { color: #373E5B }`, на узком экране `header { min-height: 450px }`,
 * `footer nav { padding: 15px 0; justify-content: space-between }`, на
 * странице сбора — ещё и `button` (main.css). Поэтому у всего здесь свои
 * классы с явными значениями.
 *
 * Ширины: шире 960px — пункты меню пилюлями, «Создать событие», вход или
 * профиль с выпадающим меню; при прокрутке шапка ужимается со 96 до 68px,
 * но ничего не прячет. На 961–1300px строка плотнее, до 1140px «Создать
 * событие» — значком. Уже 960px — логотип, поиск, вход или аватар и кнопка
 * меню, которая открывает шторку снизу; шапка закреплена и там.
 */

:where(.sh, .sh-sheet, .sh-search, .sf) .pf-i {
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:where(.sh, .sh-sheet, .sh-search, .sf) *,
:where(.sh, .sh-sheet, .sh-search, .sf) *::before,
:where(.sh, .sh-sheet, .sh-search, .sf) *::after {
    box-sizing: border-box;
}

.sh-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.sh-ava {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: var(--sh-ava, 36px);
    height: var(--sh-ava, 36px);
    border-radius: 50%;
    background: #FDEFEC center / cover no-repeat;
    color: #B23A24;
    font-size: calc(var(--sh-ava, 36px) * .42);
    font-weight: 700;
    line-height: 1;
}

/* ── Шапка ───────────────────────────────────────────────────────────────── */

/* Шапка закреплена через `position: sticky`, а прилипает она в пределах
   родителя — `body`. Тема даёт ему `height: 100%` (general.css), то есть
   высоту одного экрана: дальше первого экрана шапка уезжала со страницей.
   Высота — по содержимому, но не меньше экрана, как и было задумано. */
html body {
    height: auto;
    min-height: 100%;
}

/* Наверху страницы шапка 96px, прилипшая — 68px. Ужимать её саму нельзя: она
   стоит в потоке, и вся страница прыгала бы на 28px вверх посреди прокрутки.
   Поэтому высота постоянная, а прилипает шапка с верхней полосой, убранной
   за край экрана (`top: -28px`). Строка внутри сдвигается вниз на половину
   прокрученного (`--sh-s`, ставит site.js) и к моменту прилипания стоит
   ровно посередине видимых 68px.

   На эти 68px рассчитаны закреплённые колонки профиля, страницы и формы сбора
   (`--pf-header`, `--cp-header`, `--cf-header`). */
.sh {
    position: sticky;
    top: -28px;
    z-index: 60;
    height: 96px;
    min-height: 0;
    background: #EB5940;
    color: #fff;
    font-family: Roboto, Arial, sans-serif;
    transition: box-shadow .25s;
}

.sh.is-compact {
    box-shadow: 0 8px 20px -10px rgba(31, 35, 56, .45);
}

/* Строка выше видимой части шапки на половину прокрученного (до 14px).
   Пустое место в ней не должно перехватывать щелчки по странице под шапкой —
   ловят только сами пункты. */
.sh__in {
    display: flex;
    align-items: center;
    gap: 28px;
    max-width: 1300px;
    height: 96px;
    margin: 0 auto;
    padding: 0 30px;
    transform: translateY(calc(var(--sh-s, 0px) / 2));
    pointer-events: none;
}

.sh__in > * {
    pointer-events: auto;
}

.sh__logo {
    display: block;
    flex: none;
}

/* Логотип ужимается масштабом, а не высотой: место под ним прежнее, и
   пункты меню не съезжают влево вслед за ним. Масштабируется сама ссылка —
   вместе с ней ужимаются и рамка фокуса, и место, куда можно нажать. */
.sh__logo {
    transform-origin: left center;
    transition: transform .25s;
}

.sh.is-compact .sh__logo {
    transform: scale(.78);
}

.sh__logo img {
    display: block;
    width: auto;
    height: 46px;
}

.sh :is(a, button):focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Пункты меню — пилюлями: при наведении под пунктом проявляется светлая
   подложка, текущий раздел — белый с коралловым текстом.

   Голому `nav` тема на странице сбора и в своём профиле (styles_live.css,
   styles_modal.css) даёт белую плашку с тенью и шириной 824px, а уже 960px
   прячет его вовсе: белые пункты пропадали на белом, а в шторке — разделы.
   Поэтому у обеих навигаций шапки все эти свойства заданы явно, как у
   `.sf__links` в подвале. */
.sh .sh__nav,
.sh-sheet .sh-sheet__nav {
    position: static;
    z-index: auto;
    width: auto;
    margin-top: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.sh .sh__nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.sh-sheet .sh-sheet__nav {
    display: block;
}

.sh .sh__link {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.sh__link::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: rgba(255, 255, 255, .2);
    opacity: 0;
    transform: scale(.7);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s;
}

.sh__link:hover::before {
    opacity: 1;
    transform: none;
}

.sh .sh__link.is-active {
    background: #fff;
    color: #B23A24;
}

.sh__link.is-active::before {
    display: none;
}

.sh__tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.sh .sh__icbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    transition: background-color .2s;
}

.sh .sh__icbtn:hover {
    background: rgba(255, 255, 255, .28);
}

.sh .sh__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    background: #fff;
    color: #B23A24;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .2s, box-shadow .2s;
}

.sh .sh__cta .pf-i {
    stroke-width: 2.4;
}

.sh .sh__cta:hover {
    box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .4);
    transform: translateY(-1px);
}

.sh .sh__login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 12px;
    border-radius: 999px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .2s;
}

.sh .sh__login:hover {
    background: rgba(255, 255, 255, .16);
}

.sh .sh__reg {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 18px;
    border: 1.5px solid rgba(255, 255, 255, .9);
    border-radius: 999px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s, color .2s;
}

.sh .sh__reg:hover {
    background: #fff;
    color: #B23A24;
}

/* Профиль: аватар, имя и стрелка; меню открывается щелчком или касанием, а
   не наведением — на планшете касание имени раньше сразу уводило в профиль. */
.sh__user {
    position: relative;
}

.sh .sh__chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 240px;
    height: 46px;
    margin: 0;
    padding: 0 10px 0 5px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: 500 15px/1 Roboto, Arial, sans-serif;
    cursor: pointer;
    transition: background-color .2s;
}

.sh .sh__chip:hover,
.sh .sh__chip[aria-expanded="true"] {
    background: rgba(255, 255, 255, .16);
}

/* Длинное имя — в одну строку с многоточием: раньше оно переносилось. */
.sh__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sh__chev {
    display: flex;
    transition: transform .25s;
}

.sh__chip[aria-expanded="true"] .sh__chev {
    transform: rotate(180deg);
}

.sh__drop {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 300px;
    padding: 10px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 60px -24px rgba(31, 35, 56, .45);
    color: #373E5B;
    transform-origin: top right;
    animation: sh-drop .22s cubic-bezier(.2, .8, .2, 1);
}

.sh__drop[hidden] {
    display: none;
}

.sh__drop::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 28px;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #fff;
    transform: rotate(45deg);
}

:is(.sh__drop, .sh-sheet, .sh-search, .sf__bottom) :is(a, button, input):focus-visible {
    outline: 3px solid rgba(55, 62, 91, .55);
    outline-offset: 2px;
}

.sh .sh__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 12px;
    color: #373E5B;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .15s;
}

.sh .sh__item:hover {
    background: #F6F6F9;
}

.sh .sh__item--me {
    min-height: 66px;
    margin-bottom: 4px;
}

.sh__item--me > .pf-i {
    margin-left: auto;
    color: #B9BCCB;
}

.sh__me {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sh__me-name {
    overflow: hidden;
    color: #373E5B;
    font-size: 16px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sh__me-sub {
    color: #6B7086;
    font-size: 13px;
    font-weight: 400;
}

.sh__tile {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #FDEFEC;
    color: #EB5940;
    transition: background-color .15s, color .15s;
}

.sh__item:hover .sh__tile {
    background: #EB5940;
    color: #fff;
}

.sh .sh__item--out {
    color: #B23A24;
}

.sh__item--out .sh__tile {
    background: #F6F6F9;
    color: #B23A24;
}

.sh__sep {
    display: block;
    height: 1px;
    margin: 6px 4px;
    background: #EEEFF4;
}

.sh__m-account,
.sh__burger {
    display: none;
}

@keyframes sh-drop {
    from { opacity: 0; transform: translateY(-6px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

/* ── Шапка на ноутбуке и планшете ────────────────────────────────────────── */

/* Полная строка гостя занимает 1245px, у вошедшего с длинным именем — 1254.
   Уже 1300px (с запасом на полосу прокрутки) строка плотнее; уже 1140px
   «Создать событие» — значок с подсказкой, а «Войти» — без значка. Иначе на
   961–1240px «Регистрация» или профиль уезжали за правый край и страница
   прокручивалась вбок. Поля по краям прежние, 30px, — вровень с подвалом. */
@media (min-width: 961px) and (max-width: 1300px) {
    .sh__in {
        gap: 12px;
    }

    .sh__logo img {
        height: 38px;
    }

    .sh .sh__nav {
        gap: 2px;
        margin-left: 0;
    }

    .sh .sh__link {
        padding: 0 12px;
    }

    .sh__tools {
        gap: 8px;
    }

    .sh .sh__cta,
    .sh .sh__reg {
        padding: 0 14px;
    }
}

@media (min-width: 961px) and (max-width: 1140px) {
    .sh .sh__cta {
        justify-content: center;
        width: 42px;
        padding: 0;
    }

    .sh__cta span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .sh .sh__login {
        padding: 0 10px;
    }

    .sh .sh__login .pf-i {
        display: none;
    }

    .sh .sh__chip {
        max-width: 200px;
    }
}

/* ── Шапка на телефоне ───────────────────────────────────────────────────── */

@media (max-width: 960px) {
    /* На телефоне шапка не ужимается: 64px и наверху, и прилипшая. */
    .sh {
        top: 0;
        height: 64px;
    }

    .sh__in {
        gap: 2px;
        height: 64px;
        padding: 0 8px 0 16px;
        transform: none;
    }

    .sh__logo,
    .sh.is-compact .sh__logo {
        margin-right: auto;
        transform: none;
    }

    .sh__logo img {
        height: 34px;
    }

    .sh .sh__nav,
    .sh .sh__cta,
    .sh .sh__login,
    .sh .sh__reg,
    .sh__user {
        display: none;
    }

    .sh__tools {
        gap: 2px;
    }

    .sh .sh__icbtn {
        width: 44px;
        height: 44px;
        background: transparent;
    }

    .sh .sh__m-account {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        color: #fff;
    }

    .sh__m-account .sh-ava {
        box-shadow: 0 0 0 2px #fff;
    }

    .sh .sh__burger {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        cursor: pointer;
    }

    .sh__burger span {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: #fff;
    }
}

/* На 320px логотип в 34px и три кнопки не помещались на 9px. */
@media (max-width: 359px) {
    .sh__in {
        padding-left: 12px;
    }

    .sh__logo img {
        height: 30px;
    }
}

/* Без поддержки `<dialog>` (Safari до 15.4) скрипт открывает шторку
   атрибутом; закрытые окна не должны стоять в странице. */
.sh-sheet:not([open]),
.sh-search:not([open]),
.sh .sh__burger[hidden] {
    display: none;
}

/* Пока открыто окно, страница под ним не прокручивается. Если у страницы
   была полоса прокрутки, её место сохраняется (`sh-gutter`, site.js), чтобы
   страница не дёргалась вбок; у короткой страницы без полосы его нет. */
html.sh-locked.sh-gutter {
    scrollbar-gutter: stable;
}

html.sh-locked body {
    overflow: hidden;
}

/* ── Шторка меню на телефоне ─────────────────────────────────────────────── */

.sh-sheet {
    box-sizing: border-box;
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    margin: 0;
    padding: 8px 16px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 0;
    border-radius: 24px 24px 0 0;
    background: #fff;
    color: #373E5B;
    font-family: Roboto, Arial, sans-serif;
    overscroll-behavior: contain;
    /* Только для запасного пути без `<dialog>`: верхнему слою он не нужен,
       а без него шторка уходила под закреплённые панели страницы сбора
       (.cp-dock, 990). */
    z-index: 1100;
}

.sh-sheet[open] {
    animation: sh-up .38s cubic-bezier(.2, .9, .25, 1);
}

/* Открытая касанием шторка получает фокус сама (site.js), без рамки: иначе
   Safari обводит крестик при каждом открытии. */
.sh-sheet:focus {
    outline: none;
}

.sh-sheet::backdrop {
    background: rgba(35, 38, 58, .5);
}

@media (min-width: 961px) {
    .sh-sheet {
        display: none;
    }
}

.sh-sheet__grab {
    width: 40px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: #E2E4EC;
}

.sh-sheet__close {
    position: absolute;
    top: 6px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6B7086;
    cursor: pointer;
}

.sh-sheet .sh-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    padding: 0 12px;
    border-radius: 14px;
    color: #373E5B;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
}

.sh-sheet .sh-row:active {
    background: #F6F6F9;
}

.sh-row > .pf-i:last-child {
    margin-left: auto;
    color: #B9BCCB;
}

.sh-row .sh__tile {
    width: 36px;
    height: 36px;
    border-radius: 11px;
}

.sh-sheet .sh-row.is-active {
    background: #FDEFEC;
    color: #B23A24;
}

.sh-row.is-active .sh__tile {
    background: #EB5940;
    color: #fff;
}

.sh-sheet .sh-row--me {
    min-height: 70px;
    margin: 0 44px 10px 0;
    background: #F6F6F9;
}

.sh-sheet .sh-row--out {
    color: #B23A24;
}

.sh-row--out .sh__tile {
    background: #F6F6F9;
    color: #B23A24;
}

.sh-sheet__auth {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 44px 10px 0;
}

.sh-sheet .sh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
}

.sh-sheet .sh-btn--cta {
    background: #EB5940;
    color: #fff;
}

.sh-sheet .sh-btn--ghost {
    border: 1.5px solid #E2E4EC;
    color: #373E5B;
}

.sh-sheet .sh-btn--soft {
    background: #FDEFEC;
    color: #B23A24;
}

.sh-sheet__create {
    margin-bottom: 12px;
}

.sh-sheet__create .pf-i {
    stroke-width: 2.3;
}

.sh-sheet__account {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #EEEFF4;
}

@keyframes sh-up {
    from { transform: translateY(100%); }
    to   { transform: none; }
}

/* ── Окно поиска ─────────────────────────────────────────────────────────── */

.sh-search {
    box-sizing: border-box;
    width: min(720px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100vh - 140px);
    margin: 72px auto auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55);
    color: #373E5B;
    font-family: Roboto, Arial, sans-serif;
}

.sh-search[open] {
    display: flex;
    flex-direction: column;
    animation: sh-pop .25s cubic-bezier(.2, .8, .2, 1);
}

.sh-search::backdrop {
    background: rgba(35, 38, 58, .5);
}

.sh-search__form {
    display: flex;
    flex: none;
    align-items: center;
    gap: 12px;
    height: 68px;
    margin: 0;
    padding: 0 18px 0 20px;
    border-bottom: 1px solid #EEEFF4;
}

.sh-search__field {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 12px;
    min-width: 0;
    height: 100%;
    margin: 0;
    color: #EB5940;
    font-weight: 400;
}

.sh-search .sh-search__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: #373E5B;
    font: 400 19px Roboto, Arial, sans-serif;
    -webkit-appearance: none;
    appearance: none;
}

.sh-search .sh-search__input:focus-visible {
    outline: 0;
}

/* Свой крестик браузера у поля поиска не нужен: окно закрывается Esc или
   «Отменой», а синий значок Chrome выбивался из шапки. */
.sh-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* Тема на странице сбора прячет подсказку в поле с фокусом
   (`input:focus::-webkit-input-placeholder`), а поле здесь в фокусе всегда. */
.sh-search .sh-search__input::placeholder,
.sh-search .sh-search__input:focus::placeholder {
    color: #6B7086;
    opacity: 1;
}

.sh-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid #E2E4EC;
    border-bottom-width: 2px;
    border-radius: 6px;
    background: #fff;
    color: #5A6078;
    font: 500 12px/1 Roboto, Arial, sans-serif;
}

.sh-search__cancel {
    display: none;
}

.sh-search__body {
    flex: 1 1 auto;
    min-height: 120px;
    padding: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sh-search__group {
    padding: 8px 12px 6px;
    color: #6B7086;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sh-search .sh-res {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    color: #373E5B;
    text-decoration: none;
    transition: background-color .15s;
}

.sh-search .sh-res:hover {
    background: #F6F6F9;
}

/* Выбранный стрелками — заметно, а не одним оттенком серого, как наведение.
   Серая строка суммы на розовом темнее, иначе ей не хватает контраста. */
.sh-search .sh-res:focus-visible {
    background: #FDEFEC;
    outline: 2px solid #B23A24;
    outline-offset: -2px;
}

.sh-search .sh-res:focus-visible .sh-res__meta:not(.sh-res__meta--done) {
    color: #5A6078;
}

.sh-res__thumb {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #F7A08F 0%, #EB5940 100%);
    color: #fff;
}

.sh-res__thumb--ev {
    background: #FDEFEC;
    color: #EB5940;
}

.sh-res__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sh-res__title {
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sh-res__meta {
    color: #6B7086;
    font-size: 13px;
}

.sh-res__meta--done {
    color: #17784B;
}

.sh-res__who {
    color: #373E5B;
    font-weight: 500;
}

/* Без внутренних полей: совпадение бывает серединой слова. */
.sh-search mark {
    padding: 0;
    border-radius: 3px;
    background: #FDEFEC;
    color: #B23A24;
}

.sh-search__empty {
    padding: 22px 12px;
    color: #6B7086;
    font-size: 15px;
}

.sh-search__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 12px 12px;
}

.sh-search .sh-chip {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 1px solid #E7E8EF;
    border-radius: 999px;
    background: #F6F6F9;
    color: #373E5B;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .15s, border-color .15s;
}

.sh-search .sh-chip:hover {
    border-color: #F3D9D2;
    background: #FDEFEC;
}

.sh-search__foot {
    display: flex;
    flex: none;
    align-items: center;
    gap: 16px;
    padding: 12px 22px;
    border-top: 1px solid #EEEFF4;
    background: #FBFBFD;
    color: #6B7086;
    font-size: 13px;
}

.sh-search__keys {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sh-search .sh-search__all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: #B23A24;
    font-weight: 500;
    text-decoration: none;
}

@keyframes sh-pop {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* На телефоне — на весь экран, с «Отменой» вместо подсказок клавиш. */
@media (max-width: 960px) {
    .sh-search {
        width: 100%;
        height: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .sh-search__form {
        height: 64px;
        padding: 0 12px 0 16px;
    }

    .sh-search__field {
        height: 46px;
        padding: 0 14px;
        border-radius: 14px;
        background: #F6F6F9;
        color: #6B7086;
    }

    .sh-search .sh-search__input {
        font-size: 16px;
    }

    .sh-search__esc,
    .sh-search__keys {
        display: none;
    }

    .sh-search .sh-search__cancel {
        display: block;
        flex: none;
        height: 44px;
        margin: 0;
        padding: 0 4px;
        border: 0;
        background: transparent;
        color: #B23A24;
        font: 500 15px Roboto, Arial, sans-serif;
        cursor: pointer;
    }

    .sh-search__foot {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    }
}

/* ── Подвал ──────────────────────────────────────────────────────────────── */

.sf {
    position: relative;
    min-height: 0;
    background: #fff;
    color: #373E5B;
    font-family: Roboto, Arial, sans-serif;
}

.sf a {
    text-decoration: none;
}

.sf__band {
    display: grid;
    grid-template-columns: 55% 45%;
    min-height: 128px;
}

/* Поля половин — вровень с содержимым страницы (1240px по центру). */
.sf__brand {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 24px 30px 24px max(30px, calc(50vw - 620px));
    background: #EB5941;
}

.sf__logo img {
    display: block;
    width: auto;
    height: 38px;
}

.sf__brand :is(a, button):focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.sf__soc {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.sf .sf__soc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), background-color .2s;
}

.sf .sf__soc-btn:hover {
    background: rgba(0, 0, 0, .14);
    transform: translateY(-3px);
}

.sf__soc-btn img {
    display: block;
    width: 20px;
    height: 20px;
}

.sf__contacts {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 24px max(30px, calc(50vw - 620px)) 24px 44px;
    background: linear-gradient(360deg, #F6B4B1 -20%, #fff 50%);
}

.sf__contacts :is(a):focus-visible {
    outline: 3px solid rgba(55, 62, 91, .55);
    outline-offset: 2px;
}

.sf__ct {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #373E5B;
}

.sf__ct-ic {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 8px 18px -12px rgba(235, 89, 64, .8);
    color: #EB5940;
}

.sf__ct-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
}

.sf__ct-label {
    color: #6B7086;
    font-size: 13px;
}

.sf .sf__ct-val {
    color: #373E5B;
    font-size: 16px;
    font-weight: 700;
    transition: color .15s;
}

.sf .sf__ct-sub {
    color: #5A6078;
    font-size: 14px;
}

.sf a.sf__ct:hover .sf__ct-val,
.sf .sf__ct-val:hover,
.sf .sf__ct-sub:hover {
    color: #B23A24;
}

/* 1240px содержимого плюс поля — вровень с половинами полосы и шапкой. */
.sf__bottom {
    display: flex;
    align-items: center;
    gap: 28px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 30px;
}

.sf .sf__copy {
    flex: 1;
    margin: 0;
    color: #6B7086;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
}

.sf__copy b {
    color: #EB5940;
    font-weight: 500;
}

.sf .sf__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    width: auto;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.sf__links a {
    color: #373E5B;
    font-size: 14px;
    font-weight: 500;
    transition: color .15s;
}

.sf__links a:hover {
    color: #B23A24;
}

.sf .sf__up {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #373E5B;
    font: 500 15px Roboto, Arial, sans-serif;
    cursor: pointer;
}

.sf__up-ic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1.5px solid #EB5940;
    border-radius: 50%;
    color: #EB5940;
    transition: background-color .2s, color .2s;
}

.sf__up:hover .sf__up-ic {
    background: #EB5940;
    color: #fff;
}

.sf__up:hover .pf-i {
    animation: sf-bob .6s ease-in-out infinite alternate;
}

@keyframes sf-bob {
    from { transform: translateY(1px); }
    to   { transform: translateY(-3px); }
}

/* Почта и телефон рядом помещаются только с 1150px: уже — друг под другом,
   а не с переносом посреди адреса или номера. */
@media (min-width: 961px) and (max-width: 1180px) {
    .sf__contacts {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 14px;
    }
}

@media (max-width: 960px) {
    .sf__band {
        grid-template-columns: minmax(0, 1fr);
    }

    .sf__brand {
        flex-direction: column;
        gap: 18px;
        padding: 28px 16px;
    }

    .sf__soc {
        margin-left: 0;
    }

    .sf__contacts {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 24px 20px;
        background: linear-gradient(360deg, #F6B4B1 -20%, #fff 60%);
    }

    .sf__bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 20px;
    }

    .sf .sf__up {
        align-self: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    :where(.sh, .sh-sheet, .sh-search, .sf) *,
    :where(.sh, .sh-sheet, .sh-search, .sf) *::before,
    :where(.sh, .sh-sheet, .sh-search, .sf) *::after,
    .sh,
    .sh-sheet[open],
    .sh-search[open],
    .sh__drop {
        animation: none !important;
        transition: none !important;
    }
}
