/*
 * Arbinio.fi language switcher — matches uni-tokv2 header (desktop + mobile).
 */
.lang-switcher {
    position: relative;
    width: fit-content;
    flex: 0 0 auto;
    z-index: 30;
    font-family: "Rubik", sans-serif;
}

.lang-switcher__menu[hidden] {
    display: none;
}

.lang-switcher.is-open .lang-switcher__menu {
    display: block;
}

.lang-switcher__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(3, 43, 138, 0.25);
    border-radius: 8px;
    background: #fff;
    color: #032b8a;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lang-switcher__flag {
    display: block;
    flex: 0 0 auto;
    width: 18px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(3, 43, 138, 0.12);
}

.lang-switcher__toggle:hover,
.lang-switcher.is-open .lang-switcher__toggle {
    border-color: #0f54c9;
    box-shadow: 0 2px 8px rgba(3, 43, 138, 0.12);
}

.lang-switcher__toggle:focus-visible {
    outline: 2px solid rgba(15, 84, 201, 0.45);
    outline-offset: 2px;
}

.lang-switcher__caret {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid #032b8a;
    border-bottom: 2px solid #032b8a;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s;
}

.lang-switcher.is-open .lang-switcher__caret {
    transform: rotate(-135deg) translateY(2px);
}

.lang-switcher__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid rgba(3, 43, 138, 0.15);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(3, 43, 138, 0.12);
}

.lang-switcher__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: #4f5665;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.lang-switcher__label {
    line-height: 1;
}

.lang-switcher__item:hover {
    background: rgba(15, 84, 201, 0.08);
    color: #032b8a;
}

.lang-switcher__item.is-active {
    color: #032b8a;
    font-weight: 700;
    background: rgba(15, 84, 201, 0.1);
}

header.main_header .primary_menu,
header.main_header .header-actions {
    display: flex;
    align-items: center;
}

header.main_header .header-actions {
    gap: 10px;
}

header.main_header .header-actions .sign-up-button {
    white-space: nowrap;
}

@media screen and (max-width: 991px) {
    header.main_header .lang-switcher {
        margin-right: 0;
    }

    .lang-switcher__toggle {
        padding: 6px 10px;
        font-size: 12px;
        border-color: rgba(3, 43, 138, 0.35);
    }

    .lang-switcher__menu {
        right: 0;
        left: auto;
    }
}

@media screen and (max-width: 479px) {
    .lang-switcher__toggle {
        padding: 5px 8px;
        font-size: 11px;
    }

    .lang-switcher__menu {
        min-width: 150px;
    }
}
