/* Language picker */
.lang-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.lang-picker-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    color: inherit;
    font: inherit;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.site-header.is-scrolled .lang-picker-toggle {
    border-color: rgba(31, 92, 69, 0.18);
    background: rgba(31, 92, 69, 0.06);
}

.lang-picker-toggle:hover,
.lang-picker.is-open .lang-picker-toggle {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.40);
}

.site-header.is-scrolled .lang-picker-toggle:hover,
.site-header.is-scrolled .lang-picker.is-open .lang-picker-toggle {
    background: rgba(31, 92, 69, 0.10);
    border-color: rgba(31, 92, 69, 0.26);
}

.lang-picker-flag {
    font-size: 18px;
    line-height: 1;
}

.lang-picker-code {
    font-size: 13px;
    letter-spacing: .04em;
}

.lang-picker-chevron {
    font-size: 12px;
    line-height: 1;
    opacity: .78;
    transform: translateY(-1px);
    transition: transform .2s ease;
}

.lang-picker.is-open .lang-picker-chevron {
    transform: rotate(180deg) translateY(1px);
}

.lang-picker-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 30;
    min-width: 170px;
    padding: 8px;
    border: 1px solid rgba(31, 92, 69, 0.12);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(22, 38, 31, 0.18);
    color: #24433a;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.lang-picker.is-open .lang-picker-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-picker-option {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 11px !important;
    border-radius: 12px;
    color: #24433a !important;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.lang-picker-option small {
    display: block;
    margin-top: 2px;
    color: rgba(36, 67, 58, 0.62);
    font-size: 11px;
    font-weight: 600;
}

.lang-picker-option:hover,
.lang-picker-option.is-active {
    background: rgba(31, 92, 69, 0.08);
}

.lang-picker-option.is-active {
    pointer-events: none;
}

@media (max-width: 980px) {
    .main-nav .lang-picker {
        width: 100%;
        justify-content: stretch;
    }

    .main-nav .lang-picker-toggle {
        width: 100%;
        justify-content: center;
        color: #24433a;
        border-color: rgba(31, 92, 69, 0.16);
        background: rgba(31, 92, 69, 0.06);
    }

    .main-nav .lang-picker-menu {
        position: static;
        width: 100%;
        margin-top: 8px;
        box-shadow: none;
        transform: none;
        display: none;
        opacity: 1;
        visibility: visible;
        border-radius: 16px;
    }

    .main-nav .lang-picker.is-open .lang-picker-menu {
        display: block;
        transform: none;
    }

    .main-nav .lang-picker-option {
        justify-content: center;
        text-align: center;
    }
}


/* Header placement: language picker outside mobile menu */
.header-lang-picker {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    margin-right: 12px;
    z-index: 45;
}

.header-lang-picker .lang-picker {
    display: inline-flex;
}

@media (min-width: 981px) {
    .header-lang-picker {
        margin-left: 18px;
        margin-right: 0;
        order: 2;
    }

    .main-nav {
        order: 3;
    }

    .header-phone:not(.header-phone-mobile) {
        order: 4;
    }

    .nav-toggle {
        order: 5;
    }
}

@media (max-width: 980px) {
    .header-inner {
        gap: 10px;
    }

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

    .brand-text {
        min-width: 0;
    }

    .brand-text strong,
    .brand-text small {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-lang-picker {
        flex: 0 0 auto;
        margin-left: 8px;
        margin-right: 2px;
    }

    .header-lang-picker .lang-picker-toggle {
        min-height: 36px;
        padding: 8px 10px;
        color: #24433a;
        border-color: rgba(31, 92, 69, 0.16);
        background: rgba(255, 255, 255, 0.82);
        box-shadow: 0 8px 24px rgba(22, 38, 31, 0.10);
    }

    .site-header:not(.is-scrolled) .header-lang-picker .lang-picker-toggle {
        color: #fff;
        border-color: rgba(255, 255, 255, 0.28);
        background: rgba(255, 255, 255, 0.13);
        box-shadow: none;
    }

    .header-lang-picker .lang-picker-code {
        font-size: 12px;
    }

    .header-lang-picker .lang-picker-flag {
        font-size: 17px;
    }

    .header-lang-picker .lang-picker-menu {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        width: max-content;
        min-width: 148px;
        margin-top: 0;
        display: block;
        box-shadow: 0 18px 50px rgba(22, 38, 31, 0.18);
        transform: translateY(-6px);
        opacity: 0;
        visibility: hidden;
    }

    .header-lang-picker .lang-picker.is-open .lang-picker-menu {
        display: block;
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .header-lang-picker .lang-picker-option {
        justify-content: flex-start;
        text-align: left;
    }

    .main-nav .lang-picker {
        display: none !important;
    }
}

@media (max-width: 390px) {
    .header-lang-picker .lang-picker-toggle {
        padding: 8px 9px;
        gap: 5px;
    }

    .header-lang-picker .lang-picker-code {
        font-size: 11px;
    }
}

/* Language picker layout correction v5 */
@media (min-width: 981px) {
    .brand {
        order: 1;
    }

    .main-nav {
        order: 2;
    }

    .header-lang-picker {
        order: 3;
        margin-left: 14px;
        margin-right: 0;
    }

    .header-phone:not(.header-phone-mobile) {
        order: 4;
        white-space: nowrap;
        padding-left: 16px;
        padding-right: 16px;
    }

    .nav-toggle {
        order: 5;
    }

    .header-lang-picker .lang-picker-toggle {
        width: 64px;
        min-width: 44px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        justify-content: center;
        gap: 4px;
    }

    .header-lang-picker .lang-picker-flag {
        font-size: 18px;
    }

    .header-lang-picker .lang-picker-chevron {
        color: currentColor;
        opacity: 1;
        font-size: 13px;
    }

    .site-header:not(.is-scrolled) .header-lang-picker .lang-picker-toggle {
        color: #fff;
    }

    .site-header:not(.is-scrolled) .header-lang-picker .lang-picker-chevron {
        color: #fff;
    }

    .site-header.is-scrolled .header-lang-picker .lang-picker-toggle {
        color: #24433a;
    }

    .site-header.is-scrolled .header-lang-picker .lang-picker-chevron {
        color: #24433a;
    }
}

@media (max-width: 980px) {
    .brand {
        order: 1;
    }

    .header-lang-picker {
        order: 2;
        margin-left: 8px;
        margin-right: 8px;
    }

    .nav-toggle {
        order: 3;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        flex: 0 0 44px;
    }

    .main-nav {
        order: 4;
    }

    .header-lang-picker .lang-picker-toggle {
        width: 64px;
        min-width: 48px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        justify-content: center;
        gap: 4px;
    }

    .header-lang-picker .lang-picker-flag {
        font-size: 18px;
    }

    .header-lang-picker .lang-picker-chevron {
        color: currentColor;
        opacity: 1;
        font-size: 13px;
    }

    .site-header:not(.is-scrolled) .header-lang-picker .lang-picker-toggle {
        color: #fff;
    }

    .site-header:not(.is-scrolled) .header-lang-picker .lang-picker-chevron {
        color: #fff;
    }

    .site-header.is-scrolled .header-lang-picker .lang-picker-toggle {
        color: #24433a;
    }

    .site-header.is-scrolled .header-lang-picker .lang-picker-chevron {
        color: #24433a;
    }

    .header-lang-picker .lang-picker-code {
        display: none !important;
    }
}

@media (max-width: 390px) {
    .header-lang-picker {
        margin-left: 6px;
        margin-right: 6px;
    }

    .header-lang-picker .lang-picker-toggle {
        width: 54px;
        min-width: 46px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        gap: 3px;
    }
}

