/* ==========================================
   FILTER — горизонтальный фильтр моделей
   ========================================== */

.filter {
    padding: 80px 0 20px;
    position: relative;
}

.filter__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 30px);
}

/* ---- ЗАГОЛОВОК ---- */
.filter__header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 40px;
}

.filter__eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    margin-bottom: 16px;
}

.filter__title {
    font-size: clamp(28px, 3.4vw, 42px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0 0 12px;
}

.filter__subtitle {
    font-size: clamp(15px, 1.2vw, 17px);
    line-height: 1.55;
    color: #475569;
    margin: 0 auto;
    max-width: 560px;
}

/* ---- ФИЛЬТР-ПИЛЮЛЯ (в стиле верхнего меню) ---- */
.filter__nav {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    padding: 6px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    width: fit-content;
    max-width: 100%;
}

/* Magic pill — тёмная «подкладка» под активной кнопкой */
.filter__pill {
    position: absolute;
    top: 50%;
    left: 0;
    height: calc(100% - 12px);
    background: #0f172a;
    border-radius: 999px;
    transform: translateY(-50%);
    transition: transform 0.35s cubic-bezier(0.7, 0, 0.3, 1),
                width 0.35s cubic-bezier(0.7, 0, 0.3, 1);
    z-index: 0;
    pointer-events: none;
    opacity: 0;
}

.filter__nav.is-ready .filter__pill {
    opacity: 1;
}

.filter__list {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 1;
    flex-wrap: nowrap;
}

.filter__item {
    display: flex;
}

.filter__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.filter__link:hover {
    color: #0f172a;
}

.filter__link.is-active {
    color: #ffffff;
}

.filter__label {
    position: relative;
    z-index: 1;
}

.filter__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: #64748b;
    background: rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.filter__link.is-active .filter__count {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.95);
}

.filter__link:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 3px;
}

/* ==========================================
   АДАПТИВ
   ========================================== */

@media (max-width: 768px) {
    .filter {
        padding: 56px 0 16px;
    }

    .filter__header {
        margin-bottom: 28px;
    }

    /* Фильтр — горизонтальный скролл на мобилках */
    .filter__nav {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
        -ms-overflow-style: none;
        border-radius: 20px;
    }

    .filter__nav::-webkit-scrollbar {
        display: none;
    }

    .filter__link {
        padding: 9px 16px;
        font-size: 13px;
    }

    .filter__count {
        min-width: 20px;
        height: 18px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .filter__eyebrow {
        font-size: 11px;
    }
}