/* Header fixiert */
/* Header fixiert */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;              /* 🔥 FIX */
    height: 120px;
    z-index: 9999;
    display: flex;
    align-items: center;     /* etwas kleiner */
    box-sizing: border-box;   /* 🔥 GANZ WICHTIG */
    background: var(--headerbg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    padding:0 20px;
}

.logo img {
    height: 50px;
    max-width: 500px;  /* 🔥 verhindert Overflow */
    width: auto;
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 15px;
}

.desktop-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.desktop-nav ul li {
    position: relative;
    margin-right: 20px;
}

.desktop-nav ul li a {
    text-decoration: none;
    color: var(--headertxt);
    padding: 5px 10px;
    font-family: var(--font-sans);
    font-size: var(--font-md);
    font-weight: var(--fw-bold);
}

.desktop-nav > ul > li.active > a {
    background-color: var(--headeractbg);
    color: var(--headeracttxt);
    border-radius: 4px;
    padding: 25px 10px;
}
/* Untermenüs nicht verändern */
.desktop-nav > ul > li > ul.dropdown > li > a {
    text-decoration: none;
    background-color: transparent;
    color: var(--headertxt);
    padding: 5px 10px;
    font-family: var(--font-sans);
    font-size: var(--font-md);
     font-weight: var(--fw-normal);

}

.desktop-nav .has-dropdown ul.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--headerbg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    list-style: none;
    padding: 0;
     border: 2px solid #ffffff;      /* weißer Rahmen */
        border-radius: 6px;
}

.desktop-nav .has-dropdown:hover ul.dropdown {
    display: block;
}

.desktop-nav .dropdown li a {
    display: block;
    padding: 10px;
    font-weight: var(--fw-normal);
}

.desktop-nav ul li a:hover,
.desktop-nav ul li ul.dropdown li a:hover {
    color: var(--headeracttxt);
}

/* Logo Abstand */
.logo {
    margin-right: 30px;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
}

.mobile-menu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-direction: column;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu li {
    padding: 10px;
    border-top: 1px solid var(--headerbg);
}

.mobile-menu .dropdown {
    display: none;
    flex-direction: column;
}

.mobile-menu li.has-dropdown.open .dropdown {
    display: flex;
}

/* Sprache rechts */
.language {
    margin-left: auto;
    font-size: 50px;
    cursor: pointer;
}

.language span {
    margin-left: 5px;
}

/* Responsive */
@media (max-width: 1250px) {
    .desktop-nav {
        display: none !important;
    }

    .mobile-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: var(--headerbg);
        max-width: 100%;
        position: relative;
        box-sizing: border-box;
    }
    .desktop-nav, .mobile-right {
    max-width: 100%;
    overflow: hidden; /* verhindert, dass es rausragt */
}

.logo img {
    max-width: 100%;  /* Logo skaliert auf kleineren Geräten */
    height: auto;
}
    

    .mobile-menu {
        max-height: 80vh;          /* Menü maximal 80% der Bildschirmhöhe */
        overflow-y: auto;          /* vertikales Scrollen aktivieren */
        -webkit-overflow-scrolling: touch;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--headerbg);
        flex-direction: column;
        z-index: 999;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .mobile-menu.open {
        max-height: 80vh;
    }

    .mobile-right {
    display: flex;
    gap: 10px;
    flex-shrink: 0; /* 🔥 verhindert Zusammendrücken/Overflow */
}

    .mobile-right .language {
        font-size: 30px;
        color: #ffffff;
        cursor: pointer;
        white-space: nowrap;
        margin-left: auto;
    }

    .mobile-right .language span {
        margin-left: 5px;
    }

    .mobile-right .burger {
        font-size: 28px;
        color: #ffffff;
        cursor: pointer;
    }

    .mobile-menu li {
        padding: 10px;
        border-top: 1px solid #1f1f1f;
        background-color: #000000;
    }

    .mobile-menu li a {
        color: #ffffff;
        text-decoration: none;
        display: block;
    }

/* Li als relativer Container */
.mobile-menu li.has-dropdown {
    position: relative;
}

/* Pfeil rechts neben Link */
.mobile-menu li.has-dropdown .dropdown-toggle {
    position: absolute;
    right: 15px;              /* Abstand rechts */
    top: 50%;                  /* vertikal zentrieren */
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: #ffffff;
    user-select: none;
    display: inline-block;
    z-index: 2;                /* sicherstellen, dass Pfeil über Link liegt */
}

/* Untermenü */
.mobile-menu .dropdown {
    display: none;
    flex-direction: column;
    padding-left: 20px;
}

.mobile-menu li.has-dropdown.open .dropdown {
    display: flex;
}
.mobile-menu li.has-dropdown.open > .dropdown-toggle {
    display: none; /* Pfeil ausblenden, wenn Untermenü offen */
}

}
