.search {
    position: absolute;
    z-index: 3;
    top: -100px;
    width: 100%;
    max-width: 600px;
    padding: 16px 18px;
    background: var(--avt-surface);
    transition: 300ms linear all, visibility 0s;
    right: 330px;
    box-shadow: var(--avt-shadow);
}

/* Спрятанная панель не выглядывает из-под шапки (на 1440 была видна белая полоса).
   Видимость включается сразу (иначе focus() из search.js попадает в ещё скрытое поле),
   а выключается после того, как панель уехала вверх. */
.search:not(.search--visible):not(.search--static) {
    visibility: hidden;
    transition: 300ms linear all, visibility 0s linear 300ms;
}

.search--visible {
    top: 70px;
}

/* В шапке панель — сразу под ней. На странице заказов менеджера поиск лежит вне шапки
   и считает top от страницы: там — прежние 70px. */
.header__search.search--visible {
    top: calc(100% + 10px);
}

/* При «уменьшить движение» общее правило темы (transition-duration: 0.01ms !important) растягивает и
   «visibility 0s»: поле в момент focus() ещё скрыто, фокус остаётся на кнопке, клавиатура не открывается.
   Панели поиска переходы тут не нужны вовсе. */
@media (prefers-reduced-motion: reduce) {
    .search,
    .search * {
        transition: none !important;
    }
}

/* Класс search__form-input стоит на самом поле (custom-input.php), а не на обёртке: прежнее
   «.search__form-input input» ничего не находило, и текст запроса уходил под кнопки справа.
   У поля своя transition: all — без visibility 0s оно ещё кадр «скрыто» после показа панели, и focus() не срабатывает. */
.search .search__form-input {
    transition: 200ms ease all, visibility 0s;
    padding-right: 84px;
}

.search__form {
    position: relative;
}

.search__form-controls {
    position: absolute;
    z-index: 3;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.search__form-submit,
.search__form-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--avt-radius);
}

.search__form-icon {
    color: var(--avt-muted);
    transition: 200ms ease all;
    font-size: 16px;
}

.search__form-submit {
    background-color: transparent;
}

.search__form-submit:hover .search__form-icon {
    color: var(--avt-orange);
}

.search__form-close:hover .search__form-icon {
    color: var(--avt-orange);
}

.search .custom-input {
    margin-bottom: 0;
}

.search--static {
    position: static;
    max-width: 100%;
}

@media screen and (max-width: 1144px) {
    .search {
        right: 145px;
    }
}

@media screen and (max-width: 767px) {
    .search {
        right: 0;
        max-width: none;
        padding: 12px var(--avt-gutter);
    }
}
