/* Mega Menu Wrapper */
.cxm-mega-menu-wrapper {
    position: relative;
    width: 100%;
}

/* Hauptnavigation */
.cxm-mega-menu {
    position: relative;
}

.mega-menu-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Level 1 Menüpunkte */
.mega-menu-nav > .menu-item {
    position: relative;
    margin: 0;
    padding: 0;
}

.mega-menu-nav > .menu-item > a {
    display: block;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
}

/* Mega Menu Panel */
.mega-menu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    min-width: 100%;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 0;
    margin: 0;
}

/* Mega Menu Container */
.mega-menu-container {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 1rem;
    list-style: none;
    width: 100%;
}

/* Mega Menu Spalten */
.mega-menu-column {
    padding: 0 1rem;
    box-sizing: border-box;
}

.mega-menu-columns-1 .mega-menu-column {
    width: 100%;
}

.mega-menu-columns-2 .mega-menu-column {
    width: 50%;
}

.mega-menu-columns-3 .mega-menu-column {
    width: 33.333%;
}

.mega-menu-columns-4 .mega-menu-column {
    width: 25%;
}

.mega-menu-columns-5 .mega-menu-column {
    width: 20%;
}

.mega-menu-columns-6 .mega-menu-column {
    width: 16.666%;
}

/* Level 2 Menüpunkte */
.menu-item-level-2 {
    margin-bottom: 1rem;
}

.menu-item-level-2 > a {
    display: block;
    padding: 0.5rem 0;
    text-decoration: none;
    color: inherit;
    font-weight: bold;
}

.menu-item-level-2-heading > a {
    color: inherit;
    cursor: default;
    pointer-events: none;
}

/* Level 3 Menüpunkte */
.menu-item-level-3 {
    margin: 0.25rem 0;
}

.menu-item-level-3 > a {
    display: block;
    padding: 0.25rem 0;
    text-decoration: none;
    color: inherit;
}

/* Shortcode Container */
.mega-menu-shortcode {
    margin: 1rem 0;
}

/* Hover und Focus States */
.menu-item-level-1-has-mega:hover > .mega-menu-panel,
.menu-item-level-1-has-mega:focus-within > .mega-menu-panel {
    display: block;
}

/* Mobile Toggle Button */
.cxm-mega-menu-toggle {
    display: none;
    position: relative;
    width: 30px;
    height: 30px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1000;
}

.cxm-mega-menu-toggle-icon,
.cxm-mega-menu-toggle-icon::before,
.cxm-mega-menu-toggle-icon::after {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transition: transform 0.3s ease;
}

.cxm-mega-menu-toggle-icon {
    top: 50%;
    transform: translateY(-50%);
}

.cxm-mega-menu-toggle-icon::before,
.cxm-mega-menu-toggle-icon::after {
    content: '';
    left: 0;
}

.cxm-mega-menu-toggle-icon::before {
    top: -8px;
}

.cxm-mega-menu-toggle-icon::after {
    bottom: -8px;
}

.cxm-mega-menu-toggle[aria-expanded="true"] .cxm-mega-menu-toggle-icon {
    background-color: transparent;
}

.cxm-mega-menu-toggle[aria-expanded="true"] .cxm-mega-menu-toggle-icon::before {
    transform: translateY(8px) rotate(45deg);
}

.cxm-mega-menu-toggle[aria-expanded="true"] .cxm-mega-menu-toggle-icon::after {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Overlay */
.cxm-mega-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

/* Responsive Design */
@media screen and (max-width: 992px) {
    .cxm-mega-menu-toggle {
        display: block;
    }

    .cxm-mega-menu {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background-color: #fff;
        overflow-y: auto;
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .cxm-mega-menu.active {
        transform: translateX(280px);
    }

    .mega-menu-nav {
        flex-direction: column;
        padding: 1rem;
    }

    .mega-menu-nav > .menu-item {
        width: 100%;
    }

    .mega-menu-panel {
        position: static;
        display: none;
        box-shadow: none;
        background-color: transparent;
        width: 100% !important;
    }

    .mega-menu-container {
        flex-direction: column;
        padding: 0;
    }

    .mega-menu-column {
        width: 100% !important;
        padding: 0;
    }

    .menu-item-level-2 > a {
        padding: 0.5rem 0;
    }

    .menu-item-level-3 > a {
        padding: 0.25rem 1rem;
    }

    .mega-menu-shortcode {
        margin: 0.5rem 0;
    }

    /* Mobile Overlay */
    .cxm-mega-menu-overlay.active {
        display: block;
    }
}

/* Screen Reader Text */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Fehlermeldung */
.cxm-mega-menu-error {
    padding: 1rem;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
} 