.image-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /*margin-bottom: 20px;*/

}

.image-carousel::-webkit-scrollbar {
    display: none;
}

.gallery-image-container {
    flex: 0 0 120px;
    height: 80px;
    width: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #F0EDE5;
    display: flex;!important;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.slick-initialized .slick-slide {
    display: flex;!important;
}

.gallery-image-container:hover {
    cursor: pointer;
}

.gallery-image {
    padding: 5px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/*
 * Раньше разделители были отдельными <div class="brand-separator spN"> между
 * карточками, вручную показанными/скрытыми под конкретное число карточек на
 * конкретных ширинах - при добавлении/удалении бренда (в любом месте списка)
 * цикл sp1..sp7 сдвигался и последние разделители начинали
 * показываться/скрываться неправильно.
 *
 * Сетка теперь на CSS Grid с ФИКСИРОВАННЫМ числом колонок на каждой ширине
 * (3 / 2 / 1) - это даёт предсказуемую позицию каждой карточки в ряду, и
 * через nth-child можно точно погасить разделитель только у последней
 * карточки в ряду (3 в ряд -> 2 разделителя, 2 в ряд -> 1, 1 в ряд ->
 * горизонтальный между карточками). Не зависит от того, сколько всего
 * карточек - только от того, сколько колонок в текущей раскладке.
 */
.brands-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
}

.brand-card {
    position: relative;
    min-width: 0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
    margin-top: 24px;
    /*box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);*/
}

.brand-card::after {
    content: '';
    position: absolute;
    top: 200px; /* middle of the 400px logo box, so it stays put when cards get taller */
    right: -13px;
    transform: translateY(-50%);
    width: 2px;
    height: 24px;
    background-color: #c7a756;
}

/* 3 колонки: разделитель гасим у каждой 3-й (последней в ряду) карточки */
.brand-card:nth-child(3n)::after {
    display: none;
}

.brand-logo-container {
    background-color: rgba(199, 167, 86, 0.1);
    padding: 24px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    min-height: 400px;
    max-height: 400px;
}

.brand-logo {
    max-width: 100%;
    height: auto;
}

.brand-info {
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.brand-category {
    display: flex;
    color: #c7a756;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.24px;
}

.brand-name {
    text-align: left;
    color: #141414;
    font-family: 'Libre Bodoni', serif;
    font-weight: 400;
    font-size: 23px;
    letter-spacing: -0.23px;
    margin-top: 16px;
}

.brand-description {
    text-align: left;
    color: #494949;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 16px;
    flex: 1 0 auto;
}







.product-images {
    /*display: none;*/
    gap: 8px;
    margin-top: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.product-images::-webkit-scrollbar {
    display: none;
}

.product-image {
    width: 68px;
    height: 68px;
    border-radius: 8px;
    object-fit: cover;
}

.view-toggle {
    left: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: #c7a756;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.32px;
    margin-top: 16px;
    cursor: pointer;
}

.toggle-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.expanded .toggle-icon {
    transform: rotate(180deg);
}

.expanded .brand-description {
    -webkit-line-clamp: unset;
}

.expanded .product-images {
    display: flex;
}

@media (max-width: 1397px) {
    .brands-container {
        max-width: 90%;
        grid-template-columns: repeat(2, 1fr);
    }

    /* 2 колонки: 3-й в ряду больше нет - показываем разделитель у всех,
       кроме последней (чётной) карточки в ряду */
    .brand-card:nth-child(3n)::after {
        display: block;
    }

    .brand-card:nth-child(2n)::after {
        display: none;
    }
}

@media (max-width: 987px) {
    .brands-container {
        max-width: 90%;
        grid-template-columns: 1fr;
    }

    /* 1 колонка: разделитель есть у каждой карточки (кроме последней ниже)
       и становится горизонтальным */
    .brand-card:nth-child(2n)::after {
        display: block;
    }

    .brand-card::after {
        top: auto;
        right: auto;
        bottom: -13px;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 2px;
    }
}

/* Ни при какой раскладке у самой последней карточки нет "следующей" -
   гасим её разделитель последним, чтобы он всегда побеждал по каскаду. */
.brand-card:last-child::after {
    display: none;
}

.divider-bottom {
    background-color: #c7a756;
    align-self: end;
    margin-top: 48px;
    width: 182px;
    height: 1px;
    border: 1px solid #c7a756;
    margin-left: calc(100% - 182px);
}

@media (max-width: 991px) {
    .divider-bottom {
        margin-top: 40px;
    }

    .brand-card {
        margin-bottom: 12px;
        margin-top: 12px;
    }
}

@media (max-width: 467px) {
    .gallery-image-container {
        height: 68px;
        width: 68px;
    }
}
.brand-wordmark {
    color: #c7a756;
    font: 500 34px/1.2 'Libre Bodoni', serif;
    text-align: center;
    letter-spacing: -0.3px;
}

/* 3 columns: centre the incomplete last row (8 cards = 3 + 3 + 2) */
@media (min-width: 1398px) {
    .brands-container {
        grid-template-columns: repeat(6, 1fr);
    }

    .brands-container > .brand-card {
        grid-column: span 2;
    }

    .brands-container > .brand-card:nth-child(3n + 1):last-child,
    .brands-container > .brand-card:nth-last-child(2):nth-child(3n + 1) {
        grid-column: 2 / span 2;
    }

    .brands-container > .brand-card:nth-child(3n + 2):last-child {
        grid-column: 4 / span 2;
    }
}
