/* ============================================================
   brands.css — сетка логотипов брендов на странице услуги.

   Палитра наследует фирменные цвета сайта (1bitovoy-service):
     • тёмно-синий #1b3a5c (cta-banner, urgent-block__note)
     • сланцевый текст #2a3440
     • кремовая поверхность #f9f9f5
     • рамка #efeee7 (как .good__conv, .advantages__item)
     • тень при hover rgba(27,58,92,.08)

   Карточка: лёгкая рамка, hover поднимает с тенью (паттерн как у advantages).
   Логотип 200×200, object-fit: contain — не искажается.
   Placeholder для брендов без файла — серый блок с названием.

   Mobile-first. BEM. Без зависимостей.
   ============================================================ */

.brands{
    --brands-bg:           #ffffff;
    --brands-bg-soft:      #f9f9f5;
    --brands-ink:          #2a3440;
    --brands-text:         #343d43;
    --brands-muted:        #5a6a72;
    --brands-rule:         #efeee7;
    --brands-rule-strong:  #d9d6c8;
    --brands-brand:        #1b3a5c;
    --brands-brand-soft:   rgba(27,58,92,.08);
    --brands-radius:       12px;

    margin: 24px 0;
}

/* Сетка: mobile-first 3 колонки, дальше расширение */
.brands__grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (min-width: 600px){
    .brands__grid{
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
}

@media (min-width: 992px){
    .brands__grid{
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1200px){
    .brands__grid{
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Карточка бренда */
.brands__item{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px 8px;
    background: var(--brands-bg);
    border: 1px solid var(--brands-rule);
    border-radius: var(--brands-radius);
    text-decoration: none;
    color: var(--brands-text);
    transition:
        transform .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

.brands__item:hover,
.brands__item:focus-visible{
    outline: none;
    text-decoration: none;
}

@media (hover: hover){
    .brands__item:hover{
        border-color: var(--brands-brand);
        box-shadow: 0 6px 20px var(--brands-brand-soft);
        transform: translateY(-2px);
    }
}

.brands__item:focus-visible{
    outline: 2px solid var(--brands-brand);
    outline-offset: 2px;
}

/* Логотип — фиксированная горизонтальная область, contain чтобы не искажалось */
.brands__logo{
    width: 100%;
    height: 56px;
    max-width: 140px;
    object-fit: contain;
    display: block;
}

/* Placeholder для брендов без файла логотипа */
.brands__logo--placeholder{
    width: 100%;
    height: 56px;
    max-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 8px;
    background: var(--brands-bg-soft);
    border-radius: 8px;
    color: var(--brands-brand);
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.15;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Подпись под логотипом */
.brands__name{
    font-size: 13px;
    font-weight: 600;
    color: var(--brands-ink);
    text-align: center;
    line-height: 1.2;
    margin-top: 2px;
}

/* Отключаем глобальный a::after на карточках брендов */
.brands .brands__item::after{
    display: none !important;
    content: none !important;
}

/* Мобильные уточнения */
@media (max-width: 600px){
    .brands__item{
        padding: 12px 8px 10px;
        gap: 6px;
    }
    .brands__logo,
    .brands__logo--placeholder{
        height: 44px;
        max-width: 100px;
    }
    .brands__logo--placeholder{
        font-size: 13px;
        padding: 8px;
    }
    .brands__name{
        font-size: 12px;
    }
}
