/* ==========================================================================
   MENU.CSS - Komplettes Stylesheet mit sauberem Pfeil-Wechsel (ohne Shift)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. MOBILE-FIRST BASE STYLES (Standardansicht für Smartphones)
   -------------------------------------------------------------------------- */

/* Haupt-Header als Sticky-Element oben fixieren */
.site-header {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Header-Inhalts-Container (Logo & Mobile-Button) */
.header-container {
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    height: 65px;
}

/* Logo Bild-Anpassung */
.logo-link img {
    height: 45px;
    width: auto;
    display: block;
}

/* Mobile Hamburger-Button Styling */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
}

/* Die 3 Striche des Hamburger-Buttons */
.mobile-toggle span {
    height: 3px;
    width: 100%;
    background-color: #0F75B8;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
    transform-origin: center;
}

/* Animation zu 'X' wenn Menü aktiv geöffnet ist */
.mobile-toggle.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* Mobile Navigation Container (Standardmässig ausgeblendet) */
.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.08);
}

/* Klasse wird per JS hinzugefügt -> Menü wird mobil sichtbar */
.main-nav.open {
    display: block;
}

/* Mobile Menü-Liste */
.main-nav .nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
}

/* Einheitliche Schriftgestaltung für Haupt- und Unterlinks */
.nav-link,
.dropdown-link {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    color: #0F75B8;
    font-weight: 500;
    font-size: 1.25rem;
    letter-spacing: -0.2px;
    display: block;
}

/* Flex-Container zur Ausrichtung von Text & Pfeil */
.dropdown-toggle {
    display: inline-flex;
    align-items: center;
}

/* Unverrückbare Pfeil-Box (verhindert Positionssprünge) */
.dropdown-toggle .arrow {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1em;
    height: 1em;
    margin-left: 0.35rem;
    font-size: 0.7em; /* Dezentere Pfeilgrösse */
    position: relative;
}

/* Standard-Zustand: Pfeil zeigt nach unten */
.dropdown-toggle .arrow::after {
    content: "▼";
    line-height: 1;
}

/* Submenüs mobil standardmässig ZU (Accordion) */
.dropdown-menu {
    display: none;
    list-style: none;
    padding-left: 1rem;
    margin-top: 0.4rem;
    flex-direction: column;
    gap: 0.4rem;
}

/* Submenü anzeigen, wenn Vater-<li> durch JS aktiv geschaltet ist */
.has-dropdown.active > .dropdown-menu {
    display: flex;
}

/* MOBIL: Pfeil auf "nach oben" wechseln bei geöffneem Submenü */
.has-dropdown.active > .dropdown-toggle .arrow::after {
    content: "▲";
}

/* Fernwartungs-CTA-Button mobil verstecken */
.header-cta {
    display: none;
}


/* --------------------------------------------------------------------------
   2. DESKTOP BREAKPOINT (ab 992px Bildschirmbreite)
   -------------------------------------------------------------------------- */

@media (min-width: 992px) {
    
    /* Header-Container Zentrierung & Begrenzung auf Desktop */
    .header-container {
        max-width: 1300px;
        margin: 0 auto;
        padding: 0 2rem;
        height: 68px;
    }

    /* Logo-Grösse für Desktop */
    .logo-link img {
        height: 50px;
    }

    /* Hamburger-Button im Desktop-View ausblenden */
    .mobile-toggle {
        display: none;
    }

    /* Navigationsbereich für Desktop zurücksetzen & immer anzeigen */
    .main-nav {
        display: block !important;
        position: static;
        width: auto;
        padding: 0;
        background-color: transparent;
        box-shadow: none;
        height: 100%;
    }

    /* Hauptliste waagerecht nebeneinander anordnen */
    .main-nav .nav-list {
        flex-direction: row;
        gap: 0.5rem;
        align-items: stretch;
        height: 100%;
        margin: 0;
        padding: 0;
    }

    /* Einzelne Listenelemente auf voller Höhe ausrichten */
    .main-nav .nav-list > li {
        height: 100%;
        display: flex;
        align-items: center;
        position: relative;
    }

    /* Haupt-Links Styling */
    .nav-link {
        padding: 0 1.2rem;
        height: 100%;
        display: flex;
        align-items: center;
        border-top: 4px solid transparent;
        box-sizing: border-box;
        transition: all 0.2s ease;
    }

    /* Aktiver / Gehoverter Zustand: Blauer Oberstrich ganz oben am Header-Rand */
    .nav-link:hover,
    .nav-link.active,
    .has-dropdown:hover .nav-link {
        background-color: transparent;
        color: #0F75B8 !important;
        border-top: 4px solid #0F75B8;
    }

    /* DESKTOP: Keinerlei Drehung oder Animation beim Hovern */
    .has-dropdown:hover .dropdown-toggle .arrow {
        transform: none !important;
    }

    /* Dropdown Menü Box */
    .has-dropdown {
        position: relative;
    }

    /* Untermenü Box: Absolut positioniert direkt unter dem Header */
    .dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 280px;
        background-color: #ffffff;
        box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
        padding: 0;
        margin: 0;
        border-radius: 0 0 4px 4px;
        z-index: 1010;
        gap: 0;
    }

    /* Einblenden des Untermenüs beim Drüberfahren (Hover) */
    .has-dropdown:hover .dropdown-menu {
        display: block;
    }

    /* Styling der Untermenü-Links */
    .dropdown-link {
        padding: 0.75rem 1.4rem;
        white-space: nowrap;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    /* Hover-Effekt im Submenü: Vollflächig blau mit weisser Schrift */
    .dropdown-link:hover,
    .dropdown-link.active {
        background-color: #0F75B8;
        color: #ffffff !important;
    }

    /* Schwarzer Fernwartung-Button ganz rechts */
    .header-cta {
        display: flex;
        align-items: center;
    }

    .btn-black {
        font-family: 'Oswald', sans-serif;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: inline-block;
        padding: 0.55rem 1.4rem;
        background-color: #1e293b;
        color: #ffffff;
        font-weight: 500;
        font-size: 1rem;
        text-decoration: none;
        border-radius: 50px;
        box-shadow: 0 3px 10px rgba(30, 41, 59, 0.15);
        transition: all 0.3s ease-in-out;
    }

    .btn-black:hover {
        background-color: #0F75B8;
        box-shadow: 0 0 18px rgba(15, 117, 184, 0.4);
        transform: translateY(-1px);
    }
}