/* HJ OIL Language Switcher v2 */

.hjoil-language {
    position: relative;
    z-index: 2147482000;
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    font-family: Arial, Helvetica, sans-serif;
    direction: ltr !important;
}

.hjoil-language-current {
    width: auto;
    min-width: 138px;
    max-width: 160px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(0,23,58,.58);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    outline: none;
}

.hjoil-language-current:hover,
.hjoil-language-current:focus,
.hjoil-language-current:active {
    background: rgba(255,255,255,.10);
    color: #ffffff;
    outline: none !important;
    box-shadow: none !important;
}

.hjoil-language-flag,
.hjoil-option-flag {
    font-size: 15px;
    line-height: 1;
}

.hjoil-language-name {
    max-width: 102px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hjoil-language-arrow {
    font-size: 10px;
    color: #ffffff;
    margin-left: 1px;
}

.hjoil-language-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    width: 214px;
    max-height: min(570px, 72vh);
    padding: 5px;
    display: none;
    overflow-y: auto;
    border: 1px solid #b6c0cb;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(0,0,0,.28);
    z-index: 2147483000;
}

.hjoil-language.open .hjoil-language-menu {
    display: block !important;
}

.hjoil-language-option {
    position: relative;
    width: 100%;
    min-height: 34px;
    padding: 6px 27px 6px 7px;
    border: 0;
    border-radius: 4px;
    display: grid;
    grid-template-columns: 23px minmax(0,1fr);
    align-items: center;
    gap: 7px;
    background: transparent;
    color: #172335;
    font-size: 12px;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    outline: none;
}

.hjoil-option-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hjoil-language-option:hover,
.hjoil-language-option:focus,
.hjoil-language-option.active {
    background: #0b5ea8;
    color: #ffffff;
    outline: none;
}

.hjoil-language-option .check {
    position: absolute;
    right: 8px;
    visibility: hidden;
    font-weight: 900;
}

.hjoil-language-option.active .check {
    visibility: visible;
}

.hjoil-language-menu::-webkit-scrollbar {
    width: 7px;
}

.hjoil-language-menu::-webkit-scrollbar-thumb {
    background: #c2cbd4;
    border-radius: 10px;
}

/* Keep the Google widget invisible; translation still runs. */
#google_translate_element,
.goog-te-banner-frame,
.skiptranslate iframe {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body {
    top: 0 !important;
}

.goog-te-gadget {
    font-size: 0 !important;
}

.goog-logo-link {
    display: none !important;
}

/* Switcher itself always stays LTR even on Farsi/Arabic/Urdu pages. */
html[dir="rtl"] .hjoil-language,
html[dir="rtl"] .hjoil-language-current,
html[dir="rtl"] .hjoil-language-menu,
html[dir="rtl"] .hjoil-language-option {
    direction: ltr !important;
}

@media (max-width: 800px) {
    .hjoil-language-current {
        min-width: 126px;
        max-width: 148px;
        height: 32px;
        font-size: 12px;
    }

    .hjoil-language-menu {
        width: 205px;
        max-height: 64vh;
    }
}
