/*! AVE Design Studio — поиск по сайту (js/search.js) */

/* ---------- Header button ---------- */

.ave-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8a8d96;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.ave-search-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ave-search-btn:hover { color: var(--ave-red, #c80000); background: rgba(200, 0, 0, .07); }
.ave-search-btn:focus { outline: none; }
.ave-search-btn:focus-visible { color: var(--ave-red, #c80000); box-shadow: 0 0 0 2px rgba(200, 0, 0, .55); }
.ave-search-btn[aria-expanded="true"] { color: var(--ave-red, #c80000); }

.mh---transparent.mh--dark .site-header:not(.sticked) .ave-search-btn { color: rgba(255, 255, 255, .8); }
.mh---transparent.mh--dark .site-header:not(.sticked) .ave-search-btn:hover,
.mh---transparent.mh--dark .site-header:not(.sticked) .ave-search-btn:focus-visible { color: #fff; background: rgba(255, 255, 255, .12); }

/* ---------- Overlay ---------- */

html.ave-search-lock { overflow: hidden; }
html.ave-search-lock body { padding-right: var(--ave-search-sb, 0); }

.ave-search {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 9vh 20px 20px;
    font-family: 'Open Sans', Arial, sans-serif;
    color: var(--ave-text, #3b3e47);
    -webkit-font-smoothing: antialiased;
}
.ave-search[hidden],
.ave-search [hidden] { display: none !important; }
.ave-search *, .ave-search *::before, .ave-search *::after { box-sizing: border-box; }

.ave-search__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 13, 17, .55);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    backdrop-filter: blur(8px) saturate(120%);
    opacity: 0;
    transition: opacity .2s ease;
}

.ave-search__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 680px;
    max-height: min(640px, 82vh);
    background: var(--ave-surface, #fff);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .32), 0 0 0 1px rgba(0, 0, 0, .04);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-12px) scale(.98);
    transition: opacity .2s ease, transform .24s var(--ave-ease, cubic-bezier(.2, .8, .2, 1));
}
.ave-search.is-open .ave-search__backdrop { opacity: 1; }
.ave-search.is-open .ave-search__panel { opacity: 1; transform: none; }

/* ---------- Input bar ---------- */

.ave-search__bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px 0 20px;
    border-bottom: 1px solid var(--ave-line, #dcdfe5);
}
.ave-search__bar::after {
    content: "";
    position: absolute;
    left: 20px;
    bottom: -1px;
    width: 48px;
    height: 2px;
    background: var(--ave-red, #c80000);
}
.ave-search__bar-icon {
    flex: none;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--ave-red, #c80000);
    stroke-width: 2;
    stroke-linecap: round;
}
.ave-search .ave-search__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 64px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font: 400 19px/1.2 'Open Sans', Arial, sans-serif;
    color: var(--ave-ink, #17181d);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.ave-search .ave-search__input::placeholder { color: #a3a7b1; opacity: 1; }
.ave-search .ave-search__input::-webkit-search-cancel-button,
.ave-search .ave-search__input::-webkit-search-decoration { -webkit-appearance: none; display: none; }

.ave-search__clear,
.ave-search__close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    margin: 0;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ave-muted, #7a7e8a);
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.ave-search__clear { width: 32px; padding: 0; }
.ave-search__close { border-color: var(--ave-line, #dcdfe5); font: 600 11px/1 'Open Sans', Arial, sans-serif; letter-spacing: .04em; }
.ave-search__clear:hover,
.ave-search__close:hover { color: var(--ave-ink, #17181d); background: var(--ave-soft, #f5f6f8); }
.ave-search__clear:focus-visible,
.ave-search__close:focus-visible { outline: 2px solid var(--ave-red, #c80000); outline-offset: 1px; }
.ave-search__icon,
.ave-search__close-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ave-search__close-icon { display: none; }

/* ---------- Body ---------- */

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

.ave-search__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 2px 10px 12px;
}
.ave-search__chips-label { margin-right: 2px; font-size: 13px; color: var(--ave-muted, #7a7e8a); }
.ave-search__chip {
    margin: 0;
    padding: 6px 12px;
    border: 1px solid var(--ave-line, #dcdfe5);
    border-radius: 999px;
    background: #fff;
    font: 600 13px/1.2 'Open Sans', Arial, sans-serif;
    color: var(--ave-ink, #17181d);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.ave-search__chip:hover { border-color: var(--ave-red, #c80000); color: var(--ave-red, #c80000); }
.ave-search__chip:focus-visible { outline: 2px solid var(--ave-red, #c80000); outline-offset: 1px; }

.ave-search__status {
    margin: 0;
    padding: 4px 10px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ave-muted, #7a7e8a);
}
.ave-search__status:empty { display: none; }

.ave-search__empty { padding: 6px 10px 12px; }
.ave-search__empty-title { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--ave-ink, #17181d); }
.ave-search__empty-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ave-muted, #7a7e8a); }

/* ---------- Results ---------- */

.ave-search__list { margin: 0; padding: 0; list-style: none; }
.ave-search__item { margin: 0; padding: 0; }
.ave-search__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    transition: background-color .12s ease;
}
.ave-search__link:hover,
.ave-search__link:focus { color: inherit; text-decoration: none; outline: none; }
.ave-search__item.is-active .ave-search__link { background: var(--ave-soft, #f5f6f8); box-shadow: inset 3px 0 0 var(--ave-red, #c80000); }

.ave-search__badge,
.ave-search__thumb {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--ave-soft, #f5f6f8);
    color: #8a8d96;
    overflow: hidden;
}
.ave-search__badge--accent { background: rgba(200, 0, 0, .08); color: var(--ave-red, #c80000); }
.ave-search__thumb { width: 64px; background: #e9ebef; }
.ave-search__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ave-search__item.is-active .ave-search__badge { background: #fff; color: var(--ave-red, #c80000); }

.ave-search__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ave-search__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ave-ink, #17181d);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.ave-search__snippet {
    font-size: 13px;
    line-height: 1.45;
    color: var(--ave-muted, #7a7e8a);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.ave-search mark {
    padding: 0 1px;
    border-radius: 3px;
    background: rgba(200, 0, 0, .1);
    color: var(--ave-red, #c80000);
}
.ave-search__meta {
    flex: none;
    max-width: 110px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--ave-soft, #f5f6f8);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ave-muted, #7a7e8a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ave-search__meta:empty { display: none; }
.ave-search__item.is-active .ave-search__meta { background: #fff; }
.ave-search__go {
    flex: none;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--ave-red, #c80000);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .12s ease, transform .12s ease;
}
.ave-search__item.is-active .ave-search__go { opacity: 1; transform: none; }

/* ---------- Footer ---------- */

.ave-search__foot {
    display: flex;
    gap: 18px;
    padding: 10px 20px;
    border-top: 1px solid var(--ave-line, #dcdfe5);
    background: #fafbfc;
    font-size: 12px;
    color: var(--ave-muted, #7a7e8a);
}
.ave-search__foot span { display: inline-flex; align-items: center; gap: 4px; }
.ave-search kbd {
    display: inline-block;
    min-width: 20px;
    padding: 2px 5px;
    border: 1px solid var(--ave-line, #dcdfe5);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #fff;
    box-shadow: none;
    font: 600 11px/1.2 'Open Sans', Arial, sans-serif;
    color: var(--ave-text, #3b3e47);
    text-align: center;
}

/* Highlight of a heading reached from the search */
.ave-search-flash { animation: ave-search-flash 2.2s ease; border-radius: 4px; }
@keyframes ave-search-flash {
    0%, 30% { background-color: rgba(200, 0, 0, .14); box-shadow: 0 0 0 6px rgba(200, 0, 0, .14); }
    100% { background-color: transparent; box-shadow: 0 0 0 6px transparent; }
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
    .ave-search { padding: 0; }
    .ave-search__panel {
        max-width: none;
        height: 100%;
        max-height: none;
        border-radius: 0;
        transform: translateY(16px);
    }
    .ave-search__bar { padding: 0 8px 0 16px; }
    .ave-search__bar::after { left: 16px; }
    .ave-search .ave-search__input { height: 58px; font-size: 17px; }
    .ave-search__close { width: 40px; height: 40px; padding: 0; border-color: transparent; }
    .ave-search__close-key { display: none; }
    .ave-search__close-icon { display: block; width: 22px; height: 22px; }
    .ave-search__body { padding: 12px 6px; }
    .ave-search__link { gap: 12px; padding: 10px; }
    .ave-search__meta { display: none; }
    .ave-search__foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ave-search__backdrop,
    .ave-search__panel,
    .ave-search__go,
    .ave-search-btn { transition: none; }
    .ave-search__panel { transform: none; }
    .ave-search-flash { animation: none; background-color: rgba(200, 0, 0, .1); }
}
