/* Окно поиска в стиле ЦУМа. Цвета и типографика — из шаблона fashion:
   текст #222, акцент #e74c3c (как OUTLET в меню), подложка полей #f5f5f5. */

.fs-search-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fs-search-trigger .icon-item {
    display: block;
    line-height: 0;
}

/* Подложка окна */
/* z-index с запасом над шапкой (.header — 910) и её выпадающими меню.
   Ниже 1996, который занят опенером компонентов Битрикса. */
.fs-search {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1900;
    background: #fff;
    display: none;
    overflow-y: auto;
}

.fs-search.is-open {
    display: block;
}

/* Пока окно открыто, фон не скроллим */
body.fs-search-lock {
    overflow: hidden;
}

.fs-search__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 40px 60px;
}

.fs-search__head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

/* Логотип приходит из include/logo-inner.php: там <img> без размеров, а общие
   стили шаблона его режут. Задаём высоту явно и запрещаем обрезку. */
.fs-search__logo {
    line-height: 0;
}

.fs-search__logo img {
    display: block;
    height: auto;
    max-height: 72px;
    max-width: 220px;
    width: auto;
    object-fit: contain;
}

.fs-search__cancel {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: 0;
    font-size: 14px;
    color: #222;
    text-decoration: underline;
    cursor: pointer;
}

.fs-search__cancel:hover {
    color: #e74c3c;
}

/* Строка поиска */
.fs-search__form {
    border-bottom: 1px solid #222;
    padding-bottom: 10px;
}

.fs-search__field {
    display: flex;
    align-items: center;
}

.fs-search__icon {
    line-height: 0;
    flex: 0 0 auto;
    margin-right: 12px;
}

.fs-search__field input {
    flex: 1 1 auto;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 20px;
    line-height: 1.4;
    color: #222;
    padding: 6px 0;
}

.fs-search__field input::placeholder {
    color: #9b9b9b;
}

.fs-search__voice,
.fs-search__clear {
    flex: 0 0 auto;
    background: none;
    border: 0;
    padding: 4px;
    margin-left: 8px;
    line-height: 0;
    color: #222;
    cursor: pointer;
}

/* Микрофон показываем только там, где браузер умеет распознавание речи */
.fs-search__voice {
    display: none;
}

.fs-search__voice.is-supported {
    display: block;
}

.fs-search__voice.is-active {
    color: #e74c3c;
    animation: fs-search-pulse 1.2s ease-in-out infinite;
}

@keyframes fs-search-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

/* Вкладки по полу */
.fs-search__tabs {
    display: flex;
    margin: 22px 0 8px;
    border-bottom: 1px solid #e6e6e6;
}

.fs-search__tab {
    position: relative;
    padding: 0 0 12px;
    margin-right: 28px;
    font-size: 15px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #222;
    text-decoration: none;
}

.fs-search__tab:hover {
    color: #e74c3c;
}

.fs-search__tab.is-active:after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: #222;
}

/* Выдача: узел переносится сюда скриптом, поэтому сбрасываем позиционирование,
   которое ему проставляет JCTitleSearchFashion. */
.fs-search__results .title-search-result {
    position: static !important;
    width: auto !important;
    max-width: none;
    border: 0;
    box-shadow: none;
    margin-top: 16px;
}

/* Поисковые подсказки — списком строк, как в поисковых системах */
.bx_searche_hints {
    margin: 0 0 18px;
}

.bx_searche_hints__item {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    color: #222;
    text-decoration: none;
}

.bx_searche_hints__item:hover {
    color: #e74c3c;
}

/* совпавшая часть запроса приходит в <b> из поискового индекса */
.bx_searche_hints__item b {
    font-weight: 600;
}

/* Разделы каталога в выдаче — чипами, как популярные бренды */
.bx_searche_sections {
    margin: 0 0 20px;
}

.bx_searche_sections__title {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #e74c3c;
    margin-bottom: 12px;
}

.bx_searche_sections__item {
    display: inline-block;
    padding: 9px 16px;
    margin: 0 10px 10px 0;
    background: #f5f5f5;
    border-radius: 2px;
    font-size: 14px;
    color: #222;
    text-decoration: none;
    transition: background .15s ease;
}

.bx_searche_sections__item:hover {
    background: #ececec;
    color: #222;
}

/* Путь до раздела: «Кроссовки» есть и в женской обуви, и в мужской */
.bx_searche_sections__path {
    margin-left: 8px;
    font-size: 12px;
    color: #8c8c8c;
}

.fs-search__panels {
    margin-top: 28px;
}

.fs-search__block + .fs-search__block {
    margin-top: 28px;
}

.fs-search__block-title {
    display: flex;
    align-items: center;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #e74c3c;
    margin-bottom: 14px;
}

.fs-search__history-clear {
    background: none;
    border: 0;
    padding: 0;
    margin-left: 16px;
    font-size: 12px;
    color: #9b9b9b;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.fs-search__history-clear:hover {
    color: #222;
}

.fs-search__chips {
    display: flex;
    flex-wrap: wrap;
}

.fs-search__chip {
    display: inline-block;
    padding: 9px 16px;
    margin: 0 10px 10px 0;
    background: #f5f5f5;
    border-radius: 2px;
    font-size: 14px;
    color: #222;
    text-decoration: none;
    transition: background .15s ease;
}

.fs-search__chip:hover {
    background: #ececec;
    color: #222;
}

/* Планшет */
@media (max-width: 991px) {
    .fs-search__inner {
        padding: 32px 20px 40px;
    }

    .fs-search__head {
        margin-bottom: 28px;
    }

    .fs-search__logo img {
        max-height: 56px;
    }

    .fs-search__field input {
        font-size: 18px;
    }
}

/* Мобильные: окно на весь экран, логотип убираем — место под поле и клавиатуру */
@media (max-width: 767px) {
    .fs-search__inner {
        padding: 18px 16px 32px;
    }

    .fs-search__head {
        margin-bottom: 18px;
        justify-content: flex-end;
    }

    .fs-search__logo {
        display: none;
    }

    .fs-search__cancel {
        position: static;
        transform: none;
    }

    .fs-search__field input {
        font-size: 16px; /* меньше 16px — iOS зумит страницу при фокусе */
    }

    .fs-search__tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .fs-search__tab {
        white-space: nowrap;
        font-size: 14px;
        margin-right: 18px;
    }

    .fs-search__chip {
        font-size: 13px;
        padding: 8px 14px;
    }
}
