/* ===== FLORA MODERN HEADER v1.0.0 ===== */
/* Дата: 09.07.2025 */
/* Современный дизайн header'а для Завода ФЛОРА */

/* === Базовые стили header === */
.site-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Фиксированный header при скролле */
.site-header.is-sticky {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
}

/* === Контейнер header === */
.site-header .col-full {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    position: relative;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* === Логотип и брендинг === */
.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    flex: 0 0 auto;
}

.site-logo-anchor {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.site-logo-anchor:hover {
    transform: scale(1.05);
}

.custom-logo {
    height: 45px !important;
    width: auto !important;
    object-fit: contain;
}

.site-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 1px solid #e0e0e0;
    padding-left: 15px;
}

.site-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #2e7d32;
    line-height: 1.2;
}

.site-title a {
    text-decoration: none;
    color: #2e7d32;
}

.site-description {
    margin: 0;
    font-size: 11px;
    color: #666;
    font-weight: 400;
    line-height: 1.3;
    max-width: 220px;
}

/* === Главная навигация === */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 40px;
    position: relative;
}

.main-navigation::before,
.main-navigation::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 30px;
    background: #e0e0e0;
}

.main-navigation::before {
    left: -20px;
}

.main-navigation::after {
    right: -20px;
}

.main-navigation ul {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
    justify-content: space-evenly;
    max-width: 700px;
}

.main-navigation > ul > li {
    position: relative;
    flex: 1;
    text-align: center;
}

.main-navigation > ul > li > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.main-navigation > ul > li {
    position: relative;
}

.main-navigation > ul > li > a {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    color: #333;
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Эффект при наведении */
.main-navigation > ul > li > a:hover {
    background: #f5f5f5;
    color: #2e7d32;
}

/* Активная страница */
.main-navigation > ul > li.current-menu-item > a,
.main-navigation > ul > li.current_page_item > a {
    background: #8BC34A;
    color: white;
    font-weight: 600;
}

/* Выпадающее меню */
.main-navigation ul ul {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    min-width: 200px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-top: 10px;
    padding: 8px 0;
    border: 1px solid #f0f0f0;
}

.main-navigation li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.main-navigation ul ul li {
    display: block;
}

.main-navigation ul ul a {
    display: block;
    padding: 10px 20px;
    color: #333;
    font-size: 14px;
    transition: all 0.2s ease;
}

.main-navigation ul ul a:hover {
    background: #f5f5f5;
    color: #2e7d32;
    padding-left: 25px;
}

/* === Правая часть header === */
.header-tools {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

/* === Быстрые ссылки в header === */
.header-quick-links {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.header-quick-links a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 500;
    position: relative;
}

.header-quick-links a:hover {
    background: #f5f5f5;
    color: #2e7d32;
}

.header-quick-links a::before {
    font-size: 16px;
}

.header-quick-links a:first-child::before {
    content: '🌿';
}

/* Специальный стиль для акций */
.header-quick-links a.promo-link {
    color: #ff5722;
    font-weight: 600;
}

.header-quick-links a.promo-link::before {
    content: '🔥';
}

/* Разделитель между ссылками */
.header-quick-links a:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 16px;
    background: #e0e0e0;
}

/* === Поиск в header === */
.site-search {
    position: relative;
    display: flex;
    align-items: center;
}

.site-search form {
    position: relative;
    display: flex;
    align-items: center;
}

.site-search button {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    font-size: 20px;
    line-height: 1;
}

.site-search button:hover {
    color: #8BC34A;
    transform: scale(1.1);
}

/* Скрываем текст для читалок экрана */
.screen-reader-text {
    position: absolute;
    left: -9999px;
}

.site-search input[type="search"] {
    position: absolute;
    right: 40px;
    width: 0;
    padding: 0;
    border: none;
    background: transparent;
    transition: all 0.3s ease;
    font-size: 14px;
}

.site-search.expanded input[type="search"] {
    width: 180px;
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
}

.site-search input[type="search"]:focus {
    outline: none;
    border-color: #8BC34A;
    background: white;
}

/* === Корзина в header === */
.site-header-cart {
    position: relative;
}

.site-header-cart a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #8BC34A;
    color: white;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 195, 74, 0.3);
    font-size: 14px;
    white-space: nowrap;
}

.site-header-cart a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 195, 74, 0.4);
    background: #7cb342;
}

.cart-contents .amount {
    font-weight: 600;
    font-size: 15px;
}

.site-header-cart .count {
    background: white;
    color: #2e7d32;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}

/* === Статистика в header - СКРЫТА === */
.flora-header-stats {
    display: none !important; /* Полностью скрываем статистику */
}

/* === Мобильная адаптация === */
@media (max-width: 768px) {
    .site-header .col-full {
        flex-wrap: wrap;
        padding: 10px 15px;
        gap: 10px;
    }
    
    .site-branding {
        flex: 1 1 100%;
        justify-content: center;
        text-align: center;
    }
    
    .site-info {
        display: none; /* Скрываем текст на мобильных */
    }
    
    .custom-logo {
        height: 40px !important;
    }
    
    .main-navigation {
        display: none; /* Будет заменено мобильным меню */
    }
    
    .header-tools {
        flex: 1 1 100%;
        justify-content: space-between;
        order: 2;
    }
    
    .header-quick-links {
        display: none; /* Скрываем быстрые ссылки на мобильных */
    }
    
    .site-search.expanded input[type="search"] {
        width: 150px;
    }
    
    .site-header-cart a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .cart-contents .amount {
        font-size: 14px;
    }
    
    /* Мобильная кнопка меню */
    .handheld-navigation {
        display: none; /* Используем кнопку из flora-mobile-menu.php */
    }
    
    /* Мобильное выпадающее меню */
    .main-navigation.toggled {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        z-index: 999;
    }
    
    .main-navigation.toggled ul {
        flex-direction: column;
        padding: 10px;
    }
    
    .main-navigation.toggled li {
        width: 100%;
        text-align: left;
    }
    
    .main-navigation.toggled a {
        display: block;
        padding: 10px 15px;
    }
}

/* === Кнопка мобильного меню - скрыта на десктопе === */
.menu-toggle {
    display: none;
}

/* === Анимации === */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-header {
    animation: slideInDown 0.5s ease;
}

/* Анимация появления элементов */
.site-branding,
.main-navigation,
.header-tools {
    animation: fadeIn 0.6s ease backwards;
}

.site-branding {
    animation-delay: 0.1s;
}

.main-navigation {
    animation-delay: 0.2s;
}

.header-tools {
    animation-delay: 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Специальные эффекты === */
/* Индикатор загрузки при поиске */
.site-search.loading button::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #8BC34A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Сброс стилей Storefront === */
.site-header .col-full::before,
.site-header .col-full::after {
    display: none;
}

.site-header {
    margin-bottom: 0;
}

/* Убираем дефолтные стили навигации Storefront */
.storefront-primary-navigation {
    display: none;
}

.main-navigation ul li a {
    display: inline-flex !important;
}

/* === Z-index иерархия === */
.site-header {
    z-index: 1000;
}

.main-navigation ul ul {
    z-index: 1001;
}

.site-search.expanded {
    z-index: 1002;
}

.site-search input[type="search"] {
    position: relative;
    z-index: 1;
}

/* Финальная полировка */
* {
    box-sizing: border-box;
}

.site-header * {
    box-sizing: border-box;
}

/* === Дополнительные стили для полировки === */
/* Убираем стандартные отступы WooCommerce */
.woocommerce .site-header-cart {
    margin: 0;
}

.woocommerce .site-header-cart .cart-contents {
    padding: 10px 18px;
}

/* Фикс для поискового поля */
.site-search input[type="search"]:focus {
    outline: none;
    border-color: #8BC34A;
    background: white;
}

/* Убираем лишние границы и тени от Storefront */
.site-header .widget {
    margin: 0;
}

.site-header a {
    box-shadow: none !important;
}

/* Пульсация для счетчика корзины при добавлении товара */
.site-header-cart .count.pulse {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Responsive font sizes */
@media (max-width: 1200px) {
    .main-navigation > ul > li > a {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .site-title {
        font-size: 18px;
    }
    
    .site-description {
        font-size: 10px;
    }
}

/* === Дополнительные улучшения для Flora === */
/* Быстрые ссылки в header */
.header-quick-links {
    display: flex;
    gap: 15px;
    margin-right: 10px;
}

.header-quick-links a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-quick-links a:hover {
    color: #8BC34A;
}

.header-quick-links a::before {
    content: '🌿';
    font-size: 14px;
}

/* Специальный стиль для акций */
.header-quick-links a.promo-link {
    color: #ff6b6b;
    font-weight: 600;
}

.header-quick-links a.promo-link::before {
    content: '🔥';
    font-size: 14px;
}