/* css/component/main_menu.css */
/*

ПОЛНЫЙ ИЗОЛИРОВАННЫЙ CSS ДЛЯ АДАПТИВНОГО HEADER
Цвета берутся из base_color.css
Реализованы все сценарии: Desktop, Tablet (Actions Wrap), Mobile (Nav -> Burger)
ИСПРАВЛЕНО: Отключена фиксация на мобильных устройствах.
ИСПРАВЛЕНО: Блокировка изменения цвета для :visited ссылок.
*/

/* === Общие переменные и сброс для компонента === */
:root {
    /* Локальные переменные компонента можно добавить здесь, если они не являются глобальными */
}

.header {
    position: sticky;
    top: 0;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--FOSS-Blue-link-grey);
    font-family: var(--base-font-family);
    box-sizing: border-box;
    min-height: var(--header-height);
    width: 100%;
    z-index: 100;
    margin: 0;
    padding: 0;
}

.header-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 0 20px;
    min-height: var(--header-height);
    justify-content: space-between;
}

/* === Стили Логотипа === */
.logo {
    margin-right: 20px;
    flex-shrink: 0;
    display: block;
    width: 106px;
    text-decoration: none;
    color: inherit;
}

.logo-img {
    width: 100%;
    height: auto;
    max-width: 100%;
}

/* === Стили Навигации === */
.nav_main_menu {
    flex-grow: 1;
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--FOSS-Blue);
    margin: 0;
    font-size: var(--font-size-nav);
    min-width: 0;
    order: 3;
}

.nav-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item_main_menu {
    margin: 0 8px;
    flex-shrink: 0;
}

.nav-link,
.nav-link:visited {
    display: flex;
    align-items: center;
    height: var(--header-height);
    padding: 0 5px;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
    color: var(--FOSS-Blue);
}

.nav-link:hover {
    color: var(--altima-red);
}

.nav-item_main_menu.is-highlighted .nav-link {
    color: var(--altima-red);
}

/* === Стили Действий (Actions) === */
.actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    order: 2;
}

.action-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    font-weight: 700;
    font-size: var(--font-size-nav);
    line-height: 1;
    white-space: nowrap;
    border-radius: 26px;
    padding: 16px 20px;
    min-height: 52px;
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: background-color 0.2s, color 0.2s;
    gap: 10px;
}

.action-btn:hover {
    background-color: var(--FOSS-Blue);
    color: var(--color-white);
}

.action-btn span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phone-style-btn {
    color: var(--FOSS-Blue);
    background-color: var(--color-bg-light);
}

.service-style-btn {
    background-color: var(--FOSS-Blue-link);
    color: var(--color-white);
}

.service-style-btn:hover {
    background-color: var(--FOSS-Orange-button);
}

.search-style-btn,
.action-btn.menu-btn,
.menu-toggle {
    padding: 0;
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    border-radius: 50%;
    gap: 0;
    justify-content: center;
    align-items: center;
    color: inherit;
}

.search-style-btn:hover,
.action-btn.menu-btn:hover,
.menu-toggle:hover {
    color: inherit;
    background-color: var(--FOSS-Blue-link-grey);
}

.search-style-btn {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    background-color: var(--color-bg-light);
}

.action-btn.menu-btn {
    background-color: var(--color-bg-light);
}

.menu-toggle {
    background-color: transparent;
}

.menu-toggle:hover {
    background-color: var(--color-bg-light);
}

.btn-icon {
    width: 16px;
    height: 16px;
}

/* === Стили Поиска === */
.search-switch {
    position: static;
    flex-shrink: 0;
}

.search-toggle-input {
    display: none;
}

.search-full-width {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--FOSS-Blue-link-grey);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    z-index: 900;
    display: none;
    transform-origin: top;
    animation: slideDown 0.3s ease forwards;
}

.search-toggle-input:checked ~ .search-full-width {
    display: block;
}

.search-toggle-input:checked ~ .search-style-btn {
    background-color: var(--FOSS-Blue-link);
    color: var(--color-white);

}

.search-toggle-input:checked ~ .search-style-btn .btn-icon {
    filter: brightness(0) invert(1);
}


.search-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.search-input {
    flex-grow: 1;
    height: 50px;
    border: none;
    border-bottom: 2px solid #E6E9EB;
    font-family: var(--base-font-family);
    font-size: 18px;
    color: var(--text-dark-grey);
    background: transparent;
    outline: none;
    padding: 0 10px;
    transition: border-color 0.3s;
}

.search-input::placeholder {
    color: #999;
}

.search-input:focus {
    border-bottom-color: var(--altima-red);
}

.search-submit-btn {
    flex-shrink: 0;
    height: 50px;
    padding: 0 30px;
    background-color: var(--altima-red);
    color: var(--color-white);
    border: none;
    border-radius: 25px;
    font-family: var(--base-font-family);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-submit-btn:hover {
    background-color: #d93d0a;
}

/* === Стили Переключателя Языка === */
.lang-switch {
    position: relative;
    flex-shrink: 0;
}

.lang-switch .lang-icon {
    width: 24px;
    height: 24px;
}

.lang-toggle-input {
    display: none;
}

.lang-dropdown {
    position: absolute;
    top: 60px;
    right: -10px;
    z-index: 1000;
    min-width: 195px;
    background: #F7F8FA;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 15px 15px;
    display: none;
    flex-direction: column;
    gap: 11px;
}

.lang-dropdown-title {
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 14px;
    line-height: 16px;
    color: var(--brand-blue);
    margin-bottom: 5px;
    padding-left: 5px;
}

.lang-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.lang-list-item {
    width: 100%;
}

.lang-link,
.lang-link:visited {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 5px;
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 16px;
    color: var(--brand-blue);
    transition: opacity 0.2s;
}

.lang-link:hover {
    opacity: 0.7;
    color: var(--brand-blue);
}

.lang-link.is-highlighted {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lang-separator {
    height: 1px;
    width: 100%;
    background-color: #E6E9EB;
    margin: 2px 0;
}

.lang-toggle-input:checked ~ .lang-dropdown {
    display: flex;
}

/* 1. Змінюємо фон label, коли input вибраний */
#lang-toggle-input:checked + label {
    background-color: var(--FOSS-Blue-link);
}

/* 2. Змінюємо колір іконки всередині цього label */
#lang-toggle-input:checked + label img {
    filter: brightness(0) invert(1);
}


/* === Стили Гамбургера === */
.menu-toggle-input {
    display: none;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    order: 2;
    border: none;
    flex-shrink: 0;
}

.menu-toggle:focus,
.menu-toggle:active {
    outline: none;
    border: none;
}

.burger-icon {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--FOSS-Blue);
    position: relative;
}

.burger-icon::before, .burger-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--FOSS-Blue);
    left: 0;
}

.burger-icon::before {
    top: -6px;
}

.burger-icon::after {
    top: 6px;
}

/* === Анимации === */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === АДАПТИВНОСТЬ === /
/ Desktop (>1176px) */
.logo {
    order: 0;
}

.nav_main_menu {
    order: 1;
    justify-content: flex-start;
    margin-right: auto;
}

.actions {
    order: 2;
    margin-left: 0;
    margin-right: 0;
}

/* Tablet (<=1176px) */
@media (max-width: 1287px) {
    .header-inner {
        min-height: auto;
        padding-top: 10px;
        padding-bottom: 10px;
        justify-content: flex-start;
    }

    .logo {
        order: 0;
    }

    .nav_main_menu {
        order: 1;
        flex-grow: 1;
        margin-right: 0;
    }

    .actions {
        width: 100%;
        order: 2;
        /*   margin-top: 10px;*/
        margin-left: 0;
        margin-right: 0;
        justify-content: flex-end;
    }

    .menu-toggle {
        height: auto;
        min-height: auto;

    }

    .nav-link,
    .nav-link:visited {
        height: auto;
    }
}

/* Mobile (<=686px) */
@media (max-width: 740px) {
    .header {
        position: relative;
    }

    html {
        scroll-padding-top: auto; /* высота header */
    }


    .nav_main_menu {
        display: none;
        order: 4;
        width: 100%;
        background-color: var(--color-white);
        padding: 10px 20px;
        border-top: 1px solid var(--FOSS-Blue-link-grey);
        margin-top: 0;
    }

    .nav-list {
        flex-direction: column;
    }

    .nav-item_main_menu {
        margin: 0;
        padding: 5px 0;
        border-bottom: 1px solid var(--FOSS-Blue-link-grey);
    }

    .nav-item_main_menu:last-child {
        border-bottom: none;
    }

    .nav-link {
        height: auto;
        padding: 10px 0;
        display: block;
    }

    .menu-toggle {
        display: flex;
        order: 2;
        margin-left: 10px;
        margin-right: 0;
    }

    .menu-toggle-input:checked ~ .nav_main_menu {
        display: block;
        margin-top: 10px;
    }

    .header-inner {
        justify-content: space-between;
        position: relative;
    }

    .logo {
        order: 0;
        margin-right: 0;
    }

    .actions {
        width: auto;
        order: 1;
        margin-top: 0;
        margin-left: auto;
        margin-right: 10px;
        justify-content: flex-end;
        gap: 5px;
    }

    .action-btn {
        padding: 10px 15px;
        font-size: 12px;
        min-height: 40px;
        border-radius: 20px;
    }

    .search-style-btn,
    .action-btn.menu-btn,
    .menu-toggle {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .btn-icon, .lang-icon {
        width: 16px;
        height: 16px;
    }

    .search-input {
        font-size: 16px;
        height: 40px;
    }

    .search-submit-btn {
        height: 40px;
        padding: 0 20px;
        font-size: 14px;
    }

    .search-full-width {
        padding: 15px 0;
    }
}