/* Category Drill-Down Modal */
.cat-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.cat-modal.active { display: flex; justify-content: center; align-items: flex-start; }

.cat-modal-dialog {
    background: #fff;
    width: 100%;
    max-width: 600px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    overflow: hidden;
    position: relative; /* Für absolute Positionierung des Close-Buttons */
}

@media (min-width: 768px) {
    /* Modal etwas nach oben versetzt (nicht mehr exakt mittig) */
    .cat-modal.active {
        align-items: flex-start;
        padding-top: 10vh; /* 10% vom oberen Rand */
    }

    .cat-modal-dialog {
        height: 80vh;
        max-height: 700px;
        border-radius: 8px;
        /* Kein margin-top hier nötig, da padding-top im Container */
    }
}

.cat-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 20;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #333;
    background: rgba(255,255,255,0.8); /* Damit man ihn über Text sieht */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-modal-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding-top: 10px; /* Etwas Abstand oben */
}

/* Liste */
.cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cat-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    font-size: 1rem;
}

.cat-item:hover { background-color: #f9f9f9; color: var(--mz-one); }

/* Aktive Kategorie (wenn Leaf-Node ausgewählt) */
.cat-item.cat-active {
    font-weight: 700;
    color: var(--mz-one);
    background-color: #f0f0f0;
}

.cat-item-arrow { color: #ccc; font-size: 0.9rem; }

/* Back Item Style */
.cat-back-item {
    background-color: #f8f9fa;
    color: #666;
    font-size: 0.95rem;
    border-bottom: 1px solid #eee;
    justify-content: flex-start;
}
.cat-back-item:hover {
    background-color: #e9ecef;
    color: #333;
}
.cat-back-item .cat-item-arrow {
    margin-right: 10px;
    font-size: 1.2rem;
    line-height: 1;
    color: #999;
}

/* Loading Spinner */
.cat-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    color: #999;
}

/* Animation Classes */
.slide-in-right { animation: slideInRight 0.2s ease-out; }
.slide-in-left { animation: slideInLeft 0.2s ease-out; }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Wrapper to remove padding from generic modal content */
.cat-modal-content-wrapper {
    margin: -20px;
}