.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    background: #f4f4f2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease;
}

.header.scrolled {
    background: #f4f4f2;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 20px rgba(10, 30, 75, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.header .container {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: nowrap;
}

.logo {
    display: inline-flex;
    align-items: center;
}

.language-selector {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 140px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 250px;
    justify-content: flex-end;
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 140px;
    border: 0;
    background: transparent;
    color: #228bd9;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.lang-toggle:hover {
    background: #228bd9;
    color: #ffffff;
}

.lang-toggle .lang-label,
.lang-toggle .lang-arrow {
    color: #228bd9;
}

.lang-toggle:hover .lang-label,
.lang-toggle:hover .lang-arrow {
    color: #ffffff;
}

.lang-toggle .lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 12px;
    overflow: hidden;
    border-radius: 2px;
    flex-shrink: 0;
}

.lang-toggle .lang-arrow {
    font-size: 12px;
    line-height: 1;
}

.lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    display: none;
    flex-direction: column;
    min-width: 160px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    border-radius: 8px;
    background: #f4f4f2;
    color: #228bd9;
    border: 1px solid rgba(34, 139, 217, 0.2);
    box-shadow: 0 20px 40px rgba(12, 35, 86, 0.2);
    z-index: 20;
}

.lang-menu.open {
    display: flex;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    color: #228bd9;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lang-item:hover {
    background: #228bd9;
    color: #ffffff;
}

.lang-item .lang-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 12px;
    overflow: hidden;
    border-radius: 2px;
    flex-shrink: 0;
}

.lang-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logo img {
    display: block;
    height: 36px;
    width: auto;
}

.nav {
    display: flex;
    gap: 18px;
    font-weight: 600;
    margin: 0 auto;
    min-width: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.nav a {
    color: #228bd9;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 14px 34px;
    border-left: 0;
    border-radius: 999px;
}

.nav a:hover {
    color: #ffffff;
    background: #228bd9;
}

.header .btn-primary {
    padding: 9px 18px;
    border-radius: 4px;
    background: linear-gradient(180deg, #3aa0ea, #228bd9);
    border-color: #228bd9;
    box-shadow: 0 3px 10px rgba(34, 139, 217, 0.35);
    color: #ffffff;
    font-weight: 400;
}

.header .btn-primary:visited,
.header .btn-primary:hover,
.header .btn-primary:focus {
    color: #ffffff;
}

.mobile-menu-toggle {
    display: none;
}

@media (max-width: 991px) {
    .header .container {
        flex-wrap: wrap;
    }

    .logo img {
        height: 30px;
    }

    .nav {
        gap: 0;
        font-size: 14px;
        border-radius: 0;
    }
}

@media (max-width: 767px) {
    .header .btn-primary {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
    }

    .mobile-menu-toggle span {
        width: 22px;
        height: 2px;
        background: #228bd9;
    }

    .nav {
        display: none;
        position: absolute;
        top: 63px;
        left: 0;
        width: 100%;
        background: #f4f4f2;
        flex-direction: column;
        gap: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        border-bottom: 0;
    }

    .nav a {
        padding: 12px 18px;
        color: #228bd9;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 0;
    }

    .nav.active {
        display: flex;
    }
}
