@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

body {
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    color: #505050;
}

.body-container {
    font-family: "Inter", sans-serif;
    max-width: 1300px;
    padding: 20px;
 }

.brand-container { 
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 колонки */
    gap: 15px; /* Отступ между блоками */
}

.brand-block {
    background: #fff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

.brand-letter {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #505050;
}

.brand-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.brand-block li::before {
    content: '• '; /* Точка перед брендом */
    color:  rgb(57, 180, 232); /* Синий цвет точки */
}

.brand-block li {
    font-size: 16px;
    margin: 5px 0;
}


h3 {
    color: #505050; 
}
/* Полный список брендов */
.full-brand-list {
    margin-top: 40px;
}

/* Карточка бренда */
.brand-details {
    display: flex; /* Размещаем логотип и текст в строку */
    align-items: stretch; /* Растягиваем элементы по высоте */
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    min-height: 150px; /* Минимальная высота блока */
    transition: background 0.3s ease, box-shadow 0.3s ease; /* Плавный переход */
    cursor: default;
}

/* Эффект при наведении */
.brand-details:hover {
    background: #f6f6f6; /* Светлый оттенок */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); /* Увеличенная тень */
    cursor: pointer; /* Курсор как у ссылки */
    color: inherit; /* Наследуем цвет текста */
}

.brand-details:hover .brand-name,
.brand-details:hover .country,
.brand-details:hover div {
    color: inherit; /* Оставляем цвет текста без изменений */
}

/* Логотип бренда */
.brand-logo {
    width: 300px; /* Фиксированная ширина */
    height: auto; /* Автоматическая высота */
    object-fit: contain; /* Сохранение пропорций */
    margin-right: 20px; /* Отступ справа */
}

/* Блок заголовка и логотипа */
.brand-header {
    display: flex;
    align-items: center;
    gap: 20px; /* Отступ между логотипом и текстом */
}

.brand-header .brand-logo {
    width: 350px; /* Размер логотипа */
    height: auto;
    object-fit: contain;
}

.brand-header h1 {
    margin: 0;
    font-size: 24px;
}



/* Текстовая информация */
.brand-text {
    display: flex;
    flex-direction: column; /* Размещаем блоки в столбец */
    flex: 1; /* Растягиваем текстовый блок на всю доступную ширину */
}

/* Каждый текстовый блок (строка) */
.brand-text div {
    flex: 1; /* Растягиваем блоки равномерно */
    display: flex;
    align-items: center; /* Выравниваем текст по центру по вертикали */
    justify-content: flex-start; /* Выравниваем текст по левому краю */
    padding: 5px;
    margin-bottom: 5px;
}

/* Название бренда */
.brand-name {
    font-weight: bold;
    font-size: 18px;
}

/* Цвет для страны */
.country {
    color: rgb(57, 180, 232);
}

/* Стили для ссылок */
a {
    color: #707070; /* Серый цвет */
    text-decoration: none; /* Убираем подчеркивание */
    transition: color 0.3s ease;
}

a:hover {
    color: rgb(57, 180, 232); /* Голубой цвет при наведении */
    text-decoration: none; /* Убираем подчеркивание */
}


/*стили для управления кнопкой перемещения вверх начало*/
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: max(calc((100% - 1450px) / 2 + 20px), 20px); /* Ограничение по ширине контейнера */
    width: 50px;
    height: 50px;
    background-color: rgb(57, 180, 232);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    font-size: 24px;
    cursor: pointer;
    display: none; /* Изначально скрыта */
    transition: opacity 0.3s, transform 0.3s;
}

.scroll-to-top:hover {
    background-color: rgb(115, 198, 234);
}

.scroll-to-top.show {
    display: block;
    opacity: 1;
    transform: scale(1);
}
/*стили для управления кнопкой перемещения вверх конец*/

/* Стили для страницы карточки бренда */
.brand-card {
    font-family: "Inter", sans-serif;
    max-width: 1100px;
    margin: 40px auto;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.brand-card img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.brand-card h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.brand-card p {
    font-size: 16px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 10px;
}

.brand-card a {
    color: rgb(57, 180, 232); /* Голубой цвет */
    text-decoration: none; /* Убираем подчеркивание */
    transition: color 0.3s ease;
}

.brand-card a:hover {
    color: rgb(111, 212, 255); /* Светлее при наведении */
}

.back-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: rgb(57, 180, 232);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.3s;
}

.back-button:hover {
    background: rgb(115, 198, 234);
    color: white;
}



.brand-link {
    color: inherit; /* Наследуем цвет родителя */
    text-decoration: none;
}

.brand-link:hover {
    color: inherit; /* Оставляем цвет без изменений */
}

.brand-link:hover .brand-details,
.brand-link:hover .brand-name,
.brand-link:hover .country,
.brand-link:hover div {
    color: inherit !important; /* Принудительно сохраняем цвет */
}

@media (max-width: 768px) {
    .brand-container {
        grid-template-columns: repeat(2, 1fr); /* 2 колонки вместо 4 */
    }

    .brand-details {
        flex-direction: column; /* Логотип и текст теперь сверху друг над другом */
        align-items: center;
        text-align: center;
    }

    .brand-logo {
        margin-right: 0; /* Убираем отступ справа */
        margin-bottom: 10px; /* Добавляем отступ снизу */
        width: 150px; /* Уменьшаем размер логотипа */
    }

    .brand-info {
        text-align: center; /* Центрируем название и страну */
    }

    .brand-info h1 {
        font-size: 20px; /* Немного уменьшаем заголовок */
        margin-bottom: 5px;
    }

    .brand-info .country {
        display: block; /* Страна теперь на новой строке */
        font-size: 16px;
    }
}

/* Мобильная версия brandcard*/
@media (max-width: 768px) {
    .brand-header {
        flex-direction: column; /* Элементы теперь идут в столбец */
        align-items: center; /* Центрируем */
        text-align: center;
    }

    .brand-logo {
        margin-right: 0; /* Убираем боковой отступ */
        margin-bottom: 10px; /* Отступ снизу */
        width: 200px; /* Уменьшаем размер логотипа */
        height: auto;
    }

    .brand-info {
        text-align: center;
    }

    .brand-info h1 {
        font-size: 22px; /* Чуть меньше заголовок */
        margin-bottom: 5px;
    }

    .brand-info .country {
        font-size: 18px;
        display: block;
    }

    .search-form input[type="text"] {
        width: 100%;
        padding-right: 15px; /* Добавляем отступ справа */
        box-sizing: border-box; /* Чтобы padding не влиял на ширину */
    }

}

/* Контейнер для поиска и заголовка */
.search-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Форма поиска */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form input[type="text"] {
    padding: 8px;
    font-size: 14px;
    width: 200px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.search-form button {
    padding: 8px 15px;
    font-size: 14px;
    background-color: rgb(57, 180, 232);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.search-form button:hover {
    background-color: rgb(115, 198, 234);
}

.reset-button {
    padding: 8px 15px;
    font-size: 14px;
    background-color: #999;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-left: 10px;
}

.reset-button:hover {
    background-color: #777;
}

/* Блок брендов */
.brand-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 колонки */
    gap: 15px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-form {
        width: 100%;
        flex-direction: column;
    }

    .search-form input[type="text"], .search-form button {
        width: 100%;
    }

    .brand-container {
        grid-template-columns: repeat(2, 1fr); /* 2 колонки на мобильных */
    }
}

/* Секция брендов */
.brand-section {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.brand-section:last-child {
    border-bottom: none;
}

.brand-section h2 {
    color: #505050;
    font-size: 28px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgb(57, 180, 232);
}

/* Двухколоночный вывод товаров */
.products-grid-two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.products-grid-two-columns::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #e0e0e0;
    transform: translateX(-50%);
}

.products-grid-two-columns .product:nth-child(odd) {
    padding-right: 20px;
}

.products-grid-two-columns .product:nth-child(even) {
    padding-left: 20px;
}

/* Уменьшение отступов для карточек товаров */
.products-grid-two-columns .product {
    padding: 10px;
    gap: 10px;
    display: flex;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    width: 100%;
}

.products-grid-two-columns .product-blok-0 {
    padding: 0 10px;
    margin-right: 10px;
    flex-shrink: 0;
    width: auto;
    max-width: 200px;
}

.products-grid-two-columns .product-blok-2 {
    margin-left: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

@media (max-width: 768px) {
    .products-grid-two-columns {
        grid-template-columns: 1fr;
    }
    
    .products-grid-two-columns::before {
        display: none;
    }
    
    .products-grid-two-columns .product:nth-child(odd),
    .products-grid-two-columns .product:nth-child(even) {
        padding-left: 0;
        padding-right: 0;
        border-right: none;
    }
}
