﻿/* ==========================================================================
   Shop By Brand
   Grid: 5-up desktop / 3-up tablet / 2-up mobile
   Brand tiles: grayscale by default, full color + red border on hover/focus
   ========================================================================== */

/* Hero */

.brand-hero {
    width: 100%;
    padding-bottom: 80px;
}

.brand-hero__inner {
    display: flex;
    align-items: stretch;
    background: #3a3a3a;
    overflow: hidden;
    min-height: 160px;
}

.brand-hero__text {
    flex: 1 1 25%;
    display: flex;
    align-items: center;
    padding: 32px clamp(20px, 4vw, 48px);
}

    .brand-hero__text h1 {
        margin: 0;
        color: #ffffff;
        letter-spacing: 0.01em;
        font-family: Helvetica;
        font-size: 32px;
        font-style: normal;
        font-weight: 700;
        line-height: 120%; /* 45.6px */
    }

.brand-hero__image {
    flex: 1 1;
    min-height: 160px;
}

    .brand-hero__image img {
        width: 100%;
        height: 100%;
        display: block;
    }

@media (max-width: 599px) {

    .brand-hero__text {
        padding: 24px 20px;
    }

    .brand-hero__image {
        min-height: 120px;
    }

    .brand-hero {
        padding-bottom: 44px;
    }

    .brand-hero__text h1 {
        font-size: 20px;
    }
}

/* Brand grid */

.brand-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* desktop: 5 per row */
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0 0 64px;
    width: 100%;
}

.brand-card {
    min-width: 0;
}

.brand-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.brand-card__frame {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 89px;
    width: 100%;
    padding: 20px;
    background: #f7f7f7;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    box-sizing: border-box;
    overflow: hidden;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.brand-card__logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    filter: grayscale(100%);
    opacity: 0.85;
    transition: filter 180ms ease, opacity 180ms ease;
}

.brand-card__label {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 2.6em;
    font-size: 17px;
    font-weight: 700;
    color: #262626;
    font-family: Helvetica;
    font-style: normal;
    line-height: 120%; /* 20.4px */
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    justify-content: start;
}

    .brand-card__label svg {
        flex-shrink: 0;
    }

.brand-card__arrow {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    transition: transform 180ms ease;
}

.brand-card__link:hover .brand-card__frame,
.brand-card__link:focus-visible .brand-card__frame {
    border-color: #d81f26;
    box-shadow: 0 0 0 1px #d81f26;
}

.brand-card__link:hover .brand-card__logo,
.brand-card__link:focus-visible .brand-card__logo {
    filter: grayscale(0%);
    opacity: 1;
}

.brand-card__link:hover .brand-card__label,
.brand-card__link:focus-visible .brand-card__label {
    color: #d81f26;
}

.brand-card__link:hover .brand-card__arrow,
.brand-card__link:focus-visible .brand-card__arrow {
    transform: translateX(3px);
}

.brand-card__link:focus-visible {
    outline: none;
}

    .brand-card__link:focus-visible .brand-card__frame {
        outline: 2px solid #d81f26;
        outline-offset: 2px;
    }

@media (prefers-reduced-motion: reduce) {
    .brand-card__frame,
    .brand-card__logo,
    .brand-card__arrow {
        transition: none;
    }
}

/* Responsive: 5 desktop / 3 tablet / 2 mobile */

@media (max-width: 1023px) {
    .brand-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 599px) {
    .brand-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .brand-card__frame {
        padding: 16px;
    }

    .brand-card__label {
        font-size: 13px;
        margin-top: 8px;
    }
}
