/* شريط اللغات الموحّد: Laravel | Google | إلغاء */
.nav-lang-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
    position: relative;
    z-index: 10052;
}

.nav-lang-bar__cluster {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nav-lang-bar__sep {
    width: 1px;
    align-self: stretch;
    min-height: 28px;
    margin: 3px 2px;
    background: rgba(100, 255, 218, 0.22);
    flex-shrink: 0;
}

.nav-lang-bar .lang-switch--inline {
    margin-inline: 0;
}

/* حاوية Google بنفس شكل مبدّل الأعلام */
.lang-switch.lang-switch--google {
    min-height: 40px;
    padding: 3px 4px;
    gap: 4px;
}

.lang-switch--google #google_translate_element {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.lang-switch__btn--reset {
    min-width: 34px;
    padding: 6px 10px;
    color: #fff !important;
    background: rgba(127, 29, 29, 0.35) !important;
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25);
}

.lang-switch__btn--reset:hover,
.lang-switch__btn--reset:focus-visible {
    color: #fff !important;
    background: rgba(220, 38, 38, 0.55) !important;
    border-color: #f87171 !important;
    outline: none;
}

.lang-switch__btn--reset .lang-switch__code {
    color: #fff !important;
    font-weight: 900;
}

.nav-lang-bar--google-on .lang-switch:not(.lang-switch--google) {
    opacity: 0.55;
}

.nav-lang-bar--google-on .lang-switch--google {
    border-color: rgba(100, 255, 218, 0.55);
    box-shadow: 0 0 0 1px rgba(100, 255, 218, 0.2);
}

.lang-switch__btn--reset[hidden] {
    display: none !important;
}

/* Google gadget داخل الحاوية الموحّدة */
.lang-switch--google .goog-te-gadget {
    font-family: 'Cairo', 'Almarai', sans-serif !important;
    font-size: 0 !important;
    color: transparent !important;
}

.lang-switch--google .goog-te-gadget-simple {
    background: transparent !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 6px 8px !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
    line-height: 1.2 !important;
    min-height: 34px;
    display: inline-flex !important;
    align-items: center;
}

.lang-switch--google .goog-te-gadget-simple .goog-te-menu-value,
.lang-switch--google .goog-te-gadget-simple .goog-te-menu-value span {
    color: #94a3b8 !important;
    border-color: #64748b !important;
}

.lang-switch--google .goog-te-gadget-simple:hover {
    background: rgba(100, 255, 218, 0.12) !important;
    color: #64ffda !important;
}

.lang-switch--google .goog-te-gadget-simple:hover .goog-te-menu-value,
.lang-switch--google .goog-te-gadget-simple:hover .goog-te-menu-value span {
    color: #64ffda !important;
}

.lang-switch--google .goog-te-gadget-icon {
    display: none !important;
}

/* إخفاء قائمة Google الافتراضية — نستخدم المربع المخصص */
iframe.goog-te-menu-frame,
.goog-te-menu-frame {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.google-translate-slot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.google-lang-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    position: relative;
    z-index: 10061;
    pointer-events: auto !important;
    touch-action: manipulation;
}

.google-lang-trigger:hover {
    color: #64ffda;
    background: rgba(100, 255, 218, 0.12);
    border-color: rgba(100, 255, 218, 0.25);
}

/* مربع اللغات — يُنقل إلى body عبر JS (فوق كل الصفحة) */
.google-lang-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 16px)) max(16px, env(safe-area-inset-right, 16px))
        max(16px, env(safe-area-inset-bottom, 16px)) max(16px, env(safe-area-inset-left, 16px));
    box-sizing: border-box;
    pointer-events: none;
}

.google-lang-modal.is-open {
    display: flex;
    pointer-events: auto;
}

.google-lang-modal[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.google-lang-modal__backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(2, 12, 27, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.google-lang-modal__panel {
    position: relative;
    z-index: 1;
    width: min(80vw, 420px);
    max-width: 420px;
    height: auto;
    max-height: min(75dvh, 520px);
    display: flex;
    flex-direction: column;
    background: #112240;
    border: 1px solid rgba(100, 255, 218, 0.45);
    border-radius: 14px;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    font-family: 'Cairo', 'Almarai', sans-serif;
    pointer-events: auto;
    touch-action: manipulation;
}

.google-lang-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #112240;
}

.google-lang-modal__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #64ffda;
    flex: 1;
    min-width: 0;
}

.google-lang-modal__close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border: 1px solid rgba(248, 113, 113, 0.55);
    border-radius: 10px;
    background: rgba(248, 113, 113, 0.15);
    color: #fecaca;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.google-lang-modal__close:hover,
.google-lang-modal__close:focus-visible {
    color: #fff;
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.35);
    outline: none;
}

.google-lang-modal__list {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
}

.google-lang-modal__list::-webkit-scrollbar {
    width: 6px;
}

.google-lang-modal__list::-webkit-scrollbar-thumb {
    background: rgba(100, 255, 218, 0.35);
    border-radius: 6px;
}

.google-lang-modal__item {
    display: block;
    width: 100%;
    text-align: start;
    padding: 11px 14px;
    border: 1px solid rgba(100, 255, 218, 0.12);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.55);
    color: #e2e8f0;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.google-lang-modal__item:hover {
    background: rgba(100, 255, 218, 0.12);
    border-color: rgba(100, 255, 218, 0.4);
    color: #64ffda;
}

body.google-lang-modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

@media (max-width: 768px) {
    .google-lang-modal__panel {
        width: min(92vw, 420px);
        max-height: min(82dvh, 520px);
    }

    .google-lang-modal__header {
        padding: 14px 12px;
    }

    .google-lang-modal__title {
        font-size: 0.9rem;
    }

    .google-lang-modal__close {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.25rem;
    }

    .google-lang-modal__item {
        padding: 14px 16px;
        font-size: 0.92rem;
    }
}

.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

.skiptranslate iframe:not(.goog-te-menu-frame),
iframe.goog-te-banner-frame {
    display: none !important;
}

@media (max-width: 768px) {
    .nav-lang-bar {
        gap: 4px;
    }

    .nav-lang-bar__sep {
        min-height: 24px;
    }

    .lang-switch--google .goog-te-gadget-simple {
        max-width: 100px;
        padding: 5px 6px !important;
    }

    .lang-switch__btn--reset .lang-switch__code {
        display: none;
    }
}
