.footer-lang-switcher {
    position: relative;
    direction: rtl;
    display: inline-block;
}

.footer-lang-switcher .lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.10);
    color: #fff;
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 0.8rem; /* الديسكتوب يبقى كما هو */
    font-weight: 600;
    transition: 0.18s ease;
}

.footer-lang-switcher .lang-toggle:hover {
    background: rgba(255,255,255,0.20);
    border-color: var(--color-primary, #ffcc00);
}

.footer-lang-switcher .lang-icon {
    width: 24px;
    height: 24px;
}

.footer-lang-switcher .lang-arrow {
    font-size: 1rem;
    transition: 0.15s ease;
}

.footer-lang-switcher.open .lang-arrow {
    transform: rotate(180deg);
}

.footer-lang-switcher .lang-menu {
    position: absolute;
    bottom: 110%;
    min-width: 150px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #0f0f0f;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.20);
    box-shadow: 0 12px 25px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: all 0.18s ease-out;
    max-width: calc(100vw - 20px);
    z-index: 100;
}

html[lang="ae"] .footer-lang-switcher .lang-menu {
    right: 0;
    left: auto;
    transform-origin: top right;
}

html[lang="en"] .footer-lang-switcher .lang-menu {
    left: 0;
    right: auto;
    transform-origin: top left;
}

.footer-lang-switcher.open .lang-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.footer-lang-switcher .lang-option {
    padding: 0.15rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #fff;
    cursor: pointer;
    transition: background 0.14s;
}

.footer-lang-switcher .lang-option:hover {
    background: rgba(255,255,255,0.10);
}

.footer-lang-switcher .lang-option .flag {
    font-size: 1.2rem;
}

.footer-lang-switcher .lang-option + .lang-option {
    border-top: 1px solid rgba(255,255,255,0.10);
}

.footer-lang-switcher .lang-option.active {
    background: rgba(255,255,255,0.18);
    font-weight: 700;
}

/* موبايل: خط أصغر + السويتشر بسطر لحاله فوق الفوتر */
@media (max-width: 768px) {

    .footer-lang-switcher .lang-toggle {
        padding: 0.65rem 1.1rem;
        font-size: 0.75rem; /* أصغر على الهاتف */
        gap: 0.5rem;
    }

    .footer-lang-switcher .lang-icon {
        width: 20px;
        height: 20px;
    }

    .footer-lang-switcher .lang-menu {
        min-width: 170px;
        bottom: 115%;
    }

    .footer-lang-switcher .lang-option {
        padding: 0.5rem 0.9rem;
        font-size: 0.85rem;
        gap: 0.7rem;
    }

    .footer-lang-switcher .lang-option .flag {
        font-size: 1.1rem;
    }

    /* يخلي السويتشر بسطر لحاله فوق عناصر الفوتر في الموبايل */
    .footer-bottom {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .footer-bottom .footer-lang-switcher {
        order: -1;              /* أول عنصر في footer-bottom */
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }

    .footer-bottom .footer-lang-switcher .lang-toggle {
        width: 100%;
        justify-content: center;
    }

    .footer-bottom .footer-lang-switcher .lang-menu {
        width: 100%;
        max-width: 100%;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
    }

    html[lang="ae"] .footer-bottom .footer-lang-switcher .lang-menu {
        right: 0 !important;
        left: auto !important;
    }

    html[lang="en"] .footer-bottom .footer-lang-switcher .lang-menu {
        left: 0 !important;
        right: auto !important;
    }
}

@media (max-width: 480px) {
    .footer-lang-switcher .lang-toggle {
        padding: 0.6rem 1rem;
        font-size: 0.7rem; /* أصغر شوي للجوال الصغير */
    }

    .footer-lang-switcher .lang-menu {
        min-width: 160px;
    }

    .footer-lang-switcher .lang-option {
        font-size: 0.8rem;
    }
}
