/* Sprach-Flaggenleiste im Header */
.header-language-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    margin-right: 14px;
    z-index: 13010;
}

.header-language-flag {
    width: 32px;
    height: 22px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.18s, box-shadow 0.18s;
    object-fit: cover;
}

.header-language-flag.active {
    border-color: #FF902A;
    box-shadow: 0 0 0 2px #FF902A44;
}

.header-language-flag:hover {
    border-color: #FF902A;
}

.header-language-dropdown {
    position: relative;
    margin-left: auto;
    margin-right: 14px;
    z-index: 13010;
}

.header-language-trigger {
    height: 34px;
    min-width: 68px;
    border: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 4px 10px;
    cursor: pointer;
}

.header-language-arrow {
    width: 9px;
    height: 9px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg) translateY(-1px);
    transition: transform .2s ease;
}

.header-language-dropdown.open .header-language-arrow {
    transform: rotate(-135deg) translateY(-1px);
}

.header-language-trigger img {
    width: 30px;
    height: 20px;
    border-radius: 3px;
    object-fit: cover;
}

.header-language-menu {
    display: none;
    position: fixed;
    top: 68px;
    right: 28px;
    background: rgba(8, 9, 12, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 8px 8px 10px;
    min-width: 70px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
    z-index: 14050;
}

.header-language-dropdown.open .header-language-menu {
    display: block;
}

.header-language-option {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 7px 6px;
    display: flex;
    justify-content: center;
    cursor: pointer;
    margin-top: 4px;
}

.header-language-option img {
    width: 34px;
    height: 24px;
    border-radius: 2px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.header-language-option:hover,
.header-language-option.active {
    background: rgba(255, 255, 255, 0.16);
}

.header-language-option:first-child {
    margin-top: 0;
}
header {
    position: fixed;
    width: 100vw;
    max-width: 100vw;
    left: 0;
    overflow-x: hidden;
    overflow-y: visible; /* Mobile-Overlay darf über den Header hinausgehen */
    display: flex;
    justify-content: center;
    transition: .5s;
    z-index: 13000;
}

header.scrolled {
    background-color: #0f0f0fa1;
    backdrop-filter: blur(5px);
}

.header-wrapper {
    width: 1425px;
    padding: 25px 30px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    transition: .5s;
}

header.scrolled .header-wrapper {
    padding: 15px 30px;
}

.header-logo {
    width: 200px;
    position: relative;
    z-index: 999;
    transition: .5s;
}

.header-logo img {
    width: 100%;
}

.header-buttons-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    width: auto;
    gap: 48px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

 .header-button {
    text-decoration: none;
    color: #CECECE;
    transition: .3s;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.header-button:hover {
    color: #222;
    font-weight: 700;
}

 .header-button::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scaleX(0.8) scaleY(0.7);
    width: 120%;
    height: 170%;
    background: #FF902A;
    border-radius: 12px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.18s, transform 0.18s;
}

.header-button:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(1) scaleY(1);
}

.header-button-lk {
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    width: 160px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #FFFFFF20;
    border-radius: 5px;
    cursor: pointer;
    transition: .3s, transform 0.18s cubic-bezier(.4,2,.6,1), box-shadow 0.18s cubic-bezier(.4,2,.6,1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.header-button-lk:hover, .header-mobile-button-lk:hover {
    background-color: #FFFFFF40;
}

.header__menu {
    display: none;
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 13002;
}

#menu li {
    text-align: center;
    margin-bottom: 25px;
    margin-right: 0;
}

#menu li a {
    font-size: 20px;
}

#menu__toggle {
    opacity: 0;
}

.menu__btn {
    display: flex;
    align-items: center;
    position: relative;
    width: 34px;
    height: 34px;
    cursor: pointer;
    z-index: 13003;
}

.menu__btn > span,
.menu__btn > span::before,
.menu__btn > span::after {
    display: block;
    position: absolute;
    width: 100%;
    height: 2.5px;
    background-color: #FFFFFF;
    transition: .3s;
}

.menu__btn > span::before {
    content: '';
    top: -10px;
}

.menu__btn > span::after {
    content: '';
    top: 10px;
}

#menu__toggle:checked ~ .menu__btn > span {
    transform: rotate(45deg);
}

#menu__toggle:checked ~ .menu__btn > span::before {
    top: 0;
    transform: rotate(0);
}

#menu__toggle:checked ~ .menu__btn > span::after {
    top: 0;
    transform: rotate(90deg);
}

.header-mobile {
    width: 100vw;
    height: calc(100dvh - 92px);
    position: fixed;
    top: 92px;
    left: 0;
    background: linear-gradient(180deg, rgba(6, 10, 15, 0.86) 0%, rgba(6, 10, 15, 0.90) 100%);
    backdrop-filter: blur(3px);
    z-index: 12000;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    padding-top: 0;
    padding-bottom: 90px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.header-mobile.open {
    transform: translateX(0);
}

/* Fallback ohne JavaScript: mobiles Overlay direkt über Checkbox-Status öffnen */
body:has(#menu__toggle:checked) .header-mobile {
    transform: translateX(0);
}

.header-mobile-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(74vw, 430px);
    margin: 0 auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.header-mobile-button {
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: center;
    padding: 20px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    line-height: 1.15;
}

.header-mobile-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: none;
    padding: 0;
}

.header-mobile-close > span,
.header-mobile-close > span::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36px;
    height: 3px;
    background-color: #FFFFFF;
    transform-origin: center;
}

.header-mobile-close > span {
    transform: translate(-50%, -50%) rotate(45deg);
}

.header-mobile-close > span::before {
    transform: rotate(90deg);
}

.header-mobile-button-lk {
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    width: 160px;
    height: 53px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #FFFFFF20;
    border-radius: 5px;
    cursor: pointer;
    transition: .3s, transform 0.18s cubic-bezier(.4,2,.6,1), box-shadow 0.18s cubic-bezier(.4,2,.6,1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    display: none;
}
.header-button-lk.clicked, .header-mobile-button-lk.clicked {
    transform: scale(0.93) rotate(-2deg);
    box-shadow: 0 0 0 6px #FF902A33;
    background: linear-gradient(90deg, #FF902A 0%, #FFDE3B 100%);
    color: #fff;
    transition: transform 0.18s cubic-bezier(.4,2,.6,1), box-shadow 0.18s cubic-bezier(.4,2,.6,1), background 0.18s, color 0.18s;
}

@media (max-width: 1630px) {
    .header-wrapper {
        width: 100%;
        max-width: 1425px;
        box-sizing: border-box;
        padding: 25px 30px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        transition: .5s;
        overflow-x: hidden;
    }

    .header-buttons-container {
        display: none;
    }
    .header__menu {
        display: block;
    }
    #benutzerkonto-btn {
        display: none;
    }
    .header-language-bar {
        margin-right: 58px;
    }
    .header-language-menu {
        top: 64px;
        right: 86px;
    }
    .header-mobile-close {
        display: none;
    }
    /* Benutzerkonto-Button bleibt sichtbar */
}

@media (max-width: 840px) {
    .header-logo {
        width: 165px;
    }
    .header-mobile {
        top: 78px;
        height: calc(100dvh - 78px);
        padding-bottom: 70px;
    }
    .header-mobile-buttons-container {
        width: min(72vw, 360px);
    }
    .header-mobile-button {
        font-size: 19px;
        padding: 18px 8px;
    }
    .header-language-menu {
        top: 60px;
        right: 74px;
    }
}
