/* ============================================================
   LAYOUT WRAPPER (Vertikaler Fluss)
   ============================================================ */
.mf-filter-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* Alle Haupt-Elemente auf volle Breite */
.mf-searchbar, 
.mf-categories-container,
.mf-results-section {
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================
   SUCHFELD (Sichtbarkeits-Boost)
   ============================================================ */
.mf-searchbar {
    background: #f7f1fa;
    padding: 1.5rem;
    border-radius: 16px;
    /* Ein etwas kräftigerer Schatten nach außen */
    box-shadow: 0 6px 16px rgba(170, 143, 178, 0.15); 
    margin-bottom: 2rem;
    position: relative;
}

.mf-searchbar input {
    width: 100%;
    padding: 1.1rem 1rem 1.1rem 3rem;
    border-radius: 12px;
    /* Wir nutzen ein kräftigeres Lila für den Rahmen, damit er sich absetzt */
    border: 2px solid #aa8fb2; 
    background: #ffffff;
    font-size: 1.05rem;
    color: #4a2e57;
    transition: all 0.3s ease;
    /* Der Schatten wird etwas dunkler für mehr Tiefe */
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.1); 
}

/* Die Lupe - etwas dunkler für bessere Sichtbarkeit */
.mf-searchbar::before {
    content: "";
    position: absolute;
    left: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    /* Farbe der Lupe auf dein dunkleres Lila (#4a2e57) angepasst */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a2e57'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    z-index: 10;
    pointer-events: none;
    opacity: 0.8; /* Höhere Deckkraft */
}

/* Fokus-Zustand: Wenn der Nutzer reinklickt, wird der Rahmen noch deutlicher */
.mf-searchbar input:focus {
    outline: none;
    border-color: #4a2e57; /* Dein dunkelstes Lila */
    background: #fff;
    box-shadow: 0 0 0 4px rgba(74, 46, 87, 0.1), inset 0 2px 6px rgba(0,0,0,0.1);
}

/* Placeholder kräftiger */
.mf-searchbar input::placeholder {
    color: #4a2e57;
    opacity: 0.5;
}

/* ============================================================
   KATEGORIE-BOXEN (Optimierte Abstände & UX)
   ============================================================ */
.mf-category-box {
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    /* Mehr "Luft" zwischen den Kategorien */
    margin-bottom: 16px; 
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 6px solid transparent;
    box-shadow: 0 4px 10px rgba(74, 46, 87, 0.08); 
}

/* Hover-Effekt: Die Box reagiert auf den Nutzer */
.mf-category-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 46, 87, 0.12);
}

.mf-category-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
}

/* Der linke Teil (Bild, Titel, Count) */
.mf-category-inner > div:first-child {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Nimmt den restlichen Platz ein */
}

.mf-category-content-left {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

/* Der Count soll ganz nach rechts rücken, aber noch vor dem Pfeil bleiben */
.mf-category-count {
    margin-left: auto; /* Magischer Trick: schiebt den Count nach rechts */
    margin-right: 15px; /* Abstand zum Pfeil */
    font-size: 0.85em;
    opacity: 0.7;
}

/* Level-spezifische Farben & Einrückungen */
.mf-category-box[data-level="0"] { border-left-color: #d3a6e2; }
.mf-category-box[data-level="1"] { background: #fbe7f0; border-left-color: #e38ab5; }
.mf-category-box[data-level="2"] { background: #f7d8e8; border-left-color: #cf6a9f; }

.mf-category-box[data-level="1"] .mf-category-title { padding-left: 20px; }
.mf-category-box[data-level="2"] .mf-category-title { padding-left: 40px; }

/* Status: Aktiv/Pfad */
.mf-category-box.mf-active { 
    background: #d9b4e8 !important; 
    color: white !important; 
}
.mf-category-box.mf-path { 
    border-left-style: double; 
    border-left-width: 8px; 
}

/* Icon-Einstellungen */
.mf-category-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
    margin-right: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Der kleine Pfeil am Ende */
.mf-category-arrow {
    font-size: 1.4rem;
    color: #aa8fb2;
    transition: transform 0.3s ease;
}

/* Wenn die Kachel aktiv ist, wird auch der Pfeil weiß */
.mf-category-box.mf-active .mf-category-arrow {
    color: white;
}

.mf-category-box:hover .mf-category-arrow {
    transform: translateX(5px);
}



/* ============================================================
   ERGEBNIS-GRID (Einheitliche Höhe & Buttons)
   ============================================================ */
.mf-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch; /* Sorgt dafür, dass alle Kacheln in einer Zeile gleich hoch sind */
}

.mf-result-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column; /* Stapelt Inhalt vertikal */
    height: 100%; /* Nutzt die volle verfügbare Höhe */
}

.mf-result-image {
    width: 100%;
    height: 220px; /* Feste Höhe für die Bilder */
    object-fit: cover; /* Schneidet Bilder sauber zu, kein Quetschen */
    border-radius: 12px;
    margin-bottom: 1rem;
    flex-shrink: 0; /* Verhindert, dass das Bild gestaucht wird */
}

.mf-result-title { 
    font-size: 1.25rem; 
    color: #4a2e57; 
    margin-bottom: 0.75rem;
    line-height: 1.3;
	/* Reserviert Platz für 2 Zeilen, damit Texte darunter immer auf gleicher Höhe starten */
    min-height: 2.6em; 
    display: flex;
    align-items: center; /* Zentriert kurze Titel vertikal im reservierten Raum */}

.mf-edd-button {
    background: #d19adf;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    text-align: center;
    text-decoration: none;
    margin-top: auto; /* DER TRICK: Schiebt den Button immer an den unteren Rand */
    transition: background 0.3s ease;
}

.mf-edd-button:hover {
    background: #4a2e57;
    color: white;
}

/* ============================================================
   RESPONSIVE OPTIMIERUNG (Mobil 1-spaltig)
   ============================================================ */
@media (max-width: 850px) {
    .mf-results-grid { 
        grid-template-columns: 1fr; 
        gap: 1.5rem;
    }

    .mf-searchbar {
        padding: 1.2rem 1rem;
    }

    .mf-result-title {
        font-size: 1.15rem;
        min-height: auto; 
    }

    .mf-result-image {
        height: 200px;
    }
}

/* ============================================================
   LOADER (Farblich angepasst)
   ============================================================ */
.mf-loader {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(209, 154, 223, 0.2); /* Hellrosa-Transparent */
    border-top-color: #d19adf; /* Dein Haupt-Pink */
    border-radius: 50%;
    animation: mf-spin 0.8s linear infinite;
    margin: 3rem auto;
}

@keyframes mf-spin { 
    to { transform: rotate(360deg); } 
}

.mf-result-excerpt {
    font-size: 0.95rem;
    color: #666; /* Ein dezentes Grau */
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1; /* Hilft, dass der Button trotzdem unten bleibt */
}

.mf-result-excerpt p {
    margin: 0; /* Verhindert zu große Abstände durch WordPress-Standard-Absätze */
}