/* ============================================================================
 * Шапка сайта avyk.ru (#header / .header-item) — улучшенное оформление.
 *
 * Что делает:
 *  - задаёт фон/тень полосе шапки и выравнивает блоки по центру;
 *  - приводит логотип («Авик · Инженерные системы») к фирменным цветам;
 *  - оформляет ссылки-действия (Обратный звонок, Калькулятор, Наше ТВ,
 *    Наши объекты) как аккуратные ссылки с иконкой и подчёркиванием;
 *  - выделяет контактный блок (телефон + e-mail) справа;
 *  - адаптив: на планшете уменьшает размеры, на телефоне разворачивает
 *    всё в колонку и центрирует.
 *
 * Палитра сайта: сине-серый #6598ab, зелёный #8bbb2b, тёмная бирюза #1d4f5a.
 *
 * Подключается из protected/views/layouts/main.php ПОСЛЕ main.css
 * (registerCoreScript('main')), поэтому перебивает старые правила шапки
 * из main.pretty.css. Разметка приходит из админки (шаблон
 * section_header_top, templates/.../update/id/25):
 *   <section class="stripe" id="header"><div class="container">
 *     .header-item#logo        → логотип (.img svg + .text .text_header/.text_slogan)
 *     .header-item.underline   → Обратный звонок / Калькулятор вентиляции
 *     .header-item.underline   → Наше ТВ / Наши объекты
 *     .header-item#mainPhone   → телефон #phn + e-mail #ml
 *   </div></section>
 * ========================================================================== */

/* --- Полоса шапки --------------------------------------------------------- */
#header {
    background-color: #fff;
    border-bottom: 1px solid #e7eef1;
    box-shadow: 0 2px 8px rgba(29, 79, 90, .06);
}

#header .container {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-direction: row;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -ms-flex-direction: row;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 10px 24px;
    min-height: 104px;       /* комфортная высота, перебиваем 100px из main.css */
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 15px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* --- Логотип -------------------------------------------------------------- */
#header #logo a {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

#header #logo a .img {
    min-width: 60px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}

#header #logo a .img img {
    display: block;
    width: 60px;
    height: 60px;
}

#header #logo a .text {
    font-family: Verdana, Tahoma, sans-serif;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-direction: column;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    margin-left: 10px;
}

#header #logo a .text_header {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    margin: -6px 0 -2px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #1d4f5a;          /* фирменная тёмная бирюза вместо серого #404247 */
}

#header #logo a .text_slogan {
    font-size: 12px;
    margin-top: 3px;
    padding-top: 3px;
    text-transform: lowercase;
    color: #6598ab;          /* фирменный сине-серый вместо почти чёрного */
    border-top: 1px solid rgba(101, 152, 171, .45);
}

/* --- Ссылки-действия (.header-item.underline) ----------------------------- */
#header .header-item {
    font-size: 16px;
}

#header .header-item .icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    fill: #1d4f5a;
    -webkit-transition: fill .2s linear;
    -o-transition: fill .2s linear;
    transition: fill .2s linear;
}

#header .header-item a {
    color: #1d4f5a;
    text-decoration: none;
    -webkit-transition: color .2s linear;
    -o-transition: color .2s linear;
    transition: color .2s linear;
}

#header .header-item a:hover {
    color: #8bbb2b;
}

#header .header-item a:hover .icon {
    fill: #8bbb2b;
}

/* Блок из двух ссылок: чуть плотнее, ровные строки */
#header .header-item.underline {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-direction: column;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    gap: 8px;
}

#header .header-item.underline .dsbl {
    display: block;
}

#header .header-item.underline a {
    position: relative;
    display: inline-block;
    line-height: 1.3;
}

/* Подчёркивание при наведении (как в верхнем меню/футере) */
#header .header-item.underline a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: #8bbb2b;
    transform: scaleX(0);
    transform-origin: left center;
    -webkit-transition: transform .25s ease-out;
    -o-transition: transform .25s ease-out;
    transition: transform .25s ease-out;
}

#header .header-item.underline a:hover::after {
    transform: scaleX(1);
}

/* --- Контактный блок (телефон + e-mail) ----------------------------------- */
#header #mainPhone {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-direction: column;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    -webkit-box-align: end;
    -webkit-align-items: flex-end;
    -ms-flex-align: flex-end;
    align-items: flex-end;
    gap: 4px;
}

#header #mainPhone a {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    text-align: right;
    color: #1d4f5a;
    text-decoration: none;
    -webkit-transition: color .2s linear;
    -o-transition: color .2s linear;
    transition: color .2s linear;
}

#header #mainPhone a:hover {
    color: #8bbb2b;
}

#header #mainPhone a:hover .icon {
    fill: #8bbb2b;
}

#header #mainPhone #phn {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap;
}

#header #mainPhone #ml {
    font-size: 14px;
    color: #6598ab;
}

#header #mainPhone #ml .icon {
    fill: #6598ab;
}

#header #mainPhone #ml:hover {
    color: #8bbb2b;
}

#header #mainPhone #ml:hover .icon {
    fill: #8bbb2b;
}

/* --- Адаптив -------------------------------------------------------------- */
/* Планшет: меньше отступы и шрифты */
@media screen and (max-width: 992px) {
    #header .container {
        min-height: 90px;
        gap: 8px 18px;
        padding: 10px 15px;
    }

    #header #logo a .text_header {
        font-size: 34px;
    }

    #header .header-item {
        font-size: 15px;
    }

    #header #mainPhone #phn {
        font-size: 20px;
    }
}

@media screen and (max-width: 768px) {
    #header .container {
        min-height: 70px;
        -webkit-box-pack: justify;
        -webkit-justify-content: space-between;
        -ms-flex-pack: justify;
        justify-content: space-between;
        gap: 10px 16px;
    }

    #header #logo a .text_header {
        font-size: 30px;
    }

    #header .header-item.underline {
        gap: 6px;
    }

    #header .header-item {
        font-size: 14px;
    }

    #header #mainPhone #phn {
        font-size: 20px;
    }
}

/* Мобильный: всё в колонку, по центру; служебные ссылки складываем в ряд */
@media screen and (max-width: 576px) {
    #header .container {
        flex-direction: column;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-flex-direction: column;
        -ms-flex-direction: column;
        -webkit-box-align: center;
        -webkit-align-items: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -webkit-justify-content: center;
        -ms-flex-pack: center;
        justify-content: center;
        padding: 12px 16px;
        gap: 8px;
    }

    #header #logo a .text {
        margin-left: 8px;
    }

    #header #logo a .text_header {
        font-size: 32px;
    }

    /* Служебные ссылки (.underline) — показываем, но в один ряд по центру */
    #header .header-item.underline {
        flex-direction: row;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -webkit-flex-direction: row;
        -ms-flex-direction: row;
        -webkit-box-pack: center;
        -webkit-justify-content: center;
        -ms-flex-pack: center;
        justify-content: center;
        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        gap: 6px 18px;
    }

    #header #mainPhone {
        -webkit-box-align: center;
        -webkit-align-items: center;
        -ms-flex-align: center;
        align-items: center;
    }

    #header #mainPhone a {
        text-align: center;
    }

    #header #mainPhone #phn {
        font-size: 22px;
    }
}

/* Очень узкие экраны */
@media screen and (max-width: 360px) {
    #header .container {
        padding: 10px 14px;
    }

    #header #logo a .text_header {
        font-size: 26px;
    }

    #header #logo a .text_slogan {
        font-size: 11px;
    }

    #header .header-item {
        font-size: 13px;
    }

    #header #mainPhone #phn {
        font-size: 20px;
    }
}
