/* ============================================================================
 * Футер сайта avyk.ru — улучшенное оформление.
 *
 * Что делает:
 *  - 4 колонки меню (footer-menu1..4) выстраивает в аккуратную сетку
 *    с равными зазорами и выравниванием по верху;
 *  - добавляет визуальный разделитель между меню и блоком реквизитов;
 *  - упорядочивает нижний блок (реквизиты, копирайт, контакты);
 *  - добавляет ховеры в фирменной палитре (зелёный #8bbb2b);
 *  - адаптив: на планшете 2 колонки, на телефоне — 1–2.
 *
 * Палитра сайта: сине-серый #6598ab, зелёный #8bbb2b, тёмная бирюза #1d4f5a.
 * Подключается из protected/views/layouts/main.php после main.css,
 * поэтому перекрывает старые правила футера.
 * ========================================================================== */

/* --- Фон и отступы всей плашки футера ------------------------------------- */
footer > div {
    margin-top: 24px;
    padding: 28px 0 18px;
    background-color: #6598ab;
    color: #fff;
}
/* Внутренний контейнер — ограничение по ширине как у остального сайта.
   Боковые отступы задаём явно, иначе на мобильных контент прилипает к краям. */
footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* --- Сетка меню: 4 ровные колонки ------------------------------------------ */
.in-footer {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    margin: 0 0 22px;
    padding: 0 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .28);
    gap: 24px;
}
/* Колонки: селекторы с классами меню (footer-menu1..4), чтобы
   перебить правила из modules.css (.in-footer .footer-menu4 ...). */
.in-footer .footer-menu1,
.in-footer .footer-menu2,
.in-footer .footer-menu3,
.in-footer .footer-menu4 {
    list-style: none;
    margin: 0;
    padding: 0;
    /* базовая ширина колонки: 4 штуки + зазоры укладываются в контейнер */
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 200px;
    -ms-flex: 1 1 200px;
    flex: 1 1 200px;
    min-width: 180px;
    max-width: 260px;
}
.in-footer .footer-menu1 li,
.in-footer .footer-menu2 li,
.in-footer .footer-menu3 li,
.in-footer .footer-menu4 li { margin-top: 0; }
.in-footer .footer-menu1 li + li,
.in-footer .footer-menu2 li + li,
.in-footer .footer-menu3 li + li,
.in-footer .footer-menu4 li + li { margin-top: 7px; }

/* Ссылки столбцов */
.in-footer .footer-menu1 a,
.in-footer .footer-menu2 a,
.in-footer .footer-menu3 a,
.in-footer .footer-menu4 a {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: inline-flex;
    align-items: center;
    line-height: 1.35;
    font-size: 14px;
    color: #fff;
    text-decoration: none;
    -webkit-transition: color .2s linear;
    -o-transition: color .2s linear;
    transition: color .2s linear;
}
.in-footer .footer-menu1 a:hover,
.in-footer .footer-menu2 a:hover,
.in-footer .footer-menu3 a:hover,
.in-footer .footer-menu4 a:hover { color: #d7f0a8; }

/* Иконки в столбцах меню */
.in-footer .footer-menu1 a .icon,
.in-footer .footer-menu2 a .icon,
.in-footer .footer-menu3 a .icon,
.in-footer .footer-menu4 a .icon {
    -webkit-flex: 0 0 auto;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
    fill: #fff;
    vertical-align: middle;
    -webkit-transition: fill .2s linear;
    -o-transition: fill .2s linear;
    transition: fill .2s linear;
}
.in-footer .footer-menu1 a:hover .icon,
.in-footer .footer-menu2 a:hover .icon,
.in-footer .footer-menu3 a:hover .icon,
.in-footer .footer-menu4 a:hover .icon { fill: #8bbb2b; }

/* Подчёркивание текста при наведении (не иконки) */
.footer-link-text {
    display: inline;
    border-bottom: 1px solid transparent;
    -webkit-transition: border-color .2s linear;
    -o-transition: border-color .2s linear;
    transition: border-color .2s linear;
}
.in-footer .footer-menu1 a:hover .footer-link-text,
.in-footer .footer-menu2 a:hover .footer-link-text,
.in-footer .footer-menu3 a:hover .footer-link-text,
.in-footer .footer-menu4 a:hover .footer-link-text {
    border-bottom-color: #8bbb2b;
}

/* --- Нижний блок: реквизиты, копирайт, контакты ---------------------------- */
footer .container > .left,
footer .left {
    margin: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .92);
}

/* Строка с иконкой (email/телефон/адрес) */
footer .left a,
footer .left span {
    display: inline;
    color: #fff;
    vertical-align: middle;
}
footer .left a {
    text-decoration: none;
    -webkit-transition: color .2s linear;
    -o-transition: color .2s linear;
    transition: color .2s linear;
}
footer .left a:hover { color: #d7f0a8; }

/* Иконки нижнего блока */
footer .left .icon {
    width: 18px;
    height: 18px;
    margin: -2px 6px 0 0;
    fill: #fff;
    vertical-align: middle;
    -webkit-transition: fill .2s linear;
    -o-transition: fill .2s linear;
    transition: fill .2s linear;
}
footer .left a:hover .icon,
footer .left span:hover .icon { fill: #8bbb2b; }

/* Плашка «не является офертой» — отделяем и приглушаем */
.footer-not-offer {
    display: block;
    max-width: 760px;
    margin: 8px 0 14px;
    padding: 10px 14px;
    font-size: 11.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .82);
    background: rgba(0, 0, 0, .12);
    border-left: 3px solid #8bbb2b;
    border-radius: 3px;
}

/* --- Нижняя строка футера: реквизиты (≈70%) + контакты как 4-я колонка --- */
.footer-bottom {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    gap: 30px;
}
/* Левая колонка (реквизиты + оговорка) — примерно 70% ширины */
.footer-bottom .left {
    -webkit-box-flex: 0;
    -webkit-flex: 1 1 70%;
    -ms-flex: 1 1 70%;
    flex: 1 1 70%;
    min-width: 300px;
    max-width: 70%;
}
/* Правая колонка — контакты: по размеру как колонка меню (footer-menuN) */
.footer-bottom .footer-contacts {
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 200px;
    -ms-flex: 1 1 200px;
    flex: 1 1 200px;
    min-width: 180px;
    max-width: 260px;
    font-size: 14px;
    line-height: 1.9;
    color: #fff;
}
.footer-contacts a,
.footer-contacts span {
    display: inline;
    color: #fff;
    vertical-align: middle;
    text-decoration: none;
}
.footer-contacts a {
    -webkit-transition: color .2s linear;
    -o-transition: color .2s linear;
    transition: color .2s linear;
}
.footer-contacts a:hover { color: #d7f0a8; }
.footer-contacts .icon {
    width: 18px;
    height: 18px;
    margin: -2px 8px 0 0;
    fill: #fff;
    vertical-align: middle;
    -webkit-transition: fill .2s linear;
    -o-transition: fill .2s linear;
    transition: fill .2s linear;
}
.footer-contacts a:hover .icon,
.footer-contacts span:hover .icon { fill: #8bbb2b; }

/* --- Адаптив --------------------------------------------------------------- */
@media screen and (max-width: 992px) {
    .in-footer { gap: 20px; }
    .in-footer .footer-menu1,
    .in-footer .footer-menu2,
    .in-footer .footer-menu3,
    .in-footer .footer-menu4 {
        flex: 1 1 40%;
        max-width: none;
    }
    .footer-bottom { gap: 22px; }
    .footer-bottom .left {
        flex: 1 1 100%;
        max-width: none;
    }
    .footer-bottom .footer-contacts {
        flex: 1 1 100%;
        max-width: none;
        border-top: 1px solid rgba(255, 255, 255, .28);
        padding-top: 16px;
    }
}
@media screen and (max-width: 576px) {
    footer > div { padding: 22px 0 14px; }
    /* Чуть больше боковых отступов на телефонах. */
    footer .container { padding: 0 16px; }
    .in-footer {
        gap: 16px 20px;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    .in-footer .footer-menu1,
    .in-footer .footer-menu2,
    .in-footer .footer-menu3,
    .in-footer .footer-menu4 {
        flex: 1 1 100%;
        max-width: none;
        margin: 0;
    }
    .footer-not-offer { max-width: none; }
    .footer-bottom .footer-contacts { line-height: 1.7; }
    /* Иконки чуть меньше, чтобы текст не выпирал за край. */
    footer .left .icon,
    .footer-contacts .icon { width: 16px; height: 16px; }
    /* Длинные email/адрес/ссылки переносим, а не растягиваем за экран. */
    .footer-contacts,
    .footer-contacts a,
    .footer-contacts span,
    .footer-not-offer {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* --- Узкие экраны (≤360px): ещё компактнее -------------------------------- */
@media screen and (max-width: 360px) {
    footer .container { padding: 0 14px; }
    .in-footer .footer-menu1 a,
    .in-footer .footer-menu2 a,
    .in-footer .footer-menu3 a,
    .in-footer .footer-menu4 a { font-size: 13px; }
}
