/* Шапка: поиск в центре + подписанные мессенджеры. Добавлено 2026-10-01. */

/* ---- Раскладка верхнего ряда: логотип | поиск | контакты ---- */
@media (min-width: 1200px) {
    .header-above-wrapper .header-above-inner {
        display: flex;
        align-items: center;
        gap: 28px;
    }
    .header-above-wrapper .header-above-inner > .logo-header {
        float: none;
        flex: 0 0 auto;
    }
    .header-above-wrapper .header-above-inner > .header-customize-right {
        float: none;
        flex: 1 1 auto;
        justify-content: flex-end;
        min-width: 0;
    }
    .header-above-wrapper .header-customize-right .item-custom-text {
        flex: 1 1 auto;
        align-items: center;
        gap: 18px;
        min-width: 0;
    }
    .header-above-wrapper .head-btn {
        margin-left: 0 !important;
        flex: 0 0 auto;
    }
    .header-above-wrapper .head-info,
    .header-above-wrapper .headwhatsapp12 {
        flex: 0 0 auto;
    }
}

/* ---- Строка поиска ---- */
.vm-hsearch {
    position: relative;
    display: none;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 520px;
    margin: 0;
}
@media (min-width: 1200px) {
    .vm-hsearch { display: flex; }
}
.vm-hsearch > form {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 46px;
    border: 1.5px solid #cfdae8;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.vm-hsearch > form:focus-within {
    border-color: #2e6fb7;
    box-shadow: 0 0 0 3px rgba(46, 111, 183, .13);
}
.vm-hsearch__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    font-size: 15px;
    line-height: 1.2;
    color: #15181d;
}
.vm-hsearch__input::placeholder { color: #8793a5; }
.vm-hsearch__input::-webkit-search-cancel-button { cursor: pointer; }
.vm-hsearch__btn {
    flex: 0 0 auto;
    width: 56px;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #2e6fb7;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}
.vm-hsearch__btn:hover,
.vm-hsearch__btn:focus { background: #255d9c; color: #fff; }
.vm-hsearch__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---- Выпадающие подсказки ---- */
.vm-hsearch__drop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    width: 480px;
    max-width: 80vw;
    min-width: 100%;
    z-index: 1200;
    background: #fff;
    border: 1px solid #dce4ef;
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(16, 40, 80, .15);
    overflow: hidden;
    display: none;
}
.vm-hsearch__drop.is-open { display: block; }
.vm-hsearch__head {
    padding: 10px 16px;
    background: #f7fafd;
    border-bottom: 1px solid #edf2f8;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #6a7382;
}
.vm-hsearch__list { max-height: 420px; overflow-y: auto; }
.vm-hsearch__item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f4f9;
    color: #15181d;
    text-decoration: none;
}
.vm-hsearch__item:hover,
.vm-hsearch__item:focus { background: #f5f9fd; color: #15181d; }
.vm-hsearch__thumb {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 6px;
    background: #edf2f8 center/cover no-repeat;
}
.vm-hsearch__body { flex: 1 1 auto; min-width: 0; }
.vm-hsearch__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.vm-hsearch__meta { margin-top: 2px; font-size: 12px; color: #6a7382; }
.vm-hsearch__badge {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 4px;
    background: #e6f4ec;
    color: #1f7a4d;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.vm-hsearch__price {
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}
.vm-hsearch__all {
    display: block;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: #2e6fb7;
    text-decoration: none;
}
.vm-hsearch__all:hover { background: #f5f9fd; color: #255d9c; }
.vm-hsearch__empty { padding: 18px 16px; font-size: 14px; color: #6a7382; }

/* ---- Мессенджеры с подписями ---- */
.headwhatsapp12 { gap: 8px !important; }
.vm-msgr {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 13px;
    border: 1.5px solid #cfdae8;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: #16325c;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .15s ease, color .15s ease;
}
.vm-msgr:hover,
.vm-msgr:focus { border-color: #2e6fb7; color: #2e6fb7; }
.vm-msgr img {
    width: 22px;
    height: 22px;
    margin: 0 !important;
    display: block;
}
/* Подписи прячем только там, где верхнего ряда уже нет (ниже 1200px). */
@media (max-width: 1199px) {
    .vm-msgr span { display: none; }
    .vm-msgr { padding: 0 9px; }
}

/* Лупу тема вырезает вместе с inline-SVG, поэтому рисуем её маской. */
.vm-hsearch > form > .vm-hsearch__btn::after {
    content: "";
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: var(--vm-loupe) center / contain no-repeat;
            mask: var(--vm-loupe) center / contain no-repeat;
}
.vm-hsearch {
    --vm-loupe: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E");
}

/* Тема красит span внутри правой части шапки в белый — возвращаем свой цвет. */
.headwhatsapp12 .vm-msgr span {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
}
/* Тема задаёт инпутам свою высоту — поле должно совпадать с рамкой формы. */
.vm-hsearch > form > input.vm-hsearch__input {
    height: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* На главной тема красит все ссылки шапки в белый (.home header a).
   Поднимаем специфичность, иначе подписи мессенджеров сливаются с фоном. */
.headwhatsapp12 a.vm-msgr,
.headwhatsapp12 a.vm-msgr span {
    color: #16325c;
}
.headwhatsapp12 a.vm-msgr:hover,
.headwhatsapp12 a.vm-msgr:hover span,
.headwhatsapp12 a.vm-msgr:focus,
.headwhatsapp12 a.vm-msgr:focus span {
    color: #2e6fb7;
}
.vm-hsearch > form > input.vm-hsearch__input { color: #15181d !important; }
.vm-hsearch > form > .vm-hsearch__btn { color: #fff !important; }
.vm-hsearch .vm-hsearch__drop a { color: #15181d; }
.vm-hsearch .vm-hsearch__drop a.vm-hsearch__all { color: #2e6fb7; }

/* ============ Подгонка под макет (2026-10-01) ============ */
@media (min-width: 1200px) {
    /* Отдаём поиску максимум ширины: ужимаем соседей */
    .header-above-wrapper .header-customize-right .item-custom-text { gap: 14px; }
    .header-above-wrapper .head-tel  { font-size: 21px !important; line-height: 1.15 !important; }
    .header-above-wrapper .head-mail { font-size: 13px !important; }
    .header-above-wrapper .head-btn a {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    .vm-hsearch { max-width: none; min-width: 400px; }
    .vm-msgr { padding: 0 11px; gap: 6px; }
    .vm-msgr img { width: 20px; height: 20px; }
}

/* Кнопка «Каталог» — залитая, как в макете. Бургер в ::before перекрашиваем в белый. */
/* Кнопку «Каталог» кто-то зафиксировал белой инлайновым правилом
   ul#main-menu li.katalog > a.x-menu-a-text { background:#fff !important }
   (специфичность 1-2-2). Чтобы залить её синим, нужен селектор тяжелее. */
html body ul#main-menu li.katalog > a.x-menu-a-text {
    background: #2e6fb7 !important;
    border-color: #2e6fb7 !important;
    color: #fff !important;
}
html body ul#main-menu li.katalog > a.x-menu-a-text .x-menu-text,
html body ul#main-menu li.katalog > a.x-menu-a-text .x-caret {
    color: #fff !important;
}
html body ul#main-menu li.katalog > a.x-menu-a-text::before {
    filter: brightness(0) invert(1);
}
html body ul#main-menu li.katalog > a.x-menu-a-text:hover,
html body ul#main-menu li.katalog.x-active > a.x-menu-a-text {
    background: #255d9c !important;
    border-color: #255d9c !important;
}

/* Ссылка на кабинет — в рамке, как в макете */
.monitoring-link > a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border: 1.5px solid #2e6fb7;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    color: #2e6fb7;
    text-decoration: none;
}
.monitoring-link > a:hover { background: #2e6fb7; color: #fff; }
.monitoring-link > a:hover img { filter: brightness(0) invert(1); }
.monitoring-link > a img { width: 18px; height: 18px; margin: 0; }

/* ---- Выравнивание верхнего ряда по нижнему (2026-10-02) ----
   У .header-above-inner есть класс clearfix. Его ::before/::after
   в flex-контейнере становятся обычными flex-элементами и забирают
   по одному gap с каждого края — логотип уезжал на 28px вправо,
   а кнопка звонка на 28px влево относительно ряда меню.
   Плюс 5px слева, чтобы логотип встал ровно под кнопкой «Каталог». */
@media (min-width: 1200px) {
    .header-above-wrapper .header-above-inner::before,
    .header-above-wrapper .header-above-inner::after {
        display: none;
    }
    .header-above-wrapper .header-above-inner {
        padding-left: 5px;
    }
}
