.nexus-brand-header {
    box-sizing: border-box;
    width: min(100%, 1200px);
    margin-inline: auto;
    text-align: center;
}

.nexus-brand-header__visual {
    display: flex;
    min-height: 120px;
    align-items: center;
    justify-content: center;
    margin: 28px 0 32px;
}

.nexus-brand-header__logo {
    width: auto;
    max-width: min(360px, 80vw);
    max-height: 120px;
    object-fit: contain;
}

.nexus-brand-header__eyebrow {
    display: block;
    margin: 0 0 12px;
    color: #ff6d01;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nexus-brand-header__title {
    margin: 0;
    color: #171b19;
    font-family: Comfortaa, sans-serif;
    font-size: clamp(34px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.15;
}

.nexus-brand-header__description {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    color: #4a514e;
    font-size: 17px;
    line-height: 1.75;
}

.nexus-brand-header__description > :first-child {
    margin-top: 0;
}

.nexus-brand-header__description > :last-child {
    margin-bottom: 0;
}

.nexus-brand-directory {
    width: min(100%, 1200px);
    margin-inline: auto;
}

.nexus-brand-directory__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nexus-brand-card {
    min-width: 0;
    margin: 0;
    list-style: none;
}

.nexus-brand-card__link {
    display: flex;
    min-height: 205px;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 30px 24px 22px;
    border: 1px solid #e1e6e3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(18, 32, 26, 0.05);
    color: #171b19;
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nexus-brand-card__link:hover,
.nexus-brand-card__link:focus-visible {
    border-color: #ff6d01;
    box-shadow: 0 14px 36px rgba(18, 32, 26, 0.1);
    color: #171b19;
    transform: translateY(-4px);
}

.nexus-brand-card__link:focus-visible {
    outline: 3px solid rgba(255, 109, 1, 0.25);
    outline-offset: 3px;
}

.nexus-brand-card__visual {
    display: flex;
    width: 100%;
    min-height: 105px;
    align-items: center;
    justify-content: center;
}

.nexus-brand-card__logo {
    width: auto;
    max-width: 100%;
    max-height: 95px;
    object-fit: contain;
}

.nexus-brand-card__fallback {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    border-radius: 50%;
    background: #f2f4f3;
    color: #ff6d01;
    font-family: Comfortaa, sans-serif;
    font-size: 34px;
    font-weight: 700;
}

.nexus-brand-card__name {
    font-family: Comfortaa, sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.nexus-brand-directory__empty {
    text-align: center;
}

.nexus-subcategory-directory {
    width: min(100%, 1200px);
    margin-inline: auto;
}

.nexus-subcategory-directory__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nexus-subcategory-card {
    grid-column: span 2;
    min-width: 0;
    margin: 0;
    list-style: none;
}

.nexus-subcategory-directory__grid--last-two .nexus-subcategory-card:nth-last-child(2) {
    grid-column: 2 / span 2;
}

.nexus-subcategory-directory__grid--last-two .nexus-subcategory-card:last-child {
    grid-column: 4 / span 2;
}

.nexus-subcategory-directory__grid--last-one .nexus-subcategory-card:last-child {
    grid-column: 3 / span 2;
}

.nexus-subcategory-card__link {
    display: flex;
    width: 100%;
    aspect-ratio: 1;
    box-sizing: border-box;
    flex-direction: column;
    gap: 18px;
    padding: 18px 18px 22px;
    border: 1px solid #e1e6e3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(18, 32, 26, 0.05);
    color: #171b19;
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nexus-subcategory-card__link:hover,
.nexus-subcategory-card__link:focus-visible {
    border-color: #ff6d01;
    box-shadow: 0 14px 36px rgba(18, 32, 26, 0.1);
    color: #171b19;
    transform: translateY(-4px);
}

.nexus-subcategory-card__link:focus-visible {
    outline: 3px solid rgba(255, 109, 1, 0.25);
    outline-offset: 3px;
}

.nexus-subcategory-card__visual {
    display: flex;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    background: #f2f4f3;
}

.nexus-subcategory-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

.nexus-subcategory-card__link:hover .nexus-subcategory-card__image,
.nexus-subcategory-card__link:focus-visible .nexus-subcategory-card__image {
    transform: scale(1.035);
}

.nexus-subcategory-card__fallback {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: #ff6d01;
    font-family: Comfortaa, sans-serif;
    font-size: 34px;
    font-weight: 700;
}

.nexus-subcategory-card__name {
    flex: 0 0 auto;
    font-family: Comfortaa, sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

@media (max-width: 1024px) {
    .nexus-brand-directory__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nexus-subcategory-directory__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .nexus-subcategory-card,
    .nexus-subcategory-directory__grid--last-two .nexus-subcategory-card:nth-last-child(2),
    .nexus-subcategory-directory__grid--last-two .nexus-subcategory-card:last-child,
    .nexus-subcategory-directory__grid--last-one .nexus-subcategory-card:last-child {
        grid-column: auto;
    }
}

@media (max-width: 767px) {
    .nexus-brand-header__description {
        font-size: 16px;
    }

    .nexus-brand-directory__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .nexus-brand-card__link {
        min-height: 170px;
        padding: 22px 15px 17px;
    }

    .nexus-brand-card__visual {
        min-height: 82px;
    }

    .nexus-brand-card__logo {
        max-height: 74px;
    }

    .nexus-brand-card__name {
        font-size: 14px;
    }

    .nexus-subcategory-directory__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .nexus-subcategory-card__link {
        gap: 14px;
        padding: 14px 14px 18px;
    }

    .nexus-subcategory-card__name {
        font-size: 16px;
    }
}

@media (max-width: 420px) {
    .nexus-brand-directory__grid {
        grid-template-columns: 1fr;
    }
}
