/* ===============================
   Header Styles
   Собраны из всех файлов темы
   =============================== */

:root {
    --primary-color: #7A42F4;
    --primary-light: #a777ff;
    --primary-dark: #6c37d9;
}

/* ===============================
   Основные стили хедера
   =============================== */

/* Единый стиль хедера для всех страниц */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    background-color: #000000;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
    border-top: 4px solid var(--text-color);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 99999 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
    overflow: visible;
}

/* ===============================
   Главная страница - стили хедера
   =============================== */

/* Хедер единый на всех страницах - черный градиент */
.site-header.homepage-header {
    background-color: #000000;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
}

/* При скролле хедер остается с черным градиентом */
.scrolled .site-header,
.scrolled .site-header.homepage-header {
    background: #000000;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===============================
   Внутренняя структура хедера
   =============================== */

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    width: 100%;
}

.header-branding {
    display: flex;
    flex-direction: row;
    align-items: center;
}

/* ===============================
   Логотип
   =============================== */

.site-logo {
    margin-bottom: 0;
    margin-right: 24px;
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.site-logo img {
    max-height: 40px;
    height: 30px;
    height: 36px;
    width: auto;
    display: block;
}

.site-branding .custom-logo {
    max-height: 40px;
    width: auto;
}

.header-start-link {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.3s ease;
}

.header-start-link:hover {
    color: var(--primary-dark);
}

/* ===============================
   Навигация
   =============================== */

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
    gap: 30px;
}

.main-navigation ul li {
    margin: 0;
}

.main-navigation ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    font-size: 16px;
}

.main-navigation a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s ease;
    position: relative;
}

.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item a,
.main-navigation a:hover {
    color: var(--primary-light);
    border-bottom: 2px solid var(--primary-light);
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-light);
    transition: width 0.3s ease;
}

.main-navigation a:hover::after {
    width: 100%;
}

.main-navigation ul li a.login-link {
    font-weight: 600;
}

.login-link {
    color: #ffffff !important;
    opacity: 0.8;
}

.login-link:hover {
    opacity: 1;
}

/* Hide navigation on all devices for this design */
.main-nav {
    display: none;
}

.homepage-header .main-nav {
    margin-left: 40px;
}

.homepage-header .main-nav .nav-menu a,
.homepage-header .page_item a {
    color: white !important;
    font-weight: 500 !important;
}

.homepage-header .main-nav .nav-menu a:hover,
.homepage-header .page_item a:hover {
    color: var(--primary-light) !important;
}

/* ===============================
   Панель действий хедера
   =============================== */

.header-right-panel {
    display: flex;
    align-items: baseline;
    gap: 2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.homepage-header .header-actions {
    margin-left: auto;
}

/* Кнопка "Получить предложение" / "Начать бесплатно" */
.header-actions .get-a-quote-btn,
.get-a-quote-btn {
    background: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 0.75rem 1.5rem;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: background 0.3s ease;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(122, 66, 244, 0.15);
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.header-actions .get-a-quote-btn:hover,
.get-a-quote-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(122, 66, 244, 0.25);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: #ffffff;
    text-decoration: none;
}

.homepage-header .btn-get-quote {
    background-color: var(--primary-color) !important;
    color: white !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.homepage-header .btn-get-quote:hover {
    background-color: var(--primary-dark) !important;
}

/* ===============================
   Мобильное меню / Кнопка переключения
   =============================== */

.menu-toggle {
    display: none;
    background: transparent !important;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border: none;
    border-radius: 4px !important;
    padding: 8px !important;
    padding: 10px;
    padding: 5px;
    cursor: pointer;
    position: relative;
    z-index: 1001;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
    min-width: 44px;
    min-height: 44px;
}

.homepage-header .menu-toggle {
    display: none;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 4px !important;
    padding: 8px !important;
    cursor: pointer;
}

.homepage-header .menu-toggle svg path {
    fill: white !important;
}

.hamburger-icon {
    display: block;
    width: 25px;
    width: 22px;
    height: 3px;
    height: 2px;
    background: #fff;
    background-color: #fff;
    position: relative;
    transition: all 0.3s ease;
    transition: background-color 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 25px;
    width: 100%;
    height: 3px;
    height: 100%;
    background: #fff;
    background-color: #fff;
    transition: all 0.3s ease;
    left: 0;
    transition: transform 0.3s ease, top 0.3s ease;
}

.hamburger-icon::before {
    top: -8px;
    top: -7px;
}

.hamburger-icon::after {
    bottom: -8px;
    top: 7px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-menu-open .hamburger-icon {
    background-color: transparent;
}

.mobile-menu-open .hamburger-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-open .hamburger-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ===============================
   Языковой переключатель
   Не блокировать и не обрезать: overflow visible, клики работают
   =============================== */

/* Родители переключателя не должны обрезать выпадающий список */
.site-header .header-actions,
.site-header .header__language-switcher,
.footer__language-switcher {
    overflow: visible;
}

.language-switcher {
    position: relative;
    display: inline-block;
    overflow: visible;
}

.language-switcher__current {
    background-color: #2d3748;
    background-color: #1e293b;
    color: #ffffff;
    padding: 8px 12px;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    gap: 4px;
    border: 1px solid #4a5568;
    border: 1px solid #334155;
    transition: background-color 0.2s;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    user-select: none;
    min-width: 44px;
    min-height: 44px;
}

.language-switcher__current:hover {
    background-color: #4a5568;
    background-color: #334155;
}

.language-switcher__current svg {
    transition: transform 0.2s ease-in-out;
    margin-left: 2px;
}

.language-switcher.open .language-switcher__current svg {
    transform: rotate(180deg);
}

.language-switcher__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    bottom: auto;
    right: 0;
    margin-top: 8px;
    background-color: #2d3748;
    background-color: #1e293b;
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid #4a5568;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 4px;
    padding: 8px 0;
    list-style: none;
    margin: 0;
    min-width: 60px;
    min-width: 48px;
    min-width: 150px;
    z-index: 10000;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.language-switcher.open .language-switcher__dropdown {
    display: flex;
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.language-switcher__dropdown li a {
    display: block;
    padding: 8px 12px;
    padding: 4px 0;
    padding: 4px 6px;
    color: #ffffff;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 4px;
    min-width: 0;
    background: none;
    box-shadow: none;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    user-select: none;
    min-height: 44px;
    cursor: pointer;
}

.language-switcher__dropdown li a img {
    width: 24px;
    height: 18px;
    display: block;
    margin: 0;
}

.language-switcher__dropdown li a:hover,
.language-switcher__dropdown li a.active {
    background-color: #4a5568;
    background-color: #334155;
    color: #ffffff;
}

.header__language-switcher {
    margin: 0 0 0 8px;
    margin: 0 0 0 16px;
    padding: 0;
    display: flex;
    align-items: center;
}

.footer__language-switcher .language-switcher__dropdown {
    bottom: 100%;
    top: auto;
}

.header__language-switcher .language-switcher__dropdown {
    top: 100%;
    bottom: auto;
}


/* ===============================
   Медиа-запросы
   =============================== */

@media (max-width: 992px) {
    .homepage-header .main-nav {
        margin-left: 40px;
        display: none !important;
    }
    
    .homepage-header .menu-toggle {
        display: block;
        display: block !important;
    }
    
    .header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
        width: 100%;
    }
    
    .site-logo {
        margin-right: 0;
        flex-shrink: 0;
        z-index: 1;
    }
    
    .menu-toggle {
        display: block;
        position: relative;
        z-index: 1001;
        flex-shrink: 0;
        margin-left: auto;
        order: 2;
    }
    
    .homepage-header .get-a-quote-btn {
        margin-top: 20px;
    }
    
    .homepage-header .btn-get-quote {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }

    .header-right-panel {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #1a1a2e;
        background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
        padding: 20px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        flex-direction: column;
        align-items: center;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .header-right-panel.active,
    .header-right-panel.is-active {
        display: flex;
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        overflow: visible;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 0;
    }
    
    .main-navigation ul li a,
    .main-navigation a {
        padding: 10px 0;
        font-size: 18px;
        display: block;
    }

    .header-actions {
        flex-direction: column;
        gap: 15px;
        margin-top: 20px;
        width: 100%;
        text-align: center;
        display: flex;
        align-items: center;
    }
    
    .header-actions .button-primary,
    .header-actions .button-secondary {
        width: auto;
        min-width: 200px;
        text-align: center;
    }
    
    .get-a-quote-btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .site-header {
        z-index: 99999 !important;
    }
    
    .header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        width: 100%;
    }
    
    .site-logo {
        margin-right: 0;
        flex-shrink: 0;
        z-index: 1;
    }
    
    .menu-toggle {
        display: block !important;
        position: relative;
        z-index: 1001;
        flex-shrink: 0;
        margin-left: auto;
        order: 2;
        pointer-events: auto;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
        cursor: pointer;
        min-width: 44px;
        min-height: 44px;
    }
    
    .homepage-header .get-a-quote-btn {
        margin-top: 20px;
    }

    .header-right-panel {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
        flex-direction: column;
        padding: 20px;
        gap: 20px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }

    .header-right-panel.active,
    .header-right-panel.is-active {
        display: flex;
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        overflow: visible;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .main-navigation a {
        font-size: 18px;
        padding: 10px 0;
        display: block;
    }

    .header-actions {
        width: 100%;
        text-align: center;
    }

    .get-a-quote-btn {
        width: 100%;
        max-width: 200px;
    }

    /* Мобильные стили для переключателя языка */
    .language-switcher {
        z-index: 1002;
        position: relative;
    }

    .language-switcher__current {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
    }

    .language-switcher__dropdown {
        z-index: 1003;
        min-width: 120px;
        right: 0;
        left: auto;
    }

    .language-switcher__dropdown li a {
        min-height: 48px;
        padding: 12px 16px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
    }

    .header__language-switcher {
        margin: 0;
    }
}

/* Планшетные стили */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-navigation ul {
        gap: 20px;
    }

    .main-navigation a {
        font-size: 15px;
    }

    .get-a-quote-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

