/* ── Панель фильтров ─────────────────────────────────────────────────────── */

.mm-filter-bar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 28px;
}

.mm-filter-bar__total {
    margin-left: auto;
    font-size: 14px;
    color: #999;
    white-space: nowrap;
}

/* ── Группы фильтров ─────────────────────────────────────────────────────── */

.mm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mm-filter-group--sort {
    margin-left: auto;
}

.mm-filter-group__label {
    font-size: 12px;
    color: #bbb;
    letter-spacing: .03em;
    text-transform: uppercase;
    line-height: 1;
}

.mm-filter-group__items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── Кнопки дропдаунов ───────────────────────────────────────────────────── */

.mm-filter-dropdown__btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    white-space: nowrap;
}

.mm-filter-dropdown__btn:hover {
    border-color: #bbb;
}

.mm-filter-dropdown__btn.mm-has-active {
    border-color: var(--red, #e53935);
    color: var(--red, #e53935);
    background: #fff5f5;
}

.mm-filter-dropdown__btn .mm-active-count {
    display: inline-block;
    background: var(--red, #e53935);
    color: #fff;
    border-radius: 10px;
    padding: 0 6px;
    font-size: 11px;
    margin-left: 5px;
    line-height: 18px;
    vertical-align: middle;
}

/* ── Меню дропдауна ──────────────────────────────────────────────────────── */

.mm-filter-dropdown__menu {
    min-width: 230px;
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
    border: 1px solid #eee;
}

/* ── Чекбокс-строка ──────────────────────────────────────────────────────── */

.mm-filter-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background .1s;
    margin: 0;
}

.mm-filter-check:hover {
    background: #f8f9fa;
}

.mm-filter-check input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--red, #e53935);
}

.mm-filter-count {
    margin-left: auto;
    color: #bbb;
    font-size: 12px;
}

/* ── Сортировка ──────────────────────────────────────────────────────────── */

.mm-sort-select {
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 32px 6px 14px;
    font-size: 14px;
    color: #333;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23333' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
}

.mm-sort-select:hover,
.mm-sort-select:focus {
    border-color: #bbb;
}

/* ── Чипсы активных фильтров ─────────────────────────────────────────────── */

.mm-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.mm-filter-chips:empty {
    display: none;
}

.mm-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff5f5;
    border: 1px solid var(--red, #e53935);
    border-radius: 20px;
    padding: 3px 6px 3px 12px;
    font-size: 13px;
    color: var(--red, #e53935);
}

.mm-filter-chip__remove {
    background: none;
    border: none;
    color: var(--red, #e53935);
    cursor: pointer;
    padding: 0 2px;
    font-size: 16px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity .15s;
}

.mm-filter-chip__remove:hover {
    opacity: 1;
}

/* ── Сброс фильтров ──────────────────────────────────────────────────────── */

.mm-filter-reset {
    background: none;
    border: none;
    padding: 0 4px;
    font-size: 13px;
    color: #bbb;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
    transition: color .15s;
}

.mm-filter-reset:hover {
    color: var(--red, #e53935);
}

.mm-filter-divider {
    width: 1px;
    height: 22px;
    background: #e0e0e0;
    flex-shrink: 0;
}

/* ── Активные фильтры (бейджи) ───────────────────────────────────────────── */

.mm-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.mm-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff5f5;
    color: var(--red, #e53935);
    border: 1px solid var(--red, #e53935);
    border-radius: 20px;
    padding: 4px 10px 4px 12px;
    font-size: 13px;
}

.mm-active-filter__remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.mm-active-filter__remove:hover {
    opacity: .7;
}

.mm-active-filters__reset {
    background: none;
    border: none;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.mm-active-filters__reset:hover {
    color: var(--red, #e53935);
}

/* ── «Показать ещё» ──────────────────────────────────────────────────────── */

.mm-filter-more-wrap {
    text-align: center;
    margin-top: 32px;
}

/* ── Перелинковка ────────────────────────────────────────────────────────── */

.mm-related-terms {
    border-top: 1px solid #eee;
    padding-top: 28px;
    margin-top: 40px;
}

.mm-related-terms__label {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.mm-related-terms__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mm-related-terms__link {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}

.mm-related-terms__link:hover {
    border-color: var(--red, #e53935);
    color: var(--red, #e53935);
}

/* ── Мобильные ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .mm-filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .mm-filter-group--sort {
        margin-left: 0;
    }

    .mm-filter-dropdown__btn {
        padding: 5px 12px;
        font-size: 13px;
    }

    .mm-sort-select {
        padding: 5px 28px 5px 12px;
        font-size: 13px;
    }

    .mm-filter-bar__total {
        width: 100%;
        margin-left: 0;
    }
}
