/* ====================================================
   Language Switcher — Compact Circular Flag Button
   ==================================================== */

/* Container — positioned in header-right flex flow */
.lang-globe {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 12px;
    z-index: 10001;
}

/* Circular button */
.lang-globe-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.25s ease;
    position: relative;
    overflow: visible;
}

.lang-globe-btn:hover {
    border-color: #FF6600;
    box-shadow: 0 3px 12px rgba(255, 102, 0, 0.2);
    transform: scale(1.05);
}

.lang-globe-btn.active {
    border-color: #FF6600;
}

/* Flag inside button — circular crop */
.lang-globe-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.lang-globe-flag svg {
    width: 32px;
    height: 24px;
    object-fit: cover;
}

/* Small dropdown arrow */
.lang-globe-arrow {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 8px;
    color: #666;
    background: #fff;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.lang-globe-btn.active .lang-globe-arrow {
    transform: rotate(180deg);
}

/* Dropdown menu */
.lang-globe-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    min-width: 130px;
    overflow: hidden;
    z-index: 10002;
    border: 1px solid rgba(0, 0, 0, 0.06);
    animation: langFadeIn 0.2s ease;
}

@keyframes langFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Each language option */
.lang-globe-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.lang-globe-option:hover {
    background: #f8f4f0;
}

.lang-globe-option.active {
    background: #fff5ee;
}

.lang-globe-option+.lang-globe-option {
    border-top: 1px solid #f0f0f0;
}

/* Flag in options */
.lang-globe-option .opt-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 18px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.lang-globe-option .opt-flag svg {
    width: 24px;
    height: 18px;
}

/* Language code text */
.lang-globe-option span:last-child {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.5px;
}

.lang-globe-option.active span:last-child {
    color: #FF6600;
}

/* ====================================================
   Responsive — Mobile
   ==================================================== */
@media (max-width: 1199px) {
    .lang-globe {
        margin-right: 8px;
        order: -1;
        /* Before hamburger */
    }

    .lang-globe-btn {
        width: 38px;
        height: 38px;
    }

    .lang-globe-flag {
        width: 22px;
        height: 22px;
    }

    .lang-globe-menu {
        right: -10px;
    }
}

@media (max-width: 575px) {
    .lang-globe-btn {
        width: 36px;
        height: 36px;
    }

    .lang-globe-flag {
        width: 20px;
        height: 20px;
    }

    .lang-globe-arrow {
        width: 12px;
        height: 12px;
        font-size: 7px;
    }
}

/* ====================================================
   RTL Support
   ==================================================== */
html[dir="rtl"] .lang-globe {
    margin-right: 0;
    margin-left: 12px;
}

html[dir="rtl"] .lang-globe-menu {
    right: auto;
    left: 0;
}

html[dir="rtl"] .lang-globe-arrow {
    right: auto;
    left: -2px;
}

@media (max-width: 1199px) {
    html[dir="rtl"] .lang-globe {
        margin-left: 8px;
        margin-right: 0;
    }
}