/**
 * СТИЛИ ШАПКИ С УЛУЧШЕННОЙ СТРУКТУРОЙ
 */

/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
    --header-bg: #FFFFFF;
    --header-text: #000000;
    --accent: #2F6BFF;
    --border-light: #E5E5E5;
    --header-height: 120px; /* Увеличена высота для двух строк */
    --header-height-mobile: 80px;
}

/* ===== ОСНОВНАЯ ШАПКА ===== */
.site-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--header-bg);
    color: var(--header-text);
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-container {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ===== ВЕРХНЯЯ СТРОКА (ЛОГОТИП + МЕНЮ + ИКОНКИ) ===== */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    width: 100%;
}

/* Логотип */
.site-branding {
    flex-shrink: 0;
    margin-right: 40px;
}

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

.site-title {
    font-family: 'Archivo', sans-serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--header-text);
    text-decoration: none;
    text-transform: uppercase;
}

/* Навигация */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

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

.main-menu a {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--header-text);
    text-decoration: none;
    padding: 8px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.main-menu a:hover {
    color: var(--accent);
}

.main-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.main-menu > li > a:hover::after {
    width: 100%;
}

/* Иконки в верхней строке */
.header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.header-icon {
    background: none;
    border: none;
    padding: 8px;
    color: var(--header-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    position: relative;
}

.header-icon:hover {
    opacity: 0.6;
}

/* Индикатор количества (для сравнения и корзины) */
.header-icon .count-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(25%, -25%);
}

/* ===== НИЖНЯЯ СТРОКА (ТЕЛЕФОН + КНОПКА) ===== */
.header-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 50px;
    width: 100%;
    border-top: 1px solid var(--border-light);
    gap: 30px;
}

/* Телефон */
.header-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--header-text);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.header-phone:hover {
    opacity: 0.6;
}

.header-phone svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent);
}

/* Кнопка заказа звонка */
.order-call-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 3px;
}

.order-call-btn:hover {
    background: var(--accent);
    color: white;
}

/* Поиск (отдельная строка, появляется по клику) */
.header-search-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(255,255,255,0.98);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.search-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: #000;
    font-size: 40px;
    cursor: pointer;
}

.search-container {
    width: 80%;
    max-width: 800px;
}

.search-container .search-form {
    display: flex;
    border-bottom: 2px solid var(--accent);
}

.search-container .search-form input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 32px;
    padding: 20px 0;
    outline: none;
    font-family: 'Archivo', sans-serif;
}

.search-container .search-form button {
    background: none;
    border: none;
    padding: 0 20px;
    cursor: pointer;
}

/* ===== МЕГА-МЕНЮ (оставляем как есть) ===== */
.mega-menu-trigger {
    position: static;
}

.mega-menu-panel {
    position: absolute;
    left: 0;
    top: var(--header-height);
    width: 100%;
    background-color: #FFFFFF;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.mega-menu-trigger:hover .mega-menu-panel {
    opacity: 1;
    visibility: visible;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 992px) {
    .header-top {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
    }
    
    .main-navigation {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }
    
    .header-bottom {
        display: none; /* Скрываем на планшетах, показываем в мобильном меню */
    }
}

@media (max-width: 768px) {
    .site-header {
        height: var(--header-height-mobile);
    }
    
    .header-top {
        height: 100%;
    }
    
    .main-navigation {
        position: fixed;
        top: var(--header-height-mobile);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height-mobile));
        background: white;
        padding: 40px 20px;
        transform: translateX(100%);
        transition: 0.3s;
        overflow-y: auto;
    }
    
    .main-navigation.active {
        transform: translateX(0);
    }
    
    .main-menu {
        flex-direction: column;
        gap: 0;
    }
    
    .main-menu > li {
        border-bottom: 1px solid var(--border-light);
    }
    
    .main-menu > li > a {
        padding: 15px 0;
        font-size: 16px;
    }
    
    .header-bottom {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 0;
        border-top: none;
        gap: 15px;
    }
    
    .hamburger-toggle {
        display: flex;
    }
}
/* ========== НОВАЯ ДВУХСТРОЧНАЯ СТРУКТУРА ШАПКИ ========== */
/* Эти стили ДОПОЛНЯЮТ старые, а не заменяют их */

.header-container {
    flex-direction: column;
    padding: 0 40px;
    height: 100%;
}

/* Верхняя строка */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 70px;
}

/* Нижняя строка */
.header-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 50px;
    border-top: 1px solid var(--border-light, #E5E5E5);
    gap: 30px;
}

/* Стили для телефона */
.header-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--header-text, #000000);
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.header-phone:hover {
    opacity: 0.6;
}
.header-phone svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent, #2F6BFF);
}

/* Кнопка заказа звонка */
.order-call-btn {
    background: transparent;
    border: 1px solid var(--accent, #2F6BFF);
    color: var(--accent, #2F6BFF);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 3px;
}
.order-call-btn:hover {
    background: var(--accent, #2F6BFF);
    color: white;
}

/* Бейдж для счетчиков (корзина/сравнение) */
.header-icon .count-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent, #2F6BFF);
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(25%, -25%);
}

/* Полноэкранный поиск (убедимся, что он работает) */
.header-search-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(255,255,255,0.98);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.header-search-fullscreen.active {
    opacity: 1;
    visibility: visible;
}
.search-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: #000;
    font-size: 40px;
    cursor: pointer;
}
.search-container {
    width: 80%;
    max-width: 800px;
}
.search-container .search-form {
    display: flex;
    border-bottom: 2px solid var(--accent, #2F6BFF);
}
.search-container .search-form input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 32px;
    padding: 20px 0;
    outline: none;
    font-family: 'Archivo', sans-serif;
}

/* ========== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ========== */
@media (max-width: 768px) {
    .header-container {
        padding: 0 20px;
    }
    .header-top {
        height: 100%;
    }
    .header-bottom {
        display: none; /* Скрываем нижнюю строку на мобильных */
    }
    /* В мобильном меню показываем телефон и кнопку */
    .main-navigation.active .header-bottom {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 0;
        border-top: 1px solid var(--border-light);
        gap: 15px;
        height: auto;
    }
}