/* =========================================
   GRUNDLAGEN & DESKTOP MENÜ
========================================= */
.ah-widget-wrapper {
    position: relative;
    width: 100%;
}

.ah-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px; /* Abstand zwischen den Menüpunkten */
}

.ah-nav-menu li {
    position: relative;
}

.ah-nav-menu a {
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    padding: 10px 15px; /* Default Padding */
}

/* --- Hover Effekte Desktop --- */
/* 1. Underline */
.ah-nav-menu.effect-underline > li > a {
    position: relative;
}
.ah-nav-menu.effect-underline > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}
.ah-nav-menu.effect-underline > li > a:hover::after {
    width: 100%;
}

/* 2. Background Pill */
.ah-nav-menu.effect-background > li > a {
    border-radius: 50px; /* Pill form */
}

/* --- Submenü Desktop (Drop-Down) --- */
.ah-nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    opacity: 0;
    visibility: hidden;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-width: 220px;
    list-style: none;
    padding: 0;
    margin: 0;
    transform: translateY(15px);
    transition: all 0.3s ease;
    z-index: 99;
    border-radius: 4px;
}

/* 2. Ebene und tiefer */
.ah-nav-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
}

/* Einblenden bei Hover (nur wenn nicht im Flyout-Modus) */
.is-desktop-view .ah-nav-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ah-nav-menu .sub-menu li a {
    padding: 12px 20px;
    font-size: 0.9em;
}

/* =========================================
   MOBILE & FLYOUT
========================================= */
.ah-hamburger {
    cursor: pointer;
    width: 30px;
    height: 22px;
    position: relative;
    z-index: 10;
}
.ah-hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: #333;
    position: absolute;
    transition: 0.3s ease;
    border-radius: 2px;
}
.ah-hamburger span:nth-child(1) { top: 0; }
.ah-hamburger span:nth-child(2) { top: 10px; }
.ah-hamburger span:nth-child(3) { top: 20px; }

.ah-close-flyout {
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    text-align: right;
    padding: 20px 25px;
    color: inherit;
}

/* Flyout Container Status */
/* Flyout Container Status */
.is-mobile-view .ah-nav-container,
.ah-mode-mobile_only .ah-nav-container {
    position: fixed;
    top: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: 0 0 30px rgba(0,0,0,0.15); /* Zentrierter Schatten für beide Seiten */
    z-index: 9999;
    overflow-y: auto;
}

/* === VARIANTEN FÜR RICHTUNG === */

/* Richtung: Rechts */
.ah-dir-right .ah-nav-container {
    right: -100%;
    left: auto;
    transition: right 0.4s cubic-bezier(0.77,0.2,0.05,1.0);
}
.ah-dir-right.flyout-active .ah-nav-container {
    right: 0;
}

/* Richtung: Links */
.ah-dir-left .ah-nav-container {
    left: -100%;
    right: auto;
    transition: left 0.4s cubic-bezier(0.77,0.2,0.05,1.0);
}
.ah-dir-left.flyout-active .ah-nav-container {
    left: 0;
}

/* Menü im Flyout anpassen */
.is-mobile-view .ah-nav-menu,
.ah-mode-mobile_only .ah-nav-menu {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px 20px 20px;
}

.is-mobile-view .ah-nav-menu li,
.ah-mode-mobile_only .ah-nav-menu li {
    width: 100%;
}

.is-mobile-view .ah-nav-menu > li > a,
.ah-mode-mobile_only .ah-nav-menu > li > a {
    padding: 15px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Submenü im Flyout (Akkordeon) */
.is-mobile-view .ah-nav-menu .sub-menu,
.ah-mode-mobile_only .ah-nav-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    transform: none;
    display: none; 
    padding-left: 15px;
    border-radius: 0;
    min-width: 100%;
}
/* Wenn aktiv */
.flyout-active .ah-nav-container {
    right: 0;
}

/* Menü im Flyout anpassen */
.is-mobile-view .ah-nav-menu,
.ah-mode-mobile_only .ah-nav-menu {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px 20px 20px;
}

.is-mobile-view .ah-nav-menu li,
.ah-mode-mobile_only .ah-nav-menu li {
    width: 100%;
}

.is-mobile-view .ah-nav-menu > li > a,
.ah-mode-mobile_only .ah-nav-menu > li > a {
    padding: 15px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Submenü im Flyout (Akkordeon) */
.is-mobile-view .ah-nav-menu .sub-menu,
.ah-mode-mobile_only .ah-nav-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    transform: none;
    display: none; /* JS übernimmt das Togglen */
    padding-left: 15px;
    border-radius: 0;
    min-width: 100%;
}

/* =========================================
   GRUNDLAGEN & DESKTOP MENÜ
========================================= */
.ah-widget-wrapper { position: relative; width: 100%; }

.ah-nav-menu {
    list-style: none; margin: 0; padding: 0;
    display: flex; align-items: center; flex-wrap: wrap;
}
.ah-nav-menu li { position: relative; }
.ah-nav-menu a {
    text-decoration: none; display: block;
    transition: all 0.3s ease;
    padding: 10px 15px; /* Default Fallback */
}

/* --- NEUE HOVER EFFEKTE DESKTOP --- */
.is-desktop-view .ah-nav-menu.effect-underline > li > a,
.is-desktop-view .ah-nav-menu.effect-overline > li > a { position: relative; }

.is-desktop-view .ah-nav-menu.effect-underline > li > a::after,
.is-desktop-view .ah-nav-menu.effect-overline > li > a::before {
    content: ''; position: absolute; left: 50%; transform: translateX(-50%);
    width: 0; height: 2px; background-color: currentColor; transition: width 0.3s ease;
}
.is-desktop-view .ah-nav-menu.effect-underline > li > a::after { bottom: 0; }
.is-desktop-view .ah-nav-menu.effect-overline > li > a::before { top: 0; }

.is-desktop-view .ah-nav-menu.effect-underline > li > a:hover::after,
.is-desktop-view .ah-nav-menu.effect-overline > li > a:hover::before { width: 100%; }

.is-desktop-view .ah-nav-menu.effect-background > li > a { border-radius: 5px; }

/* Brackets [ ] Effekt */
.is-desktop-view .ah-nav-menu.effect-brackets > li > a { position: relative; }
.is-desktop-view .ah-nav-menu.effect-brackets > li > a::before,
.is-desktop-view .ah-nav-menu.effect-brackets > li > a::after {
    display: inline-block; opacity: 0; transition: transform 0.3s, opacity 0.2s;
}
.is-desktop-view .ah-nav-menu.effect-brackets > li > a::before { content: '['; margin-right: 5px; transform: translateX(10px); }
.is-desktop-view .ah-nav-menu.effect-brackets > li > a::after { content: ']'; margin-left: 5px; transform: translateX(-10px); }
.is-desktop-view .ah-nav-menu.effect-brackets > li > a:hover::before,
.is-desktop-view .ah-nav-menu.effect-brackets > li > a:hover::after { opacity: 1; transform: translateX(0); }


/* --- Submenü Desktop (Drop-Down) --- */
.is-desktop-view .ah-nav-menu .sub-menu {
    position: absolute; top: 100%; left: 0;
    opacity: 0; visibility: hidden;
    background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-width: 220px; list-style: none; padding: 0; margin: 0;
    transform: translateY(15px); transition: all 0.3s ease; z-index: 99;
}
.is-desktop-view .ah-nav-menu .sub-menu .sub-menu { top: 0; left: 100%; }
.is-desktop-view .ah-nav-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }


/* =========================================
   MOBILE & FLYOUT
========================================= */
.ah-hamburger { cursor: pointer; width: 30px; height: 22px; position: relative; z-index: 10; }
.ah-hamburger span {
    display: block; height: 2px; width: 100%; background: #333; position: absolute; transition: 0.3s ease; border-radius: 2px;
}
.ah-hamburger span:nth-child(1) { top: 0; }
.ah-hamburger span:nth-child(2) { top: 10px; }
.ah-hamburger span:nth-child(3) { top: 20px; }

.ah-close-flyout { font-size: 36px; line-height: 1; cursor: pointer; text-align: right; padding: 20px 25px; color: inherit; }

/* OVERLAY HINTERGRUND */
.ah-flyout-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6); opacity: 0; visibility: hidden;
    z-index: 9998; transition: all 0.4s ease; cursor: pointer;
}
.flyout-active .ah-flyout-overlay { opacity: 1; visibility: visible; }

/* Flyout Container Status */
.is-mobile-view .ah-nav-container,
.ah-mode-mobile_only .ah-nav-container {
    position: fixed; top: 0; width: 350px; max-width: 85vw; height: 100vh;
    background: #ffffff; z-index: 9999; overflow-y: auto;
}

/* === VARIANTEN FÜR RICHTUNG === */
.ah-dir-right .ah-nav-container { right: -100%; left: auto; transition: right 0.4s cubic-bezier(0.77,0.2,0.05,1.0); }
.ah-dir-right.flyout-active .ah-nav-container { right: 0; box-shadow: -5px 0 30px rgba(0,0,0,0.2); }

.ah-dir-left .ah-nav-container { left: -100%; right: auto; transition: left 0.4s cubic-bezier(0.77,0.2,0.05,1.0); }
.ah-dir-left.flyout-active .ah-nav-container { left: 0; box-shadow: 5px 0 30px rgba(0,0,0,0.2); }

/* Menü im Flyout anpassen */
.is-mobile-view .ah-nav-menu,
.ah-mode-mobile_only .ah-nav-menu { flex-direction: column; align-items: flex-start; padding: 0 20px 20px 20px; }
.is-mobile-view .ah-nav-menu li,
.ah-mode-mobile_only .ah-nav-menu li { width: 100%; }

/* Mobile Submenu (Accordion) - Standard versteckt */
.is-mobile-view .ah-nav-menu .sub-menu,
.ah-mode-mobile_only .ah-nav-menu .sub-menu {
    position: static; box-shadow: none; transform: none; visibility: visible; opacity: 1;
    display: none; /* Toggled by JS */
    min-width: 100%; list-style: none; padding-left: 20px; /* Fallback indent */ margin: 0;
}