/* --- 1. GLOBALE RESETS & CONTAINER-SETUP --- */
* {
    /* Wichtig: Verhindert Probleme beim Berechnen von padding/border in der Breite */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.header-nav-container {
    /* Definiert den Bezugspunkt für das Hamburger-Icon */
    position: relative; 
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* --- 2. DESKTOP UND BASE STYLING (Wird von Mobile überschrieben) --- */

.header-nav-overlay {
    width: 100%;
    /* Hintergrund-Transparenz vom Desktop-Style */
    background-color: rgba(0, 0, 0, 0.4); 
    padding: 10px 0;
    text-align: center;
    
    display: flex; /* Für Desktop */
    justify-content: center; 
    gap: 30px; 
    
    position: static; 
}

.header-nav-overlay a {
    color: white; 
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: color 0.3s;
}

/* Verstecke die Checkbox und das Hamburger-Icon standardmäßig (Desktop) */
.menu-toggle,
.hamburger-icon {
    display: none;
}

/* --- 3. MOBILE REGELN (Media Query) --- */
@media (max-width: 768px) {
    
    /* 3a. Hamburger-Icon: Positionierung und Z-Index */
    .hamburger-icon {
        display: block !important; 
        cursor: pointer;
        /* FIXED positioniert es fix im Viewport (rechts oben) */
        position: fixed !important; 
        right: 5px; 
        top: 5px; 
        z-index: 100000 !important; 
    }
    
    /* Linien des Icons (Weiß, gut sichtbar vor dunklem Hintergrund) */
    .hamburger-icon .line {
        display: block;
        width: 30px;
        height: 3px;
        background-color: #ffffff !important; 
        margin: 6px 0;
        transition: all 0.3s ease-in-out;
    }

    /* 3b. Menü-Overlay: Scrollbar machen, Verstecken und Styling */
    .header-nav-overlay {
        position: fixed !important; 
        /* Wechsel auf display: block für Scrollbarkeit */
        display: block !important; 
        top: 0;
        left: -100%; 
        width: 100%;
        height: 100vh; /* Volle Viewport-Höhe */
        
        /* Hintergrund für das Overlay: Dunkel */
        background-color: #1a1a2e !important; 
        
        /* WICHTIG: Erlaubt Scrollen, wenn der Inhalt länger ist */
        overflow-y: auto !important; 
        
        transition: left 0.3s ease-in-out;
        z-index: 99999 !important; 
        padding: 0; 
        
        /* Platz für das fest positionierte Icon oben */
        padding-top: 50px !important; 
    }
    
    /* 3c. Styling der Links im mobilen Menü */
    .header-nav-overlay a {
        color: #40e0d0 !important; /* Türkis */
        text-align: center;
        /* display: block, da der Container jetzt auch display: block ist */
        display: block !important; 
        width: 100%;
        padding: 15px 0;
        margin: 0;
        border-bottom: 1px solid rgba(64, 224, 208, 0.5); 
        
        /* Z-Index und Positionierung für Klickbarkeit */
        position: relative !important;
        z-index: 100001 !important;
    }

    /* 3d. Checkbox-Hack: Menü anzeigen */
    .menu-toggle:checked ~ .header-nav-overlay {
        left: 0 !important; 
    }
    
    /* 3e. X-SYMBOL ANIMATION (Weißes X auf dunklem Hintergrund) */
    .menu-toggle:checked ~ .hamburger-icon .line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 8px);
    }
    .menu-toggle:checked ~ .hamburger-icon .line:nth-child(2) {
        opacity: 0; 
    }
    .menu-toggle:checked ~ .hamburger-icon .line:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -8px);
    }
}