/* ─────────────────────────────────────────────────────────
   Cittopia · Language switcher styles
   Drop-in to any page; works alongside any header design.
   ───────────────────────────────────────────────────────── */

.lang-switcher {
    position: relative;
    display: inline-block;
    font-family: 'Inter', -apple-system, sans-serif;
}

.lang-switcher-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 1px solid #e8edf0;
    border-radius: 100px;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1b3a2f;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
    line-height: 1;
}

.lang-switcher-toggle:hover,
.lang-switcher.open .lang-switcher-toggle {
    border-color: #2ca58d;
    background: #f4faf8;
}

/* Circular SVG flag wrapper — works for both toggle and dropdown items */
.lang-flag {
    display: inline-block;
    width: 20px; height: 20px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(27,58,47,0.15), 0 1px 2px rgba(0,0,0,0.06);
    flex-shrink: 0;
    background: #fff;
}
.lang-flag svg {
    width: 100%; height: 100%; display: block;
}
.lang-switcher-toggle .lang-flag {
    width: 22px; height: 22px;
}

.lang-switcher-toggle .lang-caret {
    font-size: 0.65rem;
    color: #888;
    transition: transform 0.15s;
}

.lang-switcher.open .lang-switcher-toggle .lang-caret {
    transform: rotate(180deg);
}

.lang-switcher-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e8edf0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 0.3rem;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 1000;
}

.lang-switcher.open .lang-switcher-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.lang-switcher-menu .lang-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    color: #1b1d1f;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.1s;
}

.lang-switcher-menu .lang-option:hover {
    background: #f4faf8;
}

.lang-switcher-menu .lang-option.active {
    background: #eef6f4;
    color: #2ca58d;
    font-weight: 700;
}

.lang-switcher-menu .lang-option .lang-flag {
    width: 22px; height: 22px;
}
.lang-switcher-menu .lang-option .lang-check {
    margin-left: auto;
    color: #2ca58d;
    font-weight: 700;
}
.lang-switcher-menu .lang-option .lang-name {
    flex: 1;
}
.lang-switcher-toggle .lang-caret {
    display: inline-flex;
    align-items: center;
}

/* Mobile: keep it compact */
@media (max-width: 640px) {
    .lang-switcher-toggle .lang-code {
        display: none;
    }
    .lang-switcher-toggle {
        padding: 0.4rem 0.65rem;
    }
}


/* Ensure visibility when inside .header-right alongside CTA buttons */
.header-right .lang-switcher {
    flex-shrink: 0;
}
.header-right .lang-switcher-toggle {
    height: 36px;
    line-height: 1;
}

/* Higher z-index than sticky headers */
.lang-switcher-menu {
    z-index: 9999 !important;
}

/* On mobile, ensure the dropdown doesn't get clipped */
@media (max-width: 760px) {
    .lang-switcher-menu {
        right: 0;
        min-width: 140px;
    }
}
