/* MC Filter — Horizontal compact layout (Modrinth-style) */
.mcf-sidebar {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 13px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
}

/* Horizontal grid: facets thành cột ngang */
.mcf-horizontal .mcf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 10px;
}
.mcf-horizontal .mcf-facet {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
.mcf-horizontal .mcf-facet-header {
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
}
.mcf-horizontal .mcf-facet-list {
    max-height: none;
    overflow: visible;
}
.mcf-sidebar.mcf-loading { opacity: 0.6; pointer-events: none; transition: opacity .15s; }

.mcf-sidebar-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #f3f4f6;
}
.mcf-sidebar-header strong { font-size: 15px; flex: 0 0 auto; }
.mcf-sidebar-header .mcf-clear-all { margin-left: auto; }
.mcf-clear-all {
    background: none; border: 0; color: #2271b1; cursor: pointer;
    font-size: 12px; text-decoration: underline;
}

/* Selected chips */
.mcf-selected-chips { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.mcf-selected-chips:empty { display: none; }
.mcf-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; background: #dbeafe; color: #1e40af;
    border-radius: 4px; font-size: 12px; font-weight: 500;
}
.mcf-chip-x {
    background: none; border: 0; cursor: pointer; color: #1e40af;
    font-size: 16px; line-height: 1; padding: 0 2px;
}
.mcf-chip-x:hover { color: #dc2626; }

/* Facet group */
.mcf-facet { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #f3f4f6; }
.mcf-facet:last-child { border-bottom: 0; }
.mcf-facet-header { margin-bottom: 6px; }
.mcf-facet-header strong { font-size: 13px; color: #374151; }

.mcf-facet-search {
    width: 100%; padding: 5px 8px; border: 1px solid #d1d5db;
    border-radius: 4px; font-size: 12px; margin-bottom: 6px; box-sizing: border-box;
}
.mcf-facet-search:focus { outline: none; border-color: #2271b1; }

.mcf-facet-list { list-style: none; margin: 0; padding: 0; }
.mcf-facet-list-typeahead { max-height: 240px; overflow-y: auto; }
.mcf-facet-item { padding: 2px 0; line-height: 1.5; }
.mcf-facet-item label {
    display: flex; align-items: center; gap: 6px; cursor: pointer;
    font-size: 13px; color: #374151;
}
.mcf-facet-item label:hover { color: #1f2937; }
.mcf-facet-item input[type="checkbox"] { margin: 0; }
.mcf-term-name { flex: 1; }
.mcf-term-count { font-size: 11px; color: #9ca3af; }
.mcf-facet-item.mcf-disabled label { opacity: 0.4; cursor: not-allowed; }

.mcf-hidden-extra { display: none; }
.mcf-show-more {
    background: none; border: 0; color: #2271b1; cursor: pointer;
    font-size: 12px; padding: 4px 0; text-decoration: underline;
}

.mcf-no-results {
    text-align: center; padding: 40px 20px; color: #6b7280;
    font-style: italic;
}

/* Mobile */
@media (max-width: 768px) {
    .mcf-sidebar { padding: 12px; font-size: 13px; }
    .mcf-facet-list-typeahead { max-height: 180px; }
}

/* Apply Filters button — inline trong header */
.mcf-btn-apply {
    padding: 6px 14px; background: #2271b1; color: #fff;
    border: 0; border-radius: 5px; font-weight: 600; font-size: 12px;
    cursor: pointer; transition: background .15s;
}
.mcf-btn-apply:not(:disabled):hover { background: #135e96; }
.mcf-btn-apply.has-pending { background: #d97706; animation: mcf-pulse 1.4s ease infinite; }
.mcf-btn-apply:disabled { background: #9ca3af; cursor: not-allowed; opacity: 0.7; }
.mcf-pending-count { font-size: 12px; color: #d97706; font-weight: 500; }
@keyframes mcf-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217,119,6,.4); }
    50%      { box-shadow: 0 0 0 6px rgba(217,119,6,0); }
}

/* Show more inline link */
.mcf-show-more-li { padding: 4px 0 0; }
.mcf-show-more {
    background: none; border: 0; color: #2271b1; cursor: pointer;
    font-size: 11px; padding: 0; text-decoration: underline;
}

/* Mobile: stack columns */
@media (max-width: 768px) {
    .mcf-horizontal .mcf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
@media (max-width: 480px) {
    .mcf-horizontal .mcf-grid {
        grid-template-columns: 1fr;
    }
}
