/* Современный дизайн шапки */

.header-modern {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Верхняя часть шапки */
.header-top-modern {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid #e9ecef;
    padding: 0.5rem 0;
}

.header-top-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-top-left {
    flex-shrink: 0;
}

.header-logo-modern img {
    max-height: 52px;
    width: auto;
    height: auto;
}

.header-top-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: flex-end;
    margin-left: 1rem;
    min-width: 0;
}

/* Поиск */
.header-search-modern {
    flex: 1;
    max-width: none;
    min-width: 0;
    position: relative;
}

/* Переопределяем стили из main.css */
.header-search-modern .search-input-wrapper {
    border: none !important;
    outline: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.header-search-modern .search-input-wrapper:focus-within {
    border: none !important;
    outline: none !important;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.25) !important;
}

.header-search-modern .search-input-modern {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: none !important;
    border-radius: 25px;
    padding: 0.25rem 0.4rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    outline: none !important;
}

.search-input-wrapper:focus-within {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.25);
    border: none !important;
    outline: none !important;
}

.search-input-modern {
    flex: 1;
    border: none !important;
    outline: none !important;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    color: #495057;
    background: transparent;
    box-shadow: none !important;
}

.search-input-modern::placeholder {
    color: #adb5bd;
    font-size: 0.8rem;
}

.search-button-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: auto;
}

.search-button-modern:hover {
    background: linear-gradient(135deg, #e55a2b 0%, #e0841c 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.35);
}

.search-button-modern i {
    font-size: 0.85rem;
}

.search-button-modern span {
    display: none;
}

@media (min-width: 1200px) {
    .search-button-modern span {
        display: inline;
    }
}

/* Автозаполнение поиска */
.search-autocomplete {
    position: absolute;
    top: calc(100% + 0.15rem);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    border: 1px solid #e9ecef;
    margin-top: 0.15rem;
}

.autocomplete-item {
    display: block;
    padding: 0.875rem 1.25rem;
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #fff5f0;
    color: #ff6b35;
    padding-left: 1.5rem;
}

.autocomplete-title {
    display: block;
    font-weight: 500;
    color: inherit;
}

.header-search-modern {
    position: relative;
}

/* Действия пользователя */
.header-actions-modern {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.header-action-item {
    position: relative;
    flex-shrink: 0;
}

.action-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    font-weight: 500;
    position: relative;
}

.action-link:hover {
    background: #fff5f0;
    color: #ff6b35;
}

.login-link {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #ffffff !important;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.25);
}

.login-link:hover {
    background: linear-gradient(135deg, #e55a2b 0%, #e0841c 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.35);
}

.login-link i {
    color: #ffffff;
}

.action-link i {
    font-size: 0.95rem;
}

.action-label {
    white-space: nowrap;
}

.action-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b35;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

/* Выпадающее меню аккаунта */
.dropdown-modern {
    position: relative;
}

.dropdown-modern:hover .dropdown-menu-modern {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu-modern {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown-menu-modern a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.dropdown-menu-modern a:hover {
    background: #fff5f0;
    color: #ff6b35;
    padding-left: 1.5rem;
}

.dropdown-menu-modern a i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0.5rem 0;
}

/* Нижняя часть шапки с меню */
.header-bottom-modern {
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    padding: 0.75rem 0;
}

.header-bottom-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-logo-mobile img {
    max-height: 50px;
    width: auto;
}

/* Главное меню */
.main-menu-modern {
    flex: 1;
}

.menu-list-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-item-modern {
    position: relative;
}

.menu-link-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.menu-link-modern:hover {
    color: #ff6b35;
    background: #fff5f0;
}

.submenu-icon {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.menu-item-modern:hover .submenu-icon {
    transform: rotate(180deg);
}

/* Подменю */
.submenu-modern {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    padding: 0.75rem 0;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.menu-item-modern:hover .submenu-modern {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu-modern li {
    margin: 0;
}

.submenu-modern a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
}

.submenu-modern a:hover {
    background: #fff5f0;
    color: #ff6b35;
    padding-left: 2rem;
}

/* Мобильное меню */
.mobile-menu-toggle {
    cursor: pointer;
    padding: 0.5rem;
}

.burger-icon-modern {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
}

.burger-icon-modern span {
    display: block;
    height: 3px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85%;
    height: 100%;
    background: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: #ffffff;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.mobile-menu-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mobile-menu-nav {
    padding: 1rem 0;
}

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

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

.mobile-menu-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.mobile-menu-link:hover {
    background: #fff5f0;
    color: #ff6b35;
}

.mobile-submenu-toggle {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.mobile-menu-item.active .mobile-submenu-toggle {
    transform: rotate(180deg);
}

.mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu-item.active .mobile-submenu {
    max-height: 1000px;
}

.mobile-submenu li {
    border-bottom: 1px solid #e9ecef;
}

.mobile-submenu a {
    display: block;
    padding: 0.75rem 1.5rem 0.75rem 3rem;
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-submenu a:hover {
    background: #ffffff;
    color: #ff6b35;
}

/* Мобильные действия */
.header-actions-mobile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-action-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #495057;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-action-icon:hover {
    background: #fff5f0;
    color: #ff6b35;
}

.mobile-action-icon i {
    font-size: 1.25rem;
}

.mobile-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff6b35;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Адаптивность */
/* На средних экранах — только иконки в верхнем меню, подписи скрыты (экономия места) */
@media (max-width: 1400px) {
    .header-top-modern .action-label {
        display: none;
    }
    .header-top-modern .action-link {
        padding: 0.4rem 0.5rem;
    }
    .header-top-modern .action-link i:first-of-type {
        margin: 0;
    }
}

@media (min-width: 1401px) {
    .header-top-modern .action-label {
        display: inline;
    }
}

@media (max-width: 1199px) {
    .header-search-modern {
        max-width: 400px;
    }
    
    .menu-link-modern {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 991px) {
    .header-top-modern {
        padding: 0.75rem 0;
    }
    
    .header-top-content {
        flex-wrap: wrap;
    }
    
    .header-search-modern {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    
    .header-actions-modern {
        order: 2;
    }
}


