/* ==========================================================================
   Language Switcher  (Google Translate powered, custom UI)
   Sumandeep Hospital  |  Dalia Web & Soft Solution
   --------------------------------------------------------------------------
   1. Kill Google's default UI
   2. Component tokens
   3. Trigger (pill button)
   4. Panel (dropdown on desktop / bottom sheet on mobile)
   5. Search
   6. Language list
   7. Responsive
   8. Motion / accessibility preferences
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Kill Google's default UI
   Google injects a top banner iframe, a tooltip balloon and a highlight
   style. We hide all of it and keep only the hidden <select> that drives
   the translation engine.
   -------------------------------------------------------------------------- */
.goog-te-banner-frame,
iframe.skiptranslate,
.goog-te-gadget-icon,
#goog-gt-tt,
.goog-te-balloon-frame {
    display: none !important;
    visibility: hidden !important;
}

/* Google pushes <body> down by 40px for its banner - undo it */
body {
    top: 0 !important;
}

/* Remove the yellow/blue highlight Google paints on translated nodes */
.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}

/* The mount point for the Google widget - present in DOM, never visible */
#google_translate_element {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   2. Component tokens
   Scoped to the component so it can never leak into the theme. Falls back
   to sensible values if the theme variables are ever removed.
   -------------------------------------------------------------------------- */
.lang-switch,
.lang-switch *,
.lang-switch *::before,
.lang-switch *::after {
    box-sizing: border-box;
}

.lang-switch {
    --ls-accent: var(--pbmit-global-color, #73b475);
    --ls-ink: var(--pbmit-blackish-color, #1489bc);
    --ls-text: #2b3445;
    --ls-muted: #7b8598;
    --ls-surface: #ffffff;
    --ls-line: #e6ecf3;
    --ls-hover: #f3f8f4;
    --ls-radius: 14px;
    --ls-shadow: 0 18px 44px rgba(1, 13, 39, .16), 0 2px 6px rgba(1, 13, 39, .06);
    --ls-font: var(--pbmit-heading-typography-font-family, "Libre Franklin", sans-serif);

    position: relative;
    display: inline-flex;
    font-family: var(--ls-font);
    line-height: 1.4;
    z-index: 999;
}

/* --------------------------------------------------------------------------
   3. Trigger (pill button)
   -------------------------------------------------------------------------- */
.lang-switch__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    margin: 0;
    border: 1px solid rgba(20, 137, 188, .18);
    border-radius: 40px;
    background: var(--ls-surface);
    color: var(--ls-ink);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .2px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(1, 13, 39, .05);
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease, background-color .22s ease;
    -webkit-appearance: none;
    appearance: none;
}

.lang-switch__btn:hover {
    border-color: var(--ls-accent);
    box-shadow: 0 4px 14px rgba(115, 180, 117, .22);
    transform: translateY(-1px);
}

.lang-switch__btn:focus-visible {
    outline: 2px solid var(--ls-accent);
    outline-offset: 2px;
}

.lang-switch__btn[aria-expanded="true"] {
    border-color: var(--ls-accent);
    background: var(--ls-hover);
}

/* Globe */
.lang-switch__globe {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
}

.lang-switch__label {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chevron */
.lang-switch__caret {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    opacity: .55;
    transition: transform .22s ease;
}

.lang-switch__btn[aria-expanded="true"] .lang-switch__caret {
    transform: rotate(180deg);
}

/* --- Variant: sits on a dark / coloured bar --- */
.lang-switch--on-dark .lang-switch__btn {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lang-switch--on-dark .lang-switch__btn:hover,
.lang-switch--on-dark .lang-switch__btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, .22);
    border-color: rgba(255, 255, 255, .5);
}

/* --- Variant: compact, icon only (used in the mobile header) --- */
.lang-switch--compact .lang-switch__btn {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.lang-switch--compact .lang-switch__label,
.lang-switch--compact .lang-switch__caret {
    display: none;
}

.lang-switch--compact .lang-switch__globe {
    width: 18px;
    height: 18px;
}

/* Small dot badge when a non-default language is active */
.lang-switch--compact .lang-switch__btn::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--ls-accent);
    opacity: 0;
    transform: scale(.4);
    transition: opacity .2s ease, transform .2s ease;
}

.lang-switch--compact.is-translated .lang-switch__btn::after {
    opacity: 1;
    transform: scale(1);
}

/* --------------------------------------------------------------------------
   4. Panel
   -------------------------------------------------------------------------- */
.lang-switch__backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(1, 13, 39, .45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    /* Critical: a closed backdrop must never swallow taps on the page */
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
}

.lang-switch.is-open {
    z-index: 10000;
}

.lang-switch.is-open .lang-switch__backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lang-switch__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 9999;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--ls-surface);
    border: 1px solid var(--ls-line);
    border-radius: 18px;
    box-shadow: var(--ls-shadow);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.98);
    transform-origin: top right;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

/* Open to the left when the widget is near the left edge */
.lang-switch--align-left .lang-switch__panel {
    right: auto;
    left: 0;
    transform-origin: top left;
}

.lang-switch.is-open .lang-switch__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-switch__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 10px;
}

.lang-switch__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ls-ink);
}

.lang-switch__reset {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ls-muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lang-switch__reset:hover {
    color: var(--ls-accent);
}

.lang-switch__handle {
    display: none;
}

/* --------------------------------------------------------------------------
   5. Search
   -------------------------------------------------------------------------- */
.lang-switch__search {
    position: relative;
    padding: 0 16px 12px;
}

.lang-switch__search svg {
    position: absolute;
    top: 50%;
    left: 28px;
    width: 15px;
    height: 15px;
    margin-top: -13px;
    stroke: var(--ls-muted);
    fill: none;
    stroke-width: 1.8;
    pointer-events: none;
}

.lang-switch__input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--ls-line);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--ls-text);
    font: inherit;
    font-size: 14px;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.lang-switch__input::placeholder {
    color: var(--ls-muted);
}

.lang-switch__input:focus {
    outline: none;
    background: #fff;
    border-color: var(--ls-accent);
    box-shadow: 0 0 0 3px rgba(115, 180, 117, .16);
}

/* --------------------------------------------------------------------------
   6. Language list
   -------------------------------------------------------------------------- */
/* Hard reset - the theme styles <ul>/<li> inside the header aggressively,
   so the panel list must not inherit any of it. */
.lang-switch .lang-switch__list,
.lang-switch .lang-switch__list>li {
    display: block !important;
    float: none !important;
    width: auto !important;
    margin: 0;
    padding: 0;
    border: 0;
    list-style: none !important;
    text-align: left;
    line-height: normal;
}

.lang-switch .lang-switch__list>li::before,
.lang-switch .lang-switch__list>li::after,
.lang-switch .lang-switch__list>li>i {
    content: none !important;
    display: none !important;
}

.lang-switch .lang-switch__list>li[hidden] {
    display: none !important;
}

.lang-switch__list {
    max-height: 320px;
    margin: 0;
    padding: 0 8px 10px;
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.lang-switch__list::-webkit-scrollbar {
    width: 8px;
}

.lang-switch__list::-webkit-scrollbar-thumb {
    border: 2px solid #fff;
    border-radius: 8px;
    background: #d7dfe9;
}

.lang-switch__list::-webkit-scrollbar-thumb:hover {
    background: #bcc7d6;
}

.lang-switch .lang-switch__list>li.lang-switch__group {
    padding: 10px 12px 6px;
    color: var(--ls-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.lang-switch .lang-switch__opt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ls-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .16s ease;
}

.lang-switch__opt:hover,
.lang-switch__opt.is-active-item {
    background: var(--ls-hover);
}

.lang-switch__opt:focus-visible {
    outline: 2px solid var(--ls-accent);
    outline-offset: -2px;
}

.lang-switch__code {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #eef4fb;
    color: var(--ls-ink);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.lang-switch__names {
    flex: 1 1 auto;
    min-width: 0;
}

.lang-switch__native {
    display: block;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-switch__en {
    display: block;
    font-size: 11.5px;
    color: var(--ls-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-switch__tick {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    stroke: var(--ls-accent);
    fill: none;
    stroke-width: 2.4;
    opacity: 0;
    transition: opacity .18s ease;
}

.lang-switch__opt[aria-selected="true"] .lang-switch__tick {
    opacity: 1;
}

.lang-switch__opt[aria-selected="true"] .lang-switch__code {
    background: var(--ls-accent);
    color: #fff;
}

.lang-switch .lang-switch__list>li.lang-switch__empty {
    padding: 22px 12px;
    color: var(--ls-muted);
    font-size: 13px;
    text-align: center;
}

.lang-switch__note {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-top: 1px solid var(--ls-line);
    background: #fafcfe;
    color: var(--ls-muted);
    font-size: 10.5px;
    letter-spacing: .2px;
}

/* --------------------------------------------------------------------------
   7. Responsive - panel becomes a bottom sheet on small screens
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {

    .lang-switch__backdrop {
        display: block;
    }

    .lang-switch__panel {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: none;
        border: 0;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%) scale(1);
        transition: transform .3s cubic-bezier(.22, .8, .3, 1), opacity .2s ease, visibility .3s;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .lang-switch.is-open .lang-switch__panel {
        transform: translateY(0);
    }

    .lang-switch__handle {
        display: block;
        width: 42px;
        height: 4px;
        margin: 10px auto 2px;
        border-radius: 4px;
        background: #dde4ed;
    }

    .lang-switch__head {
        padding: 8px 18px 10px;
    }

    .lang-switch__title {
        font-size: 15px;
    }

    .lang-switch__search {
        padding: 0 18px 12px;
    }

    .lang-switch__search svg {
        left: 30px;
    }

    .lang-switch__input {
        height: 44px;
        font-size: 16px;
        /* 16px stops iOS Safari from zooming on focus */
    }

    .lang-switch__list {
        max-height: 52vh;
        padding: 0 10px 12px;
    }

    .lang-switch__opt {
        padding: 11px 10px;
    }

    /* Lock background scroll while the sheet is open */
    body.lang-switch-lock {
        overflow: hidden;
    }
}

/* Landscape phones - keep the sheet usable */
@media (max-width: 767.98px) and (max-height: 480px) {
    .lang-switch__list {
        max-height: 38vh;
    }
}

/* Tablet / small laptop */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .lang-switch__panel {
        width: 300px;
    }

    .lang-switch__list {
        max-height: 280px;
    }
}

/* --------------------------------------------------------------------------
   8. Motion / accessibility preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {

    .lang-switch__btn,
    .lang-switch__panel,
    .lang-switch__caret,
    .lang-switch__opt,
    .lang-switch__backdrop {
        transition: none !important;
    }

    .lang-switch__btn:hover {
        transform: none;
    }
}

@media (forced-colors: active) {

    .lang-switch__btn,
    .lang-switch__panel {
        border: 1px solid CanvasText;
    }
}

/* --------------------------------------------------------------------------
   9. Theme integration (Sumandeep / pbminfotech header)
   Only positioning glue - no theme rules are overwritten.
   -------------------------------------------------------------------------- */

/* Top bar slot, sits before the social icons.
   The <ul> carries the flex layout so the <li> is free to keep Bootstrap's
   own display utilities (d-none / d-xl-block) - forcing display on the <li>
   would override them and leak the desktop switcher onto mobile. */
.pbmit-pre-header-right .pbmit-contact-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    margin: 0;
    padding: 0;
}

.pbmit-pre-header-right .pbmit-lang-li {
    padding: 0;
    line-height: normal;
}

.pbmit-pre-header-right .pbmit-lang-li::before,
.pbmit-pre-header-right .pbmit-lang-li::after {
    display: none;
}

.pbmit-pre-header-right .pbmit-lang-li .lang-switch__btn {
    height: 30px;
    font-size: 12.5px;
}

/* Main header slot for tablet / mobile */
.pbmit-right-box .pbmit-lang-mobile {
    align-items: center;
    margin-right: 12px;
}



@media (max-width: 575.98px) {
    .pbmit-right-box .pbmit-lang-mobile {
        margin-right: 50px;
        
    }

    .lang-switch--compact .lang-switch__btn {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 991.98px) {
    .pbmit-right-box .pbmit-lang-mobile {
        margin-right: 50px !important;
       
    }
}