/* Поиск раскрывается в пределах шапки и сохраняет доступ к логотипу. */
.header-tools { position: relative; flex: 1; min-width: 0; height: 44px; }
.header-tools .header-nav { height: 100%; align-items: center; justify-content: flex-end; margin: 0 178px 0 0; white-space: nowrap; transition: opacity .15s ease; }
.header-search { position: absolute; inset: 0 0 auto auto; z-index: 4; width: 146px; height: 44px; min-height: 44px; margin: 0; padding: 0 12px; gap: 8px; background: var(--bg); color: var(--text); transition: width .28s cubic-bezier(.16, 1, .3, 1), border-color .2s; }
.header-search:hover { border-color: var(--muted); }
.header-search input[type="search"] { flex: 1; width: 0; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; outline: none; background: transparent; color: var(--text); font-size: 16px; }
.header-search input::placeholder { color: var(--text); opacity: 1; font-size: 13px; }
.header-search input::-webkit-search-cancel-button { display: none; }
.header-search-icon { flex-shrink: 0; color: var(--muted); pointer-events: none; }
.header-search kbd { margin: 0; pointer-events: none; }
.header-search-submit, .header-search-close { display: none; flex-shrink: 0; border: 0; cursor: pointer; }
.header-search:focus-within { top: -4px; width: 100%; height: 52px; padding: 0 4px; border-color: var(--hover); }
.header-search:focus-within input[type="search"] { padding: 0 8px; }
.header-search:focus-within input::placeholder { color: var(--muted); font-size: 16px; }
.header-search:focus-within input:focus-visible { outline: none; }
.header-search:focus-within .header-search-icon, .header-search:focus-within kbd { display: none; }
.header-search:focus-within .header-search-submit { display: block; align-self: stretch; margin: 3px 0; padding: 0 16px; border-radius: 5px; background: var(--accent); color: var(--bg); font-size: 14px; font-weight: 600; }
.header-search-submit:hover { background: var(--hover); }
.header-search:focus-within .header-search-close:not([hidden]) { display: grid; place-items: center; width: 44px; align-self: stretch; padding: 0; border-radius: 5px; background: transparent; color: var(--muted); }
.header-search-close:hover { color: var(--text); background: var(--panel-active); }
.header-tools:has(.header-search:focus-within) .header-nav { visibility: hidden; opacity: 0; }

@media (max-width: 1100px) {
    .header-tools .header-nav { margin-right: 156px; }
}
@media (max-width: 850px) {
    .header-search { width: 110px; padding: 0 10px; }
    .header-tools .header-nav { margin-right: 126px; }
}
@media (max-width: 740px) {
    .header-tools .header-nav { display: none; }
}
@media (max-width: 580px) {
    .header { position: relative; }
    .header-tools { position: static; height: 44px; }
    .header-search { top: 16px; right: 20px; width: 96px; padding: 0 8px; }
    .header:has(.header-search:focus-within) { height: 136px; align-items: flex-start; padding-top: 16px; }
    .header-search:focus-within { top: 76px; left: 20px; right: 20px; width: auto; }
}
