/**
 * Стили для хедера
 * 
 * @package RoofBangers
 * @since 1.0.0
 */

/* ==== Основные стили хедера ==== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-transparent {
    background-color: transparent;
}

.header-white {
    background-color: #FFFF;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.header-container {
    width: 100%;
    padding: 10px 20px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    margin: 0 auto;
}

/* ==== Логотип ==== */
.site-branding {
    flex-shrink: 0;
}

.site-logo {
    height: 70px !important;
    width: auto;
}

/* ==== Навигация ==== */
.main-navigation {
    flex: 1;
    margin: 0 40px;
}

.desktop-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 35px;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    text-decoration: none;
    text-transform: uppercase;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Стрелка для подменю */
.menu-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.3s ease;
}

.nav-menu li:hover .menu-arrow {
    transform: rotate(180deg);
}

/* Цвета текста для разных версий хедера */
.header-transparent .nav-menu a {
    color: #FFFF;
}

.header-white .nav-menu a {
    color: #2A2C2F;
}

.nav-menu a:hover {
    color: #078434;
}

/* Подменю */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #FFFF;
    min-width: 325px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.nav-menu li:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu a {
    color: #2A2C2F !important;
    padding: 10px 25px;
    font-size: 13px;
}

.sub-menu a:hover {
    background-color: #f5f5f5;
    color: #078434 !important;
}

/* ==== Правая часть хедера ==== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Кнопки поиска и языка */
.search-toggle,
.lang-toggle {
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.search-toggle {
    padding-top: 5px;
}

.lang-toggle {
    padding-top: 18px;
}

.search-toggle:hover,
.lang-toggle:hover {
    opacity: 0.7;
}

.search-toggle img {
    width: 24px;
    height: 24px;
}

.lang-toggle img {
    height: 24px;
}

/* Переключатель языков - базовые стили */
.current-lang-code,
.lang-arrow {
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* Стрелочка переключателя языков */
.lang-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid;
    margin-left: 5px;
    vertical-align: middle;
}

/* Для прозрачного хедера (главная страница) */
.header-transparent .current-lang-code {
    color: #FFFFFF;
}

.header-transparent .lang-arrow {
    border-top-color: #FFFFFF;
}

/* Для белого хедера (остальные страницы) */
.header-white .current-lang-code {
    color: #2A2C2F;
}

.header-white .lang-arrow {
    border-top-color: #2A2C2F;
}

/* При скролле на главной (управляется через JS) */
.header-transparent.scrolled .current-lang-code {
    color: #2A2C2F !important;
}

.header-transparent.scrolled .lang-arrow {
    border-top-color: #2A2C2F !important;
}

/* Социальные сети */
.header-social {
    display: flex;
    gap: 15px;
}

.header-social a {
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.header-social a:hover {
    opacity: 0.7;
}

.header-social img {
    width: 20px;
    height: 20px;
}

/* Кнопка обратного звонка */
.callback-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    background-color: var(--color-button-primary);
    color: #FFFF;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.callback-button:hover {
    background-color: var(--color-button-secondary);
}

.callback-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    /* Делаем иконку белой */
}

.callback-divider {
    width: 1px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.3);
}

/* ==== Мобильное меню ==== */
.mobile-only {
    display: none;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger {
    display: block;
    width: 25px;
    height: 20px;
    position: relative;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #2A2C2F;
    position: absolute;
    transition: all 0.3s ease;
}

.header-transparent .hamburger span {
    background-color: #FFFF;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
    bottom: 0;
}

/* Анимация гамбургера */
.menu-toggle.active .hamburger span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Мобильная навигация */
.mobile-navigation {
    position: fixed;
    display: flex;
    flex-direction: column;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 350px;
    height: 100vh;
    background-color: #FFFF;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
}

.mobile-navigation.active {
    right: 0;
}

.mobile-menu-content {
    padding: 20px;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-menu a {
    display: block;
    padding: 15px 0;
    color: #2A2C2F;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.mobile-nav-menu .sub-menu a {
    padding: 10px 0;
}

.mobile-nav-menu a:hover {
    color: #078434;
}

/* Подменю в мобильной версии */
.mobile-nav-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 20px;
    display: none;
}

.mobile-nav-menu .menu-item-has-children>a::after {
    content: '+';
    float: right;
    transition: transform 0.3s ease;
}

.mobile-nav-menu .menu-item-has-children.active>a::after {
    transform: rotate(45deg);
}

.mobile-nav-menu .menu-item-has-children.active>.sub-menu {
    display: block;
}

/* ===== Заголовок мобильного меню с кнопкой закрытия ===== */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin: 40px 0 20px;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-title {
    font-size: 20px;
    font-weight: 600;
    color: #2A2C2F;
    margin: 0;
}

/* Стили для кнопки закрытия мобильного меню */
.mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    float: right;
}

.mobile-menu-close:hover {
    background-color: #f5f5f5;
}

.mobile-menu-close:active {
    transform: scale(0.95);
}

/* Иконка крестика для закрытия */
.close-icon {
    position: relative;
    width: 20px;
    height: 20px;
    display: block;
}

.close-icon span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background-color: #2A2C2F;
    transition: all 0.3s ease;
}

.close-icon span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close-icon span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Социальные сети в мобильном меню */
.mobile-social {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #f0f0f0;
}

.mobile-social-title {
    font-size: 16px;
    font-weight: 600;
    color: #2A2C2F;
    margin: 0 0 20px;
}

.mobile-social-links {
    display: flex;
    gap: 20px;
}

.mobile-social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
}

.mobile-social-links a:hover {
    background-color: #078434;
    transform: translateY(-2px);
}

.mobile-social-links a:hover img {
    filter: brightness(0) invert(1);
}

.mobile-social-links a img {
    width: 20px;
    height: 20px;
    transition: filter 0.3s ease;
}

/* ==== Попапы ==== */
/* Попап поиска */
.search-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.search-popup.active {
    opacity: 1;
    visibility: visible;
}

.search-popup-content {
    width: 90%;
    max-width: 600px;
    position: relative;
}

.search-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #FFFF;
    font-size: 40px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.search-close:hover {
    opacity: 0.7;
}

.search-form {
    display: flex;
    gap: 20px;
}

.error-search .search-form {
    gap: 0;
}

.search-field {
    flex: 1;
    padding: 20px;
    font-size: 18px;
    border: none;
    border-radius: 5px;
    background-color: #FFFF;
}

.search-submit {
    padding: 20px 40px;
    background-color: var(--color-button-primary);
    color: #FFFF;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-submit:hover {
    background-color: var(--color-button-secondary);
}

/* Переключатель языка */
/* ===== Переключатель языков ===== */
.lang-switcher {
    position: relative;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.header-transparent .lang-toggle {
    color: #FFFFFF;
}

.header-white .lang-toggle {
    color: #2A2C2F;
}

.lang-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-white .lang-toggle:hover {
    background-color: rgba(42, 44, 47, 0.1);
}

.current-lang-flag {
    border-radius: 2px;
    object-fit: cover;
}

.current-lang-code {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
}

.lang-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.3s ease;
}

.lang-toggle[aria-expanded="true"] .lang-arrow {
    transform: rotate(180deg);
}

/* Выпадающее меню языков */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #FFFFFF;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 105px;
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 15px;
    color: #2A2C2F;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background-color: #f8f9fa;
    color: #078434;
}

.lang-option img {
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

.lang-option span {
    text-transform: uppercase;
}

/* ==== Медиа запросы ==== */
@media (max-width: 1440px) {
    .nav-menu {
        gap: 28px;
    }

    .nav-menu a {
        font-weight: 400;
        font-size: 0.9vw;
    }
}

@media (max-width: 1366px) {
    .nav-menu {
        gap: 20px;
    }
}

@media (max-width: 1200px) {
    .callback-button {
        gap: 10px;
        padding: 7px 10px;
        font-size: 13px;
        font-weight: 400;
    }

    .header-social {
        gap: 10px;
    }

    .lang-toggle {
        padding: 18px 0 0;
    }

    .search-toggle {
        padding: 5px 0 0;
    }
}

@media (max-width: 1024px) {
    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    .desktop-navigation {
        display: none;
    }

    .header-content {
        height: 60px;
    }

    .site-logo {
        height: 50px !important;
    }

    .header-actions {
        gap: 15px;
    }

    .lang-toggle {
        padding: 6px 8px;
        gap: 6px;
    }

    .current-lang-code {
        font-size: 13px;
    }

    .lang-dropdown {
        right: -10px;
    }
}

@media (max-width: 922px) {}

@media (max-width: 991px) {}

@media (max-width: 853px) {}

@media (max-width: 820px) {}

@media (max-width: 767px) {}

@media (max-width: 576px) {
    .search-form {
        gap: 10px;
    }

    .search-field {
        font-size: 16px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 15px;
    }

    .mobile-navigation {
        width: 90%;
    }

    .collback-text,
    .callback-divider {
        display: none;
    }

    .site-logo {
        height: 40px !important;
    }

    .current-lang-code {
        display: none;
    }

    .lang-toggle {
        padding: 6px;
    }
}

@media (max-width: 438px) {}

@media (max-width: 375px) {
    .search-form {
        flex-wrap: wrap;
    }

    .search-submit {
        width: 100%;
    }
}