header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 40px 100px;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.5s;
    z-index: 9999;
}

header.sticky {
    background: var(--logo-blue);
    padding: 10px 20px;
    font-family: "e-Ukraine-Bold", sans-serif;
    font-size: 0.8rem;
    border-radius: 0 0 40px;
    min-height: 50px;
}

header .header-image {
    display: inline-block;
    height: 2rem;
    padding-right: 1rem;
}

header .inside-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1460px;
    padding: 0 40px;
}

header .logo {
    color: var(--background);
    font-size: 1.4em;
    text-decoration: none;
    display: flex;
    align-items: center;
    max-width: 50%;
    margin: 0 !important;
}

header .navigation {
    min-width: 600px;
    position: relative;
    display: flex;
    justify-content: space-between;
}

header ul {
    margin-top: 20px !important;
}

header .navigation li {
    list-style: none;
    margin-left: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

header .navigation li a {
    text-decoration: none;
    color: #fff;
    font-weight: 300;
}

header.sticky .navigation li a {
    color: var(--background);
}

header .navigation li a:hover {
    color: var(--background);
}

header .burger-menu {
    display: none;
}

header .burger-icon {
    cursor: pointer;
    padding: 0 10px;
}

.admin-menu {
    position: fixed;
    right: 20px;
    top: 100px;
    padding: 15px;
    background-color: var(--secondary-background);
    border-radius: 10px;
    z-index: 10;
    opacity: 0.7;
}

.admin-menu:hover {
    opacity: 1;
}

.admin-menu a {
    background-color: var(--logo-blue);
    color: var(--background);
    padding: 10px;
    border-radius: 10px;
}

#ml-languageButton {
    padding: 0 !important;
    background: var(--logo-blue) !important;
    color: var(--background) !important;
    border: none !important;
}

header .navigation .line {
    display: none;
}

.language-switcher {
    position: relative;
}

.language-switcher .language-current {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    color: #fff;
    text-decoration: none;
    font-family: "e-Ukraine-Bold", sans-serif;
}

header.sticky .language-switcher .language-current {
    color: var(--background);
}

.language-dropdown {
    position: absolute;
    top: 20px;
    right: -10px;
    background: var(--logo-blue);
    border-radius: 0 0 10px 10px;
    padding: 5px 0;
    list-style: none;
    margin: 0;
    min-width: 160px;
    /*box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);*/
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s ease-in-out;
    z-index: 999;
}

/* показує список при наведенні */
.language-switcher:hover .language-dropdown,
.language-switcher:focus-within .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* елементи списку */
.language-dropdown li {
    display: block !important;
    margin-left: 0 !important;
}

.language-dropdown li a {
    display: block;
    padding: 8px 15px;
    color: var(--background);
    text-decoration: none;
    font-family: "e-Ukraine-Bold", sans-serif;
    font-size: 0.9rem;
    white-space: nowrap;
}

.language-dropdown li a:hover {
    background: var(--secondary-background);
    color: var(--logo-blue);
}

/* --- мобільне меню мов --- */
.mobile-lang-menu {
    display: none; /* приховано за замовчуванням */
}

@media (max-width: 1120px) {
    header.sticky {
        padding: 20px 0px;
    }
}

@media (max-width: 991px) {
    header.sticky.active {
        border-radius: 0;
    }
    
    header .navigation .line {
        display: flex;
    }
    
    .priority {
        background-color: var(--logo-blue);
    }
    
    header .navigation {
        display: none;
    }
    
    header .navigation.active {
        width: 100%;
        height: calc(100% - 40px);
        padding-bottom: 70px !important;
        overflow-y: scroll;
        position: fixed;
        padding-top: 40px !important;
        left: 0;
        top: 60px;
        display: flex;
        justify-content: start;
        align-items: center;
        flex-direction: column;
        background: var(--logo-blue);
        padding: 0;
    }
    
    header .navigation li {
        margin-left: 0;
        padding: 10px;
        height: 12%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    header .navigation li a {
        font-size: 2em;
    }
    
    header .menuToggle {
        position: relative;
        height: 40px;
        width: 40px;
        background: url(../../images/icons/menu.svg);
        background-size: 30px;
        background-repeat: no-repeat;
        background-position: center;
        cursor: pointer;
    }
    
    header .menuToggle.active {
        background: url(../../images/icons/close.svg);
        background-size: 30px;
        background-repeat: no-repeat;
        background-position: center;
    }
    
    header.sticky .line {
        height: 1px;
        background: var(--background);
        width: 75%;
        margin: 10px;
        padding: 0.5px;
    }
    
    header .navigation.active li {
        opacity: 0;
        transform: translateY(10px);
        animation: fadeInUp 0.3s forwards;
    }
    
    header .navigation.active li:nth-child(1) { animation-delay: 0.05s; }
    header .navigation.active li:nth-child(2) { animation-delay: 0.1s; }
    header .navigation.active li:nth-child(3) { animation-delay: 0.15s; }
    header .navigation.active li:nth-child(4) { animation-delay: 0.2s; }
    header .navigation.active li:nth-child(5) { animation-delay: 0.25s; }
    header .navigation.active li:nth-child(6) { animation-delay: 0.3s; }
    header .navigation.active li:nth-child(7) { animation-delay: 0.35s; }
    header .mobile-lang-menu { animation-delay: 0.4s; }
    
    .language-switcher {
        display: none !important;
    }
    
    .mobile-lang-menu {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        padding: 20px 0;
        background: var(--logo-blue);
        color: #fff;
        font-family: "e-Ukraine-Bold", sans-serif;
        font-size: 1.5em;
        opacity: 0;
        transform: translateY(10px);
        animation: fadeInUp 0.3s forwards;
    }

    .mobile-lang-menu a {
        text-decoration: none;
        color: #fff;
        transition: color 0.2s ease;
    }

    .mobile-lang-menu a:hover {
        color: var(--background);
    }

    .mobile-lang-menu span {
        color: var(--background);
    }
    
    .mobile-lang-menu a.active {
        color: var(--background);
        text-decoration: underline;
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 885px) {
    header .navigation.active {
        top: 70px;
    }
}

@media (max-width: 750px) {
    header .navigation.active {
        top: 60px;
    }
    
    header .burger-menu {
        display: block;
    }
    
    header .priority {
        z-index: 3;
    }
    
    header .navigation {
        z-index: 2;
    }
    
    header .nav__links {
        display: none;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.95);
        position: absolute;
        top: 60px;
        right: 0;
        width: 100%;
    }
    
    header .nav__links.active {
        display: flex;
        gap: 1rem;
        list-style: none;
        box-sizing: border-box;
        margin: 0 0 0 0;
        color: var(--background);
    }
    
    header .nav__links li {
        padding: 1em;
        margin-left: 4.5em;
    }
    
    header p {
        margin-bottom: 1rem;
    }
    
    header .logo {
        max-width: calc(90% - 40px);
    }
    
    .admin-menu {
        opacity: 1;
        bottom: 20px;
        top: unset;
    }
}

@media (max-width: 572px) {
    header .navigation.active {
        top: 70px;
    }
}
  
@media (max-height: 500px) {
    header .navigation.active .line {
        display: none;
    }
}

@media (max-width: 400px) {
    header .navigation.active {
        top: 60px;
    }
    
    header .navigation li a, header .logo {
        font-size: 1rem;
    }
    
    header .menuToggle {
        background-size: 20px;
        background-position: right;
    }
}

@media (max-width: 362px) {
    header .navigation.active {
        top: 90px;
    }
}

@media (max-width: 339px) {
    header .navigation.active {
        top: 116px;
    }
    
    header .header-image {
        display: none;
    }
}
