/* ===============================
   Grundnavigation – Desktop
================================= */
.topnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: none;
    position: relative;
}

/* Links & Dropdown-Buttons (Desktop) */
.topnav > a,
.submenu-toggle {
    padding: 1rem 0.8rem;
    color: #000!important;
    text-decoration: none;
    font-weight: 500;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    display: inline-block;
    transition: background 0.3s, color 0.3s;
}

.topnav > a:hover,
.submenu-toggle:hover {
    background: #07469A!important;
    color: #fff!important;
}

/* Nav-Item Dropdown Container */
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-item > .submenu {
    display: none; /* Desktop: unsichtbar bis Hover */
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 10;
}

.nav-item:hover > .submenu {
    display: block;
}

/* Submenü Links Desktop */
.nav-item > .submenu a {
    padding: 0.8rem 1rem;
    display: block;
    color: #000!important;
    text-decoration: none;
    font-weight: 400; 
    text-transform: none; 
    letter-spacing: normal;
    transition: background 0.3s, color 0.3s;
    background: transparent; 
    width: 100%;
    box-sizing: border-box;
}

.nav-item > .submenu a:hover {
    background: #07469A!important;
    color: #fff!important;
}

/* Desktop Sprachumschaltung */
.language-switch.desktop-only {
    margin-left: auto;
    padding-left: 1rem;
    display: flex;
    gap: 0.3rem;
}

.language-switch.desktop-only .language {
    padding: 0.3rem 0.5rem;
    background: #f4f4f4;
    color: #1C4595;
    text-decoration: none;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.3s, color 0.3s;
}

.language-switch.desktop-only .language:hover,
.language-switch.desktop-only .active-lang {
    background: #dadada;
    color: #DA5E2F;
}

/* Mobile Header Bar auf Desktop verstecken */
.mobile-header-bar {
    display: none;
}


/* ===============================
   Mobile Layout (FULL WIDTH FIX)
================================= */
@media (max-width: 940px) {

    .topnav {
        flex-direction: column;
        align-items: stretch;
        background: #07469A!important;
        padding: 0;

        /* === TRICK FÜR VOLLE DISPLAYBREITE === */
        width: 100vw;  /* 100% der Viewport-Breite */
        margin-left: calc(50% - 50vw); /* Zieht das Element nach links raus */
        margin-right: calc(50% - 50vw); /* Zieht es nach rechts raus */
        position: relative; /* Bleibt im Dokumentenfluss */
    }

    /* 1. HEADER BAR (Hamburger + Sprache) */
    .mobile-header-bar {
        display: flex;
        order: -1; 
        justify-content: flex-end;
        align-items: center;
        width: 100%;
        height: 60px;
        background: #07469A!important;
        padding: 0 1.5rem; /* Etwas mehr Seitenabstand, da es jetzt ganz am Rand klebt */
        box-sizing: border-box;
    }

    /* Hamburger Icon */
    .mobile-header-bar .icon {
        background: none;
        border: none;
        color: #fff!important;
        font-size: 2rem;
        cursor: pointer;
        padding: 0.5rem;
        margin-left: 1rem;
    }

    /* Mobile Sprachumschaltung */
    .language-switch.mobile-only {
        display: flex;
        gap: 0.5rem;
    }

    .language-switch.mobile-only .language {
        padding: 0.3rem 0.6rem;
        background: #f4f4f4;
        color: #000;
        text-decoration: none;
        border-radius: 3px;
        font-weight: bold;
        font-size: 0.9rem;
    }
    
    .language-switch.mobile-only .active-lang {
        background: #dadada;
    }

    /* Desktop Elemente ausblenden */
    .language-switch.desktop-only {
        display: none;
    }

    /* 2. Hauptlinks */
    .topnav > a,
    .submenu-toggle {
        display: none;
        width: 100%;
        text-align: left;
        color: #fff!important;
        padding: 1rem 2rem; /* Auch hier etwas mehr Padding für den Text */
        border-top: 1px solid rgba(255,255,255,0.15);
        background: #07469A!important;
        box-sizing: border-box;
    }

    /* Wenn offen -> Anzeigen */
    .topnav.responsive > a,
    .topnav.responsive .submenu-toggle {
        display: block;
    }

    /* ===============================
       Akkordeon Mobile (Submenüs)
    ================================= */
    .submenu-toggle {
        position: relative;
    }
    
    .submenu-toggle .arrow {
        position: absolute;
        right: 2rem; /* Pfeil passend zum Padding verschoben */
        top: 50%;
        width: 10px;
        height: 10px;
        border-right: 2px solid #fff!important;
        border-bottom: 2px solid #fff!important;
        transform: translateY(-50%) rotate(45deg);
        transition: transform 0.25s ease;
    }

    .submenu-toggle.active .arrow {
        transform: translateY(-50%) rotate(-135deg);
    }

    .submenu {
        display: block; 
        max-height: 0;   
        overflow: hidden;
        transition: max-height 0.3s ease;
        background: #fff;
        width: 100%;
        position: relative;
        box-shadow: none;
    }

    .nav-item:hover > .submenu {
        /* Hover deaktivieren */
    }

    .submenu a {
        padding: 1rem 2.5rem; /* Hier noch etwas mehr Einrückung */
        display: block;
        border-left: 8px solid #CD572C!important;
        border-bottom: 1px solid #eee!important;
        background: #fff!important;
        color: #000!important;
        word-break: break-word;
        text-transform: none;
        font-weight: 400;
        font-size: 1rem;
    }
    
    .submenu a:hover {
        background: #E4F1FC;
    }
}

/* ==========================================
   SOCIAL MEDIA ICONS – DESKTOP
   ========================================== */

/* Container hat bereits .language-switch.desktop-only */
.language-switch.desktop-only a i {
    color: #CD572C!important;                 /* Orange Standard */
    background: none!important;               /* Kein Hintergrund */
    font-size: 1.3rem;
    transition: color 0.3s ease;
}

.language-switch.desktop-only a:hover i {
    color: #1C4595!important;                 /* Blau bei Hover */
}



/* ==========================================
   SOCIAL MEDIA ICONS – MOBILE
   ========================================== */

/* Container .language-switch.mobile-only */
@media (max-width: 940px) {
    .language-switch.mobile-only a i {
        color: #ffffff!important;             /* Weiß, kein Hover */
        background: none!important;
        font-size: 1.4rem;
    }

    /* Sicherheitshalber Hover deaktiviert */
    .language-switch.mobile-only a:hover i {
        color: #ffffff!important;
    }
}
