/* ==========================================================================
   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: 32px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
}

/* Die 3 Striche des Hamburger-Buttons */
.mobile-toggle span {
    height: 3.5px;
    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(9.25px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: translateY(-9.25px) rotate(-45deg);
}

/* Mobile Navigation Container (Standardmässig ausgeblendet) */
.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    padding: 0.5rem 0 1.5rem 0;
    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.2rem;
    margin: 0;
    padding: 0;
}

/* Jedes Listenelement nimmt die volle Breite ein */
.main-nav .nav-list > li {
    width: 100%;
}

/* Haupt-Links (Mobil gross und vollflächig klickbar) */
.nav-link {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    color: #0F75B8;
    font-weight: 500;
    font-size: 1.4rem;
    letter-spacing: -0.2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.9rem 1.5rem;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

/* Submenü-Links mobil */
.dropdown-link {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    color: #0F75B8;
    font-weight: 500;
    font-size: 1.2rem;
    display: block;
    padding: 0.7rem 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* Flex-Container für Dropdown-Toggles im mobilen Menü */
.dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Unverrückbare Pfeil-Box */
.dropdown-toggle .arrow {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1.5em;
    height: 1.5em;
    font-size: 0.8rem;
    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: 1.5rem;
    background-color: #f8fafc;
    margin: 0;
    flex-direction: column;
}

/* 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: "▲";
}

/* Klick-Feedback auf Smartphones */
.nav-link:active,
.dropdown-link:active {
    background-color: rgba(15, 117, 184, 0.1);
}

/* 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;
        width: auto;
    }

    /* Haupt-Links Styling für Desktop (ursprüngliche Grösse 1.25rem) */
    .nav-link {
        font-size: 1.25rem;
        padding: 0 1.2rem;
        height: 100%;
        display: flex;
        align-items: center;
        width: auto;
        justify-content: flex-start;
        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;
    }

    /* Dropdown-Toggle auf Desktop wieder inline */
    .dropdown-toggle {
        display: inline-flex;
        width: auto;
        justify-content: flex-start;
    }

    /* 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;
        flex-direction: column;
    }

    /* Einblenden des Untermenüs beim Drüberfahren (Hover) */
    .has-dropdown:hover .dropdown-menu {
        display: flex;
    }

    /* Styling der Untermenü-Links */
    .dropdown-link {
        font-size: 1.25rem; /* Ursprüngliche Grösse beibehalten */
        padding: 0.75rem 1.4rem;
        white-space: nowrap;
        width: 100%;
        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);
    }
}