/* styles/header.css */

/* Шапка */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 0;
}

.header-top {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

/* Логотип */
.logo {
    flex-shrink: 0;
}

    .logo a {
        display: block;
        height: 40px;
    }

    .logo img {
        width: auto;
        height: 100%;
        object-fit: cover;
    }

/* Строка поиска */
.search-container {
    position: relative;
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-form {
    display: flex;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Inter', sans-serif;
}

    .search-input:focus {
        border-color: #f54900;
    }

.search-button {
    padding: 10px 16px;
    background: #f54900;
    border: none;
    border-radius: 0 8px 8px 0;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .search-button:hover {
        background: #e03e00;
    }

/* Выпадашка подсказок */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
}

.search-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

    .search-suggestion:hover {
        background: #f9f9f9;
    }

    .search-suggestion:last-child {
        border-bottom: none;
    }

.search-suggestion-empty {
    padding: 16px;
    text-align: center;
    color: #999;
}

.suggestion-icon {
    font-size: 16px;
    opacity: 0.6;
}

.suggestion-text {
    font-size: 14px;
    color: #333;
    flex: 1;
}

    .suggestion-text strong {
        color: #f54900;
        font-weight: 600;
    }

/* Навигация */
.header-nav-container {
    position: sticky;
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-bottom:15px;
}

    .header-nav-container a {
        font-size: 15px;
        font-weight: 500;
        color: #333333;
        text-decoration: none;
        transition: color 0.2s;
        white-space: nowrap;
    }

        .header-nav-container a:hover {
            color: #f54900;
        }


.request-button {
    background-color: transparent;
    color: #f54900;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    white-space: nowrap;
}

    .request-button::after {
        content: "→";
        transition: transform 0.2s;
    }

    .request-button:hover::after {
        transform: translateX(4px);
    }

/* Пользовательские действия */
.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

    .user-actions a {
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        transition: all 0.2s ease;
        white-space: nowrap;
    }

    .user-actions .profile {
        color: #333;
        padding: 8px 12px;
        border-radius: 6px;
        background: #f5f5f5;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .user-actions .profile:hover {
            background: #e0e0e0;
            color: #f54900;
        }

    .user-actions .logout {
        color: #666;
        padding: 8px 12px;
        border-radius: 6px;
        background: transparent;
        border: 1px solid #ddd;
        cursor: pointer;
    }

        .user-actions .logout:hover {
            background: #ffebee;
            color: #f44336;
            border-color: #f44336;
        }

    .user-actions .basket {
        color: white;
        padding: 8px 12px;
        border-radius: 6px;
        background: #f54900;
        font-weight: 600;
    }

        .user-actions .basket:hover {
            background: #d43f00;
            color: white;
        }

    .user-actions .login {
        color: #f54900;
        padding: 8px 16px;
        border: 2px solid #f54900;
        border-radius: 6px;
        font-weight: 600;
    }

        .user-actions .login:hover {
            background: #f54900;
            color: white;
        }

    .user-actions .admin-link {
        color: #9c27b0;
        padding: 8px 12px;
        border-radius: 6px;
        background: #f3e5f5;
    }

        .user-actions .admin-link:hover {
            background: #e1bee7;
            color: #7b1fa2;
        }

/* Счётчик корзины */
#cartCount {
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

/* Адаптив */
@media (max-width: 1024px) {
    .header-top {
        flex-wrap: wrap;
        gap: 16px;
    }

    .header-nav-container {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 20px;
        padding-top: 12px;
        border-top: 1px solid #e0e0e0;
    }

    .search-container {
        order: 1;
        max-width: 400px;
        margin: 0;
    }

    .request-button {
        order: 2;
    }

    .user-actions {
        order: 4;
    }
}

@media (max-width: 768px) {
    .header-nav-container {
        display: none;
    }

    .search-container {
        max-width: 100%;
        order: 2;
    }

    .header-top {
        padding: 0 16px;
    }

    .user-actions {
        order: 3;
        width: 100%;
        justify-content: flex-end;
    }

        .user-actions .profile {
            max-width: 120px;
        }
}
