header {
    background-color: #343a40; /* Dark background */
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.container-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
    max-height: 60px;
}

.search-form {
    display: flex;
    align-items: center;
}

/* Стили для блока с результатами поиска */
.search-results {
    display: none;
    position: absolute;
    background-color: #ffffff;
    border: 1px solid #ddd;
    max-height: 300px;
    overflow-y: auto;
    width: 100%; /* Ширина блока с результатами равна ширине поля поиска */
    z-index: 1000;
    top: 100%; /* Располагаем блок непосредственно под полем поиска */
    left: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, box-shadow 0.3s;
    border-radius: 0 0 5px 5px; /* Закругляем углы снизу */
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Распределение элементов по строке */
    padding: 10px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
    cursor: pointer;
}

.search-result-item img {
    width: 50px;
    height: 50px;
    margin-right: 10px;
    object-fit: cover;
    border-radius: 5px;
}

.search-result-item .product-info {
    flex-grow: 1; /* Заставляет информацию о продукте занимать оставшееся пространство */
    padding-right: 10px;
}

.search-result-item .price-info {
    text-align: right; /* Выравнивание цены и наличия по правому краю */
}

.search-result-item .cart-actions {
    display: flex;
    align-items: center;
}

.cart-actions input[type="number"] {
    width: 60px; /* Устанавливаем фиксированную ширину для поля выбора количества */
    margin-right: 10px;
}

.cart-actions button {
    padding: 5px 10px; /* Небольшие отступы для кнопки */
}

body.dark-theme .search-result-item {
    border-bottom: 1px solid #4c4c4c;
}

.search-result-item:hover {
    background-color: #f1f1f1;
}

body.dark-theme .search-result-item:hover {
    background-color: #4c4c4c;
}

.search-form input[type="text"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
    width: 500px;
}

.search-form button[type="submit"] {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info .avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-info .username {
    font-weight: bold;
}

.user-info a {
    color: black;
    text-decoration: none;
    margin-left: 15px;
}

@media (max-width: 768px) {
    .container-header {
        flex-direction: column;
        text-align: center;
    }

    .search-form {
        margin: 10px 0;
        width: 100%;
    }

    .user-info {
        margin-top: 10px;
    }
}
