/* Keep the CMS product name intact for links, search and new-product badges. */
.accordion__button.product-table__bean-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem 0.75rem;
    padding-right: 3.5rem;
}

.product-table__growth-type {
    margin-left: auto;
    color: #007f3e;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.5;
    text-transform: none;
}

/* Target the CMS section directly: route data does not always identify Home/Index. */
section.brands {
    padding-top: 2.5rem;
}

section.brands > .container-sm > h2 {
    margin-top: 0 !important;
    margin-bottom: 2rem !important;
    padding: 0 1rem;
}

@media (min-width: 992px) {
    section.brands {
        padding-top: 4rem;
    }

    section.brands > .container-sm > h2 {
        margin-bottom: 3rem !important;
    }

    section.brands > .container-sm > .row {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        /* Equalize every row as well as every card within a row. */
        grid-auto-rows: 1fr;
        align-items: stretch;
    }

    section.brands .brands-card:not(.brands-card--product) {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        margin-bottom: 2rem;
    }

    section.brands .brands-card:not(.brands-card--product) .brands-card__logo {
        flex: 0 0 6.25rem;
        margin-bottom: 2rem;
    }

    section.brands .brands-card:not(.brands-card--product) .brands-card__content {
        display: flex;
        flex-direction: column;
        flex: none;
        height: 30rem;
        min-height: 30rem;
        overflow: hidden;
        background: #18271d;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    }

    section.brands .brands-card:not(.brands-card--product) .brands-card__content::after {
        background: none;
        pointer-events: none;
    }

    section.brands .brands-card:not(.brands-card--product) .brands-card__content > img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    section.brands .brands-card:not(.brands-card--product) .brands-card__content-text {
        position: relative;
        margin-top: auto;
        border-top: 0;
        background-clip: padding-box;
        background-image: linear-gradient(to bottom, transparent, rgba(10, 25, 16, 0.6) 3.5rem, rgba(10, 25, 16, 0.76));
        padding: 4rem 1.5rem 1.5rem;
        text-align: left;
        overflow-wrap: break-word;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    }

    section.brands .brands-card:not(.brands-card--product) .brands-card__content-text p {
        font-size: 1rem !important;
        line-height: 1.6;
        margin: 0;
        min-height: 0;
    }

    /* Keep the link outside the clamped paragraph, with full copy on mobile. */
    section.brands .brands-card:not(.brands-card--product) .brands-card__content-text--summary p {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
        overflow: hidden;
        height: 6.4rem;
    }

    section.brands .brands-card:not(.brands-card--product) .brands-card__content-text a {
        display: block;
        margin-top: 0.75rem;
        font-size: 1rem;
        font-weight: 700;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    section.brands > .container-sm > .row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
