/* Страница /brands (BrandsPageAsset). Старые .brands__array/.brands__block в style.css больше не используются. */

.brands-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
    margin: 6px 0 18px;
}

.brands-head__title {
    margin: 0;
    font-size: 2.8rem;
    line-height: 1.2;
    font-weight: 700;
    color: #222;
}

.brands-head__count {
    font-size: 1.4rem;
    color: #777;
}

.brands-tools {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.brands-search {
    width: 100%;
    max-width: 440px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #c3c3c3;
    border-radius: 8px;
    background: #fff;
    font-size: 1.5rem;
    color: #222;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.brands-search:focus {
    border-color: #d71b22;
    box-shadow: 0 0 0 3px rgba(215, 27, 34, .12);
}

.brands-popular {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.brands-popular__label {
    font-size: 1.3rem;
    color: #777;
    margin-right: 2px;
}

.brands-popular__chip {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 1.3rem;
    line-height: 1.2;
    color: #222;
    text-decoration: none;
    background: #fff;
}

.brands-popular__chip:hover {
    border-color: #d71b22;
    color: #d71b22;
}

.brands-letters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.brands-letters__btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #f4f4f4;
    font: inherit;
    font-size: 1.3rem;
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.brands-letters__btn:hover {
    border-color: #d71b22;
    color: #d71b22;
}

.brands-letters__btn.is-active {
    background: #d71b22;
    color: #fff;
}

/* Сетка: рамки ячеек рисует сама карточка, лишняя правая рамка последней колонки обрезается */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid #e3e3e3;
    overflow: hidden;
}

.brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-right: -1px;
    padding: 24px 16px 20px;
    border-right: 1px solid #e3e3e3;
    border-bottom: 1px solid #e3e3e3;
    text-align: center;
    text-decoration: none;
    color: inherit;
    scroll-margin-top: 120px;
}

.brand-card[hidden] {
    display: none;
}

.brand-card:hover .brand-card__name {
    color: #a3141a;
}

.brand-card__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 90px;
    margin-bottom: 6px;
}

.brand-card__logo img {
    display: block;
    max-width: 100%;
    max-height: 90px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Плашка видна, только если картинки нет или она не загрузилась (класс ставит brands.js) */
.brand-card__plaque {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 200px;
    height: 70px;
    padding: 0 10px;
    border-radius: 8px;
    background: #f4f4f4;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.15;
    color: #444;
    word-break: break-word;
}

.brand-card__logo.is-noimg .brand-card__plaque {
    display: flex;
}

.brand-card__logo.is-noimg img {
    display: none;
}

.brand-card__name {
    font-size: 1.5rem;
    line-height: 1.25;
    color: #d71b22;
    border-bottom: 1px solid currentColor;
}

.brand-card__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 1.25rem;
    line-height: 1.3;
    color: #777;
}

.brand-card__country {
    color: #999;
}

.brands-empty {
    margin: 24px 0 0;
    font-size: 1.5rem;
    color: #555;
}

.brands-empty a {
    color: #d71b22;
}

@media screen and (max-width: 999px) {
    .brands-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media screen and (max-width: 767px) {
    .brands-head__title {
        font-size: 2.2rem;
    }

    .brands-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brand-card {
        padding: 18px 10px 16px;
    }

    .brand-card__logo {
        height: 64px;
    }

    .brand-card__logo img {
        max-height: 64px;
    }

    .brand-card__plaque {
        height: 56px;
        font-size: 1.5rem;
    }

    /* Популярные и буквы — по одной прокручиваемой строке, чтобы не занимали полэкрана */
    .brands-popular,
    .brands-letters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .brands-popular::-webkit-scrollbar,
    .brands-letters::-webkit-scrollbar {
        display: none;
    }

    .brands-popular > *,
    .brands-letters__btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}
