.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}

.nav-tools {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    vertical-align: middle;
}

.nav-tools .lang-switch {
    color: #14213d;
}

[data-theme="dark"] .nav-tools .lang-switch {
    color: #e5eaf2;
}

.lang-switch a {
    color: inherit;
    text-decoration: none;
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

.lang-switch a:hover,
.lang-switch a.active {
    opacity: 1;
}

.lang-switch span {
    opacity: 0.35;
}

.site-header__bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-mobile-tools {
    display: none;
}

@media (min-width: 992px) {
    header .container {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .site-header__bar {
        display: contents;
    }

    .site-nav {
        flex: 1 1 auto;
        min-width: 0;
    }

    header nav ul {
        white-space: nowrap;
    }

    header nav ul > li {
        margin-left: 24px;
    }

    header nav ul > li.nav-tools {
        margin-left: 16px;
        vertical-align: middle;
    }
}

@media (min-width: 992px) and (max-width: 1399px) {
    header nav ul > li {
        margin-left: 16px;
    }

    header nav ul > li a {
        font-size: 14px;
    }
}

@media (max-width: 991px) {
    :root {
        --site-header-height: 72px;
    }

    header {
        z-index: 30;
        padding: 0;
    }

    header .container {
        position: relative;
        padding: 0 12px;
    }

    .site-header__bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: var(--site-header-height);
        padding: 8px 0;
        width: 100%;
    }

    .logo {
        flex: 0 0 auto;
        min-width: 0;
    }

    .header-mobile-tools {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex: 0 0 auto;
        position: relative;
        z-index: 32;
        margin-left: auto;
    }

    .header-mobile-tools .lang-switch {
        color: #14213d;
        font-size: 15px;
        font-weight: 700;
        line-height: 1;
        padding: 10px 12px;
        border-radius: 10px;
        background: rgba(20, 33, 61, 0.07);
        white-space: nowrap;
    }

    [data-theme="dark"] .header-mobile-tools .lang-switch {
        color: #e5eaf2;
        background: rgba(255, 255, 255, 0.1);
    }

    .header-mobile-tools .theme-toggle {
        width: 42px;
        height: 42px;
        border-radius: 10px;
        background: rgba(20, 33, 61, 0.07);
        opacity: 1;
        flex-shrink: 0;
    }

    [data-theme="dark"] .header-mobile-tools .theme-toggle {
        background: rgba(255, 255, 255, 0.1);
        color: #e5eaf2;
    }

    .header-mobile-tools .theme-toggle svg {
        width: 20px;
        height: 20px;
    }

    .header-mobile-tools .toggle-mnu,
    nav .toggle-mnu {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px;
        min-height: 42px;
        position: relative !important;
        right: auto !important;
        top: auto !important;
        margin: 0;
        flex-shrink: 0;
        border-radius: 10px;
        background: rgba(20, 33, 61, 0.07);
        overflow: visible;
        box-sizing: border-box;
        color: #14213d;
        text-decoration: none;
    }

    [data-theme="dark"] .header-mobile-tools .toggle-mnu {
        background: rgba(255, 255, 255, 0.1);
        color: #e5eaf2;
    }

    .header-mobile-tools .toggle-mnu--svg span {
        display: none !important;
    }

    .header-mobile-tools .toggle-mnu--svg .icon-menu,
    .header-mobile-tools .toggle-mnu--svg .icon-close {
        display: block;
        flex-shrink: 0;
    }

    .header-mobile-tools .toggle-mnu--svg .icon-close {
        display: none;
    }

    .header-mobile-tools .toggle-mnu--svg.on .icon-menu {
        display: none;
    }

    .header-mobile-tools .toggle-mnu--svg.on .icon-close {
        display: block;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        height: 0;
        overflow: visible;
        pointer-events: none;
    }

    .site-nav__menu {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: var(--site-header-height) !important;
        width: 100% !important;
        max-height: calc(100dvh - var(--site-header-height));
        overflow-y: auto;
        z-index: 31;
        margin: 0 !important;
        padding: 12px 16px 24px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
        pointer-events: auto;
    }

    .site-nav__menu li {
        display: block !important;
        margin: 6px 0 !important;
    }

    .site-nav__menu li a {
        color: #fff !important;
        display: block;
        border-radius: 8px;
        padding: 12px 16px !important;
        font-size: 16px;
    }

    .nav-tools--desktop {
        display: none !important;
    }

    .nav-tools {
        margin-top: 12px;
    }

    [data-theme="dark"] header,
    header:not(.fixed) {
        background-color: rgba(255, 255, 255, 0.98);
    }

    [data-theme="dark"] header {
        background-color: rgba(11, 16, 24, 0.98);
    }

    body.active::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(10, 16, 24, 0.45);
        z-index: 29;
    }

    body.active {
        overflow: hidden;
    }

    [data-theme="dark"] .header-mobile-tools .toggle-mnu--svg.on .icon-menu,
    [data-theme="dark"] .header-mobile-tools .toggle-mnu--svg.on .icon-close {
        color: #e5eaf2;
    }
}

@media (max-width: 380px) {
    .header-mobile-tools {
        gap: 6px;
    }

    .header-mobile-tools .lang-switch {
        font-size: 14px;
        padding: 10px 8px;
    }

    .header-mobile-tools .theme-toggle,
    .header-mobile-tools .toggle-mnu {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px;
        min-height: 40px;
    }
}

@media (max-width: 600px) {
    nav .toggle-mnu,
    .header-mobile-tools .toggle-mnu {
        position: static !important;
        right: auto !important;
        top: auto !important;
    }
}

@media (min-width: 992px) {
    .header-mobile-tools {
        display: none !important;
    }

    .nav-item-mobile {
        display: none !important;
    }
}
