/* SEO-хабы и плитки faceted landings на каталоге */
.catalog-faceted-tiles {
    margin: 0.75rem 0 1.25rem;
}

.catalog-faceted-tiles__grid {
    display: grid;
    /* Шире minmax: длинные названия (E-Class, A-Class…) без обрезки */
    grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
    gap: 0.5rem;
}

.catalog-faceted-tiles__grid--visual {
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.75rem 0.85rem;
    align-items: end;
}

.catalog-faceted-tiles__grid--brands {
    margin-top: 1.5rem;
}

.catalog-faceted-tiles__item--brand {
    min-height: 3rem;
    padding: 0.5rem 0.75rem;
}

.catalog-faceted-tiles__brand-main {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.catalog-faceted-tiles__brand-logo {
    position: relative;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.28);
    overflow: hidden;
}

.catalog-faceted-tiles__brand-logo-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
    box-sizing: border-box;
}

.catalog-faceted-tiles__brand-logo-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
}

.catalog-faceted-tiles__brand-logo-fallback.is-visible {
    display: flex;
}

.catalog-faceted-tiles__item--brand .catalog-faceted-tiles__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-faceted-tiles__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.45rem 0.65rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #ffffff;
    color: #1f2937;
    font-size: 0.8125rem;
    text-decoration: none;
    box-shadow: none;
    transition: border-color 0.15s, background 0.15s;
}

/* Плитки кузова: PNG уже с подписью, светлый фон, без текста */
.catalog-faceted-tiles__item--visual {
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    min-height: 0;
    padding: 0.35rem 0.25rem 0.15rem;
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.catalog-faceted-tiles__item--visual:hover {
    background: transparent;
    border: none;
    color: inherit;
    transform: translateY(-2px);
}

.catalog-faceted-tiles__visual {
    display: block;
    width: 100%;
    max-width: 11.5rem;
    height: auto;
    object-fit: contain;
    background: transparent;
}

/* Счётчик на visual: стили после .catalog-faceted-tiles__count (см. ниже) */

.catalog-faceted-tiles__item:hover {
    border-color: rgba(26, 95, 217, 0.3);
    color: #1a5fd9;
    background: #f5f9ff;
    box-shadow: none;
    transform: none;
}

.catalog-faceted-tiles__item.is-row-hidden {
    display: none !important;
}

.catalog-faceted-tiles__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.catalog-faceted-tiles__label {
    display: -webkit-box;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-weight: 700;
    line-height: 1.25;
    font-size: 0.8125rem;
}

.catalog-faceted-tiles__subtitle {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #7b8498;
    line-height: 1.2;
}

.catalog-faceted-tiles__flags {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 0.75rem;
}

.catalog-faceted-tiles__flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 13px;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
}

.catalog-faceted-tiles__flag img {
    display: block;
    width: 16px;
    height: 11px;
    object-fit: cover;
}

.catalog-faceted-tiles__count {
    flex-shrink: 0;
    align-self: center;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #1a5fd9;
    background: rgba(26, 95, 217, 0.1);
    border: 1px solid rgba(26, 95, 217, 0.14);
}

/* Поверх фото кузова: белый чип с тенью (выше специфичность, чем базовый count) */
.catalog-faceted-tiles__count.catalog-faceted-tiles__count--on-visual {
    position: absolute;
    top: 0.15rem;
    right: 0.1rem;
    z-index: 2;
    align-self: auto;
    min-width: 2.35rem;
    padding: 0.28rem 0.5rem;
    font-family: 'Share Tech Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    letter-spacing: 0.01em;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.16);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9),
        0 2px 10px rgba(15, 23, 42, 0.22);
}

.catalog-faceted-tiles__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.55rem;
    min-height: 2.25rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(26, 95, 217, 0.22);
    background: #f5f9ff;
    color: #1a5fd9;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.catalog-faceted-tiles__toggle:hover {
    background: #eaf2ff;
    border-color: rgba(26, 95, 217, 0.35);
}

.catalog-faceted-tiles__toggle:focus-visible {
    outline: 2px solid rgba(26, 95, 217, 0.45);
    outline-offset: 2px;
}

.catalog-hub-intro--after-results {
    margin: 1.75rem 0 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    max-width: none;
}

.catalog-hub-intro {
    margin: 0.75rem 0 1rem;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 52rem;
}

.catalog-hub-intro h2,
.catalog-hub-intro h3 {
    color: #0f172a;
    margin: 1rem 0 0.5rem;
}

.catalog-hub-intro h2:first-child,
.catalog-hub-intro h3:first-child {
    margin-top: 0;
}

.catalog-hub-intro p {
    margin: 0 0 0.75rem;
}

.catalog-hub-intro__body {
    overflow: hidden;
}

.catalog-hub-intro.is-collapsed .catalog-hub-intro__body {
    max-height: 8.75rem;
    mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}

.catalog-hub-intro__toggle {
    display: inline-flex;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0;
    border: none;
    background: none;
    color: #1a5fd9;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.catalog-hub-intro__toggle:hover {
    text-decoration: underline;
}

.nfs-brands-index-page {
    padding: 1.5rem 0 3rem;
}

.nfs-brands-index__title {
    margin: 0.5rem 0;
    font-size: 1.75rem;
}

.nfs-brands-index__lead {
    color: #a8b8c8;
    margin-bottom: 0.5rem;
}

.nfs-brands-breadcrumb {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.nfs-brands-breadcrumb a {
    color: #64748b;
    text-decoration: none;
}

.nfs-brands-breadcrumb a:hover {
    color: var(--nfs-primary, #1a5fd9);
}

.nfs-brands-breadcrumb .nfs-bc-sep {
    color: #cbd5e1;
}

.nfs-brands-breadcrumb span:last-child {
    color: #0f172a;
    font-weight: 600;
}

.nfs-bc-sep {
    margin: 0 0.35rem;
    opacity: 0.5;
}

@media (max-width: 900px) {
    .catalog-faceted-tiles__grid {
        grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
        gap: 0.45rem;
    }

    .catalog-faceted-tiles__grid--visual {
        grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
        gap: 0.55rem;
    }
}

@media (max-width: 640px) {
    .catalog-faceted-tiles__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }

    /* Visual кузова: горизонтальная карусель */
    .catalog-faceted-tiles__grid--visual {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-end;
        gap: 0.65rem;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        padding: 0.15rem 0.1rem 0.55rem;
        margin: 0 -0.25rem;
        scrollbar-width: thin;
    }

    .catalog-faceted-tiles__grid--visual::-webkit-scrollbar {
        height: 4px;
    }

    .catalog-faceted-tiles__grid--visual::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.55);
        border-radius: 999px;
    }

    .catalog-faceted-tiles__item {
        min-height: 2.85rem;
        padding: 0.45rem 0.5rem;
        gap: 0.35rem;
    }

    .catalog-faceted-tiles__item--visual {
        flex: 0 0 auto;
        width: 7.75rem;
        min-height: 0;
        padding: 0.2rem 0.1rem;
        scroll-snap-align: start;
    }

    .catalog-faceted-tiles__item--visual.is-row-hidden {
        display: flex !important;
    }

    .catalog-faceted-tiles__visual {
        max-width: none;
    }

    .catalog-faceted-tiles__count.catalog-faceted-tiles__count--on-visual {
        font-size: 0.75rem;
        padding: 0.24rem 0.42rem;
    }

    .catalog-faceted-tiles__label {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .catalog-faceted-tiles__toggle {
        width: 100%;
    }

    .catalog-hub-intro--after-results {
        margin-top: 1.25rem;
        padding-top: 1rem;
        font-size: 0.9rem;
    }
}
