/* =================================================
   HEADER
   ================================================= */

/* Делаем шапку липкой */
.site-header {
    position: -webkit-sticky; /* Для поддержки Safari */
    position: sticky;
    top: 0;
    z-index: 9999; /* Чтобы шапка перекрывала весь контент при прокрутке */
    background-color: #ffffff; /* Обязательно задайте фон, иначе контент будет просвечивать */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* Легкая тень при прокрутке (по желанию) */
}

.inside-navigation {
    display: flex;
    align-items: center;
}

.header-search-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-search-center form {
    max-width: 550px;
    width: 100%;
}

.header-search-form {
    display: flex;
    width: 100%;
    max-width: 700px;
}

.header-search-form .search-field {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 15px;
}

.header-search-form .search-submit {
    padding: 8px 18px;
    border-radius: 0 4px 4px 0;
    background-color: #ff5a00;
    border: 1px solid #ff5a00;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.header-search-form .search-submit:hover {
    background-color: #ff5a00;
    border-color: #ff5a00;
}

.main-navigation .menu > li > a {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon svg {
    width: 24px;
    height: 24px;
    color: #7a7a7a;
    transition: 0.2s ease;
    display: block;
}


.menu-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.main-navigation .menu > li > a:hover svg {
    color: #ff5a00;
    transform: scale(1.05);
}

span.cart-count {
    padding: 2px;
    position: absolute;
  	top: 7px;
    right: -1px;
    background: #ff5a00;
    color: #fff;
    font-size: 12px;
    min-width: 18px;
    height: 18px;
    border-radius: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* =================================================
   МОБИЛЬНЫЙ HEADER
   ================================================= */

@media (max-width: 768px) {

    .mobile-menu-control-wrapper,
    .menu-toggle {
        display: none !important;
    }

    /* Главный контейнер шапки */
    .inside-header {
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        padding: 10px 15px 5px 15px !important;
        box-sizing: border-box !important;
    }

    /* 1-я строка: Блок с логотипом (прижимаем влево и делаем отступ справа под кнопки) */
    .site-branding {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        order: 1 !important;
        padding-right: 130px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }

    /* Контейнер логотипа темы GeneratePress */
    .inside-header .site-logo {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .inside-header .site-logo a {
        display: inline-block !important;
        line-height: 0 !important;
    }

    /* Жесткие размеры картинки логотипа, чтобы исключить центрирование и гигантские размеры */
    .inside-header .site-logo img.header-image.is-logo-image,
    .site-branding img, 
    .site-logo img, 
    .header-image {
        width: 130px !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        display: block !important;
        object-fit: contain !important;
    }

    /* Навигация и кнопки (Корзина / Меню / Профиль) в правой части */
    span.cart-count {
      	right: -9px;
  	}
  
    #site-navigation {
        display: flex !important;
        position: absolute !important;
        right: 15px !important;
        top: 10px !important;
        height: 45px !important;
        align-items: center !important;
        order: 1 !important;
        z-index: 10 !important;
    }

    #site-navigation .menu {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 2-я строка: Блок поиска с плавной анимацией скрытия */
    .header-search-center {
        order: 2 !important;
        width: 100% !important;
        margin-top: 10px !important;
        padding-bottom: 5px !important;
        max-height: 100px;
        opacity: 1;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease, margin 0.3s ease;
    }

    /* Скрытие поиска при прокрутке */
    .site-header.is-scrolled .header-search-center {
        max-height: 0 !important;
        opacity: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        pointer-events: none;
    }

    .main-navigation .main-nav ul li a {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .menu-item-has-children .dropdown-menu-toggle {
        padding-right: 0px !important;
    }
}