/* Verstecke das alte Enfold-Overlay komplett - noch aggressiver */
.avia_mega_div,
.avia_mega_menu,
.avia-menu-overlay,
.av-main-nav-wrap .avia_mega_div,
.av-main-nav-wrap .avia_mega_menu,
.av-main-nav-wrap .avia-menu-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    z-index: -1 !important;
    pointer-events: none !important;
}

.av-main-nav .menu-item-has-children:hover > .sub-menu,
.av-main-nav .menu-item-has-children:focus-within > .sub-menu,
.av-main-nav .sub-menu {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Verstecke ALLE nativen Dropdown-Elemente aggressiver */
.av-main-nav .sub-menu,
.av-main-nav .dropdown_available,
.av-main-nav .avia-menu-fx,
.av-main-nav .avia-arrow,
.av-main-nav .menu-item-has-children .sub-menu {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Basis-Overlay-Styling mit Scroll-Funktionalität */
.mega-menu-overlay {
    position: fixed;
    top: 193px;
    right: 0;
    width: 1250px;
    background: #ffffff;
    z-index: 9999;
    padding: 30px 0;
    border-radius: 0px 0px 0px 20px;
    pointer-events: auto;
    max-height: calc(100vh - 193px - 20px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar-Styling für bessere Optik */
.mega-menu-overlay::-webkit-scrollbar {
    width: 8px;
}

.mega-menu-overlay::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.mega-menu-overlay::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.mega-menu-overlay::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Firefox Scrollbar */
.mega-menu-overlay {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Fokus-Styling für Accessibility */
.mega-menu-overlay a:focus-visible,
.menu-item.level-0 a:focus-visible {
    outline: 2px solid #9CA91D;
    outline-offset: 2px;
    background-color: rgba(156, 169, 29, 0.1);
}

/* Aktive/Hover-Zustand für Menüpunkt während Overlay sichtbar ist */
.menu-item.level-0.mega-menu-active > a,
.menu-item.level-0.mega-menu-active > a:hover {
    color: #9CA91D !important;
}

/* Entferne Fokus-Outline bei Maus-Klicks */
a:focus:not(:focus-visible) {
    outline: none;
    background: none;
}

/* Level-2 Hover-Zustand - Standard */
.level-2-item a:hover {
    color: #9CA91D !important;
    background-color: rgba(156, 169, 29, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Level-2 aktiver Zustand (wenn Level-3 Menü offen ist) */
.level-2-item.level-2-active > a {
    color: #9CA91D !important;
    background-color: rgba(156, 169, 29, 0.1) !important;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 600;
}

/* Level-2 Item mit geöffnetem Level-3 Menü */
.level-2-item:has(.level-3-menu.is-visible) > a {
    color: #9CA91D !important;
    background-color: rgba(156, 169, 29, 0.1) !important;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 600;
}

/* Fallback für Browser ohne :has() Support */
.level-2-item.has-open-submenu > a {
    color: #9CA91D !important;
    background-color: rgba(156, 169, 29, 0.1) !important;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 600;
}

/* Plus-Toggle Anpassung für aktive Level-2 Items */
.level-2-item.level-2-active .plus-toggle,
.level-2-item.has-open-submenu .plus-toggle {
    background: #9ca91d !important;
    color: white !important;
    transform: rotate(45deg);
}

/* Falls Ihr Theme spezifische Hover-Klassen verwendet, diese auch berücksichtigen */
.menu-item.level-0.mega-menu-active > a .avia-menu-text {
    color: #9CA91D !important;
}

.overlay-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.level-1-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 0fr));
    gap: 30px;
    padding-bottom: 20px;
}

/* Karten-ähnliches Design für Level-1 */
.level-1-item {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    padding: 0;
}

.level-1-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.level-1-clickable {
    display: block;
    text-decoration: none;
    color: inherit;
}

.level-1-clickable .level-1-title {
    transition: transform 0.18s ease, color 0.18s ease;
    transform-origin: center;
}

.level-1-item .level-1-clickable:hover .level-1-title {
    color: #9CA91D;
}

.level-1-item.is-active .level-1-clickable:hover .level-1-title,
.level-1-item .level-1-clickable:hover .level-1-title {
    transform: scale(1.04);
}

/* Wenn man in der Level-2-Liste dieser Kachel ist: Farbe, aber keine Skalierung */
.level-1-item.list-hover .level-1-title {
    color: #9CA91D;
    transform: none;
}

/* Skalierung nur, wenn man wirklich über Bild+Titel hovert */
.level-1-item .level-1-clickable:hover .level-1-title {
    transform: scale(1.04);
}

/* Beim Hover über den gesamten Kartencontainer nicht skalieren, um „Zittern" zu vermeiden */
.level-1-item:hover .level-1-title {
    transform: none;
}

.level-1-item.is-active:hover .level-1-title {
    transform: none;
}

.level-1-image {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
}

.level-1-title {
    font-size: 1.2em;
    padding: 15px;
    text-align: center;
    color: #222;
    background: #fafafa;
    margin: 0;
}

.level-2-list {
    list-style: none;
    padding: 15px;
    margin: 0;
    background: #ffffff;
    max-height: none;
}

.level-2-item {
    /* margin-bottom: 8px; */
}

.level-2-item a {
    color: #555;
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.2s;
}

.level-2-item a:hover {
    color: #9CA91D;
}

/* Plus-Toggle für Level-3 Menüs - Animiertes Plus Icon */
.plus-toggle {
    float: right;
    cursor: pointer;
    font-weight: bold;
    color: #9ca91d;
    user-select: none;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    border-radius: 50%;
    background: rgba(156, 169, 29, 0.1);
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.plus-toggle:hover {
    background: #9ca91d;
    color: white;
    transform: scale(1.1);
    animation: pulse 0.6s ease-in-out;
}

/* Animation für das Plus wenn es zu Minus wird */
.level-2-item:has(.level-3-menu.is-visible) .plus-toggle {
    transform: rotate(45deg);
    background: #9ca91d;
    color: white;
}

/* Pulse-Animation beim Hover für extra Effekt */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(156, 169, 29, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 5px rgba(156, 169, 29, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(156, 169, 29, 0);
    }
}

.level-3-menu {
    margin-left: 20px;
    border-left: 2px solid #9CA91D;
    padding-left: 15px;
    margin-top: 10px;
}

.level-3-menu li {
    margin-bottom: 5px;
}

.level-3-menu a {
    color: #777;
    font-size: 0.9em;
}

/* Eindeutiger Anfangszustand für das Level-3-Menü */
.level-1-grid .level-3-menu {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-in-out;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 5px;
}

/* Zustand, wenn das Menü sichtbar sein soll */
.level-1-grid .level-3-menu.is-visible {
    max-height: 800px !important;
    opacity: 1 !important;
    visibility: visible !important;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Optional: Stil für die Links im aufgeklappten Menü */
.level-1-grid .level-3-menu li a {
    padding: 5px 10px;
    display: block;
    color: #333;
}

.level-1-grid .level-3-menu li a:hover {
    background-color: #f0f0f0;
}

/* === MOBILE NAVIGATION === */

/* Haupt Mobile Toggle Button (Level 0) */
.mobile-toggle {
    display: inline-block !important;
    position: absolute !important;
    right: 35px !important;
    top: 12px !important;  /* GEÄNDERT: Feste Position statt 50% */
    transform: none !important;  /* GEÄNDERT: Transform entfernt */
    width: 30px !important;
    height: 30px !important;
    background: #9ca91d !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    z-index: 999999 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    font-size: 16px !important;
    line-height: 30px !important;
    text-align: center !important;
}

.mobile-toggle:hover {
    background: #7a8517 !important;
    transform: scale(1.1) !important;  /* GEÄNDERT: Nur Skalierung, kein translateY */
}

/* Parent-Element relativ positionieren */
li.level-0 {
    position: relative !important;
}

/* Mobile Submenu Container */
.mobile-submenu {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #f8f9fa !important;
    border-top: 1px solid #ddd !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* =========================
   LEVEL 1 - STYLING
   ========================= */

/* Level 1 Container & Items */
.mobile-level-1-item {
    position: relative !important;
    /*border-bottom: 1px solid #eee !important;*/
    background: #fff !important;
    min-height: 45px !important;
}

.mobile-level-1-item:last-child {
    border-bottom: none !important;
}

.mobile-level-1-item > a {
    display: flex !important;
    align-items: center !important;
    padding: 12px 15px !important;
    padding-right: 50px !important;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    border: none !important;
    background: none !important;
    min-height: 45px !important;
    box-sizing: border-box !important;
}

.mobile-level-1-item > a:hover {
    background: #e9ecef !important;
    color: #9ca91d !important;
}

/* Level 1 Toggle Button */
.mobile-level1-toggle {
    position: absolute !important;
    right: 38px !important;
    top: 12px !important;
    width: 25px !important;
    height: 25px !important;
    background: #9ca91d !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 14px !important;
    line-height: 25px !important;
    text-align: center !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
}

.mobile-level1-toggle:hover {
    background: #7a8517 !important;
}

/* =========================
   LEVEL 2 - STYLING
   ========================= */

/* Level 2 Container */
.mobile-level-2-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    /*background: #f5f5f5 !important;*/
    /*border-left: 3px solid #9ca91d !important;*/
}

/* Level 2 Items */
.mobile-level-2-item {
    position: relative !important;
    /*border-bottom: 1px solid #e0e0e0 !important;*/
    min-height: 45px !important;
}

.mobile-level-2-item:last-child {
    border-bottom: none !important;
}

.mobile-level-2-item > a {
    display: flex !important;
    align-items: center !important;
    padding: 10px 15px 10px 25px !important;
    padding-right: 50px !important;
    color: #555 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    background: none !important;
    border: none !important;
    min-height: 45px !important;
    box-sizing: border-box !important;
    /*left: 15px;*/
}

.mobile-level-2-item > a::before {
    content: '–'; /* Das ist der Bindestrich */
    margin-right: 8px; /* Abstand zum Link-Text */
    color: #9ca91d; /* Optional: Farbe des Strichs */
    font-weight: bold; /* Optional: Hervorhebung */
}

.mobile-level-2-item > a:hover {
    background: #e9ecef !important;
    color: #9ca91d !important;
}

/* Level 2 Toggle Button */
.mobile-level2-toggle {
    position: absolute !important;
    right: 39px !important;
    top: 12px !important;
    width: 22px !important;
    height: 22px !important;
    background: #9ca91d !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 12px !important;
    line-height: 22px !important;
    text-align: center !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
}

.mobile-level2-toggle:hover {
    background: #7a8517 !important;
}

/* =========================
   LEVEL 3 - STYLING
   ========================= */

/* Level 3 Container */
.mobile-level-3-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    /*background: #eeeeee !important;*/
    border-left: 2px solid #9ca91d !important;
    margin-left: 90px !important;
}

/* Level 3 Items */
.mobile-level-3-item {
    position: relative !important;
    /*border-bottom: 1px solid #ddd !important;*/
    min-height: 40px !important;
}

.mobile-level-3-item:last-child {
    border-bottom: none !important;
}

.mobile-level-3-item > a {
    display: flex !important;
    align-items: center !important;
    padding: 8px 15px 8px 35px !important;
    padding-right: 45px !important;
    color: #666 !important;
    text-decoration: none !important;
    font-size: 13px !important;
    background: none !important;
    border: none !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
    margin-left:-45px !important;
}

.mobile-level-3-item > a:hover {
    background: #e0e0e0 !important;
    color: #9ca91d !important;
}

/* Level 3 Toggle Button */
.mobile-level3-toggle {
    position: absolute !important;
    right: 15px !important;
    top: 10px !important;
    width: 20px !important;
    height: 20px !important;
    background: #9ca91d !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 11px !important;
    line-height: 20px !important;
    text-align: center !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
}

.mobile-level3-toggle:hover {
    background: #7a8517 !important;
}

/* =========================
   LEVEL 4 - STYLING
   ========================= */

/* Level 4 Container */
.mobile-level-4-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #e8e8e8 !important;
    border-left: 2px solid #bbb !important;
}

/* Level 4 Items */
.mobile-level-4-list li {
    border-bottom: 1px solid #ddd !important;
    min-height: 35px !important;
}

.mobile-level-4-list li:last-child {
    border-bottom: none !important;
}

.mobile-level-4-list a {
    display: flex !important;
    align-items: center !important;
    padding: 6px 15px 6px 45px !important;
    color: #777 !important;
    text-decoration: none !important;
    font-size: 12px !important;
    background: none !important;
    border: none !important;
    min-height: 35px !important;
    box-sizing: border-box !important;
}

.mobile-level-4-list a:hover {
    background: #ddd !important;
    color: #9ca91d !important;
}

/* =========================
   RESPONSIVE & SICHERHEIT
   ========================= */

/* Responsive Verhalten */
@media (max-width: 768px) {
    .mega-menu-overlay {
        display: none !important;
    }

    .mobile-toggle {
        display: inline-block !important;
    }

    .menu-item.level-0.menu-item-has-children {
        position: relative !important;
    }

    .mobile-submenu {
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
    }
}

/* Zusätzliche Sicherheitsregeln für Click-Events */
.mobile-level1-toggle,
.mobile-level2-toggle,
.mobile-level3-toggle {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    user-select: none !important;
}

/* Verhindere Text-Selection bei Toggle-Buttons */
.mobile-level1-toggle::selection,
.mobile-level2-toggle::selection,
.mobile-level3-toggle::selection {
    background: transparent !important;
}

/* Responsive */
@media (max-width: 768px) {
    /* Desktop Mega Menu verstecken */
    .mega-menu-overlay {
        display: none !important;
    }

    /* Mobile Toggle anzeigen */
    .mobile-toggle {
        display: inline-block;
    }

    /* Bessere Mobile-Menü-Darstellung */
    .menu-item.level-0.menu-item-has-children {
        position: relative;
    }

    .mobile-submenu {
        position: static;
        width: 100%;
        box-shadow: none;
    }
}

/* Zusätzliche Verbesserungen für Scroll-Erlebnis */
@media (max-height: 600px) {
    .mega-menu-overlay {
        top: 150px;
        max-height: calc(100vh - 150px - 20px);
    }
}

/* Smooth Scrolling für bessere UX */
.mega-menu-overlay {
    scroll-behavior: smooth;
}

/* Sicherstellen, dass beim Scrollen der Hover-Status erhalten bleibt */
.mega-menu-overlay * {
    pointer-events: auto;
}