.nav a,
.nav button {
    margin-left: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: none;
}

.nav a:hover,
.nav a.active {
    color: var(--accent);
}

/* Nav-Links sollen NICHT wie visited/aktiv aussehen */
.nav a:visited {
    color: var(--text-muted);
}
.nav a {
    color: var(--text-muted);
    text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.active {
    color: var(--accent);
}
/* Nav: visited Links sollen nicht wie "aktiv" aussehen */
.nav a:visited,
.dropdown a:visited,
.mobile-nav a:visited {
    color: var(--text-muted);
}

/* Weiche Übergänge für Nav-Links + Dropdown-Button */
.nav .nav-link,
.nav .dropdown-toggle,
#mobile-nav .nav-link,
#mobile-nav .mobile-accordion-toggle {
    transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 120ms ease;
}

/* Optional: leichtes “Anheben” beim Hover */
.nav .nav-link:hover,
.nav .dropdown-toggle:hover {
    transform: translateY(-1px);
}

/* Optional: Active wirkt etwas “satter” */
.nav .nav-link.active,
.nav .dropdown-toggle.active {
    /* nichts Hartes erzwingen – nur das, was du eh schon setzt */
    /* Beispiel (nur falls du sowas möchtest): */
    /* box-shadow: 0 6px 18px rgba(0,0,0,.18); */
}

/* Fokus auch weich (wenn du focus-visible nutzt) */
.nav .nav-link:focus-visible,
.nav .dropdown-toggle:focus-visible {
    transition:
        outline-color 180ms ease,
        box-shadow 180ms ease;
}

/* ==================================================
   MOBILE BURGER MENU
================================================== */

/* Burger Button – nur auf Mobile sichtbar */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1000;
    outline: none;
    box-shadow: none;
}

.burger span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.burger:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Aktiv-Zustand: Burger → X */
.burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}
.burger.active span:nth-child(2) {
    opacity: 0;
}
.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Navigation Panel */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(17, 17, 17, 0.98);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mobile-nav.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav .nav-link {
    font-size: 1.8rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

.mobile-nav.active .nav-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav a:focus,
.mobile-nav button:focus {
    outline: none;
    box-shadow: none;
}

.mobile-nav a:focus-visible,
.mobile-nav button:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Staggered Animation für Links */
.mobile-nav.active .nav-link:nth-child(1) {
    transition-delay: 0.15s;
}
.mobile-nav.active .nav-link:nth-child(2) {
    transition-delay: 0.25s;
}
.mobile-nav.active .nav-link:nth-child(3) {
    transition-delay: 0.35s;
}

/* Responsive Breakpoint */
@media (max-width: 900px) {
    .burger {
        display: flex;
    }

    .nav {
        display: none; /* Desktop Nav verstecken */
    }

    .header .container {
        padding: 0 1rem;
    }

    .header.scrolled {
        padding: 0.75rem 0rem;
    }
}

@media (min-width: 901px) {
    .mobile-nav {
        display: none !important;
    }
}

/* Mobile Navigation Panel - starts below header */
.mobile-nav {
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    z-index: 998; /* unter burger/header, damit man schließen kann */
}

/* Burger/Button über dem Panel halten */
.burger {
    z-index: 1000;
}

/* Fix: Active selector */
.nav a:hover,
.nav button.active,
.nav a.active {
    color: var(--accent);
}

/* ===== Desktop Dropdown ===== */
.nav-item.has-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.dropdown-toggle {
    margin-left: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-toggle:hover {
    color: var(--accent);
}

.caret {
    width: 0.55rem;
    height: 0.55rem;
    display: inline-block;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}

.has-dropdown.open .caret {
    transform: rotate(-135deg);
}

.dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 260px;

    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(17, 17, 17, 0.98);
    backdrop-filter: blur(12px);

    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
    z-index: 1001;
}

.has-dropdown.open .dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown .nav-link {
    margin-left: 0; /* nicht einrücken */
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-muted);
}

.dropdown .nav-link:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
}

/* ===== Mobile Accordion ===== */
.mobile-accordion-toggle {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
}

.mobile-subnav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: -1rem; /* damit es optisch ins Panel passt */
}

.mobile-subnav[hidden] {
    display: none !important;
}

.mobile-subnav .nav-link.sub {
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0.9;
}

/* ===== Mobile Panel unter Header starten (damit man "Menü offen" sieht) ===== */
@media (max-width: 900px) {
    .mobile-nav {
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
        z-index: 998;
    }
}

/* ===== Header immer sichtbar (bulletproof) ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    z-index: 2000; /* deutlich über Hero/Overlays */
}

/* Damit der Content nicht unter den Header rutscht */
body {
    /*padding-top: var(--header-height);*/
}

.nav-item.has-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Button wie Link */
.dropdown-toggle {
    margin-left: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-toggle:hover {
    color: var(--accent);
}

/* Caret */
.caret {
    width: 0.55rem;
    height: 0.55rem;
    display: inline-block;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}

/* Dropdown Panel */
.dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 260px;

    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(17, 17, 17, 0.98);
    backdrop-filter: blur(12px);

    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;

    z-index: 3000; /* über Header-Inhalt */
}

/* Öffnen per Fokus (Klick auf Button) ODER Hover */
.has-dropdown:focus-within .dropdown,
.has-dropdown:hover .dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.has-dropdown:focus-within .caret,
.has-dropdown:hover .caret {
    transform: rotate(-135deg);
}

/* Links im Dropdown */
.dropdown a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
}

.dropdown a:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
}

.nav-item.has-dropdown {
    position: relative;
}

/* Unsichtbare Brücke zwischen Toggle und Dropdown */
.nav-item.has-dropdown::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 14px; /* muss >= dein Gap (12px) sein */
}

@media (max-width: 900px) {
    .mobile-nav {
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
    }
}

/* ===== Mobile Accordion ===== */
@media (max-width: 900px) {
    .mobile-accordion-toggle {
        background: none;
        border: none;
        color: inherit;
        font: inherit;
        cursor: pointer;
    }

    .mobile-subnav {
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
        align-items: center;
        margin-top: -1rem;
    }

    .mobile-subnav .nav-link.sub {
        font-size: 1.25rem;
        font-weight: 500;
        opacity: 0.92;
    }
}

@media (max-width: 900px) {
    .mobile-subnav {
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transform: translateY(-6px);
        transition:
            max-height 260ms ease,
            opacity 260ms ease,
            transform 260ms ease;
        pointer-events: none; /* zu = nicht klickbar */
    }

    .mobile-subnav.open {
        max-height: 420px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto; /* auf = klickbar */
    }
}
@media (max-width: 900px) {
    .mobile-subnav .nav-link.sub {
        text-align: center; /* <- wichtig für mehrzeiligen Text */
        display: block; /* sorgt für saubere Box */
        width: 100%; /* volle Breite, damit Zentrierung sichtbar wird */
    }
}

.has-dropdown .dropdown-header {
    display: flex;
    align-items: center;
    gap: 0rem;
}

.has-dropdown .dropdown-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit; /* oder deine Nav-Farbe */
    font: inherit;
}

.has-dropdown .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    background: transparent;
    border: 0;
    cursor: pointer;
}
