/* ==========================================================================
   Language Switcher — modern, searchable language selector
   Replaces the default Google Translate dropdown UI
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hide the raw Google Translate widget + injected banner
   -------------------------------------------------------------------------- */
#google_translate_element {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    pointer-events: none !important;
}

.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-tooltip:hover,
.goog-te-gadget-icon,
.skiptranslate > iframe {
    display: none !important;
    visibility: hidden !important;
}

body,
body.translated-ltr,
body.translated-rtl {
    top: 0 !important;
}

.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   2. Base wrapper
   -------------------------------------------------------------------------- */
.lang-switcher {
    position: relative;
    display: inline-block;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    text-align: left;
    z-index: 1200;
}

.lang-switcher *,
.lang-switcher *::before,
.lang-switcher *::after {
    box-sizing: border-box;
}

.lang-switcher svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Keep the language pill and the contact block in one left-hand section */
.top-style-one .info:not(.text-end) > ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
}

.top-style-one .info .lang-item {
    display: flex !important;
    align-items: center;
    margin: 0;
    padding: 0;
}

.top-style-one .info .lang-switcher .lang-toggle__label {
    display: inline-block !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: 0.01em;
}

.top-style-one .info .lang-switcher .lang-toggle__code {
    display: none !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

.lang-toggle__code {
    display: none;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   3. Trigger button
   -------------------------------------------------------------------------- */
.lang-toggle {
    --lang-chip-bg: rgba(255, 255, 255, 0.08);
    --lang-chip-bg-hover: rgba(255, 255, 255, 0.16);
    --lang-chip-border: rgba(255, 255, 255, 0.24);
    --lang-chip-border-hover: rgba(247, 195, 95, 0.7);
    --lang-chip-color: #ffffff;

    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 13px 0 12px;
    margin: 0;
    border: 1px solid var(--lang-chip-border);
    border-radius: 999px;
    background: var(--lang-chip-bg);
    color: var(--lang-chip-color);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background-color 0.25s ease, border-color 0.25s ease,
        transform 0.25s ease, box-shadow 0.25s ease;
}

.lang-toggle:hover {
    background: var(--lang-chip-bg-hover);
    border-color: var(--lang-chip-border-hover);
    color: var(--lang-chip-color);
    transform: translateY(-1px);
}

.lang-toggle:active {
    transform: translateY(0);
}

.lang-toggle:focus-visible {
    outline: none;
    border-color: var(--lang-chip-border-hover);
    box-shadow: 0 0 0 3px rgba(73, 167, 96, 0.45);
}

.lang-switcher.is-open .lang-toggle {
    background: var(--lang-chip-bg-hover);
    border-color: var(--lang-chip-border-hover);
    box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.55);
}

.lang-toggle__icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: #f7c35f;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.lang-switcher.is-open .lang-toggle__icon {
    transform: rotate(-12deg) scale(1.04);
}

.lang-toggle__label {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lang-toggle__chevron {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    opacity: 0.75;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.lang-switcher.is-open .lang-toggle__chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* --------------------------------------------------------------------------
   4. Dropdown panel
   -------------------------------------------------------------------------- */
.lang-panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 332px;
    max-width: calc(100vw - 30px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 60px -18px rgba(4, 0, 11, 0.35),
        0 10px 24px -12px rgba(4, 0, 11, 0.2),
        0 0 0 1px rgba(4, 0, 11, 0.05);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top left;
    transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.22s ease;
    z-index: 1201;
}

.lang-switcher.is-open .lang-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Search */
.lang-panel__head {
    padding: 14px 14px 12px;
    background: linear-gradient(180deg, #f6faf7 0%, #ffffff 100%);
    border-bottom: 1px solid #eef2ef;
}

.lang-search {
    position: relative;
    display: flex;
    align-items: center;
}

.lang-search__icon {
    position: absolute;
    left: 12px;
    width: 15px;
    height: 15px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
}

.lang-search:focus-within .lang-search__icon {
    color: #49a760;
}

.lang-search__input {
    width: 100% !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 38px 0 36px !important;
    border: 1px solid #e3ebe5 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: #111827 !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: 42px !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.lang-search__input::placeholder {
    color: #9aa6b2;
    font-weight: 500;
    opacity: 1;
}

.lang-search__input:focus {
    outline: none !important;
    border-color: #49a760 !important;
    box-shadow: 0 0 0 3px rgba(73, 167, 96, 0.15) !important;
}

.lang-search__clear {
    position: absolute;
    right: 7px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef2ef;
    color: #5b6672;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-search__clear:hover {
    background: #e2e9e4;
    color: #1f2937;
}

.lang-search__clear svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.4;
}

.lang-switcher.has-query .lang-search__clear {
    display: inline-flex;
}

/* Language list */
.lang-list {
    position: relative;
    list-style: none !important;
    margin: 0 !important;
    padding: 6px !important;
    max-height: 314px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cfded4 transparent;
}

.lang-list::-webkit-scrollbar {
    width: 6px;
}

.lang-list::-webkit-scrollbar-track {
    background: transparent;
}

.lang-list::-webkit-scrollbar-thumb {
    background: #cfded4;
    border-radius: 999px;
}

.lang-list::-webkit-scrollbar-thumb:hover {
    background: #b6cabc;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #1f2937;
    font-family: inherit;
    text-align: left;
    line-height: 1.25;
    cursor: pointer;
    transition: background-color 0.18s ease;
}

.lang-option[hidden] {
    display: none !important;
}

.lang-option:hover,
.lang-option:focus-visible {
    background: #f4f9f5;
    outline: none;
}

.lang-option:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(73, 167, 96, 0.55);
}

.lang-option[aria-selected="true"] {
    background: linear-gradient(90deg, rgba(73, 167, 96, 0.1) 0%, rgba(247, 195, 95, 0.14) 100%);
}

.lang-option__badge {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0ece3;
    border-radius: 50%;
    background: #eef6f0;
    color: #1f4e3d;
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
        transform 0.2s ease;
}

.lang-option:hover .lang-option__badge {
    transform: scale(1.05);
}

.lang-option[aria-selected="true"] .lang-option__badge {
    border-color: transparent;
    background: linear-gradient(135deg, #49a760 0%, #f7c35f 100%);
    color: #ffffff;
}

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

.lang-option__name {
    display: block;
    overflow: hidden;
    color: #111827;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lang-option__native {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #8b97a3;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lang-option__check {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: #49a760;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-option[aria-selected="true"] .lang-option__check {
    opacity: 1;
    transform: scale(1);
}

/* Empty state */
.lang-empty {
    display: none;
    padding: 26px 18px 30px;
    text-align: center;
    color: #8b97a3;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.5;
}

.lang-empty svg {
    width: 26px;
    height: 26px;
    margin: 0 auto 10px;
    color: #b7c3bd;
    stroke-width: 1.6;
}

.lang-switcher.has-no-results .lang-list {
    display: none;
}

.lang-switcher.has-no-results .lang-empty {
    display: block;
}

/* Footer */
.lang-panel__foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-top: 1px solid #eef2ef;
    background: #fbfdfb;
    color: #98a2b3;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.lang-panel__foot .lang-panel__foot-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    color: #b7c3bd;
}

/* --------------------------------------------------------------------------
   5. Mobile / tablet — floating pill in the navbar
   -------------------------------------------------------------------------- */
.lang-switcher--mobile {
    display: none;
}

@media only screen and (max-width: 991px) {
    .top-style-one .info .lang-item {
        display: none !important;
    }

    .lang-switcher--mobile {
        display: block;
        position: fixed;
        top: 14px;
        right: 15px;
        z-index: 1100;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .lang-switcher--mobile .lang-toggle {
        height: 40px;
        padding: 0 13px;
        border-color: rgba(31, 78, 61, 0.1);
        background: #ffffff;
        color: #1f4e3d;
        box-shadow: 0 8px 22px -8px rgba(4, 0, 11, 0.25);
    }

    .lang-switcher--mobile .lang-toggle__icon {
        color: #49a760;
    }

    .lang-switcher--mobile .lang-toggle:hover,
    .lang-switcher--mobile.is-open .lang-toggle {
        background: #ffffff;
        border-color: rgba(73, 167, 96, 0.45);
    }

    .lang-switcher--mobile .lang-panel {
        left: auto;
        right: 0;
        width: min(340px, calc(100vw - 30px));
        transform-origin: top right;
    }

    .lang-switcher--mobile .lang-list {
        max-height: min(60vh, 340px);
    }

    /* Do not float above the opened mobile menu */
    body.side-right .lang-switcher--mobile,
    body:has(.overlay-screen.opened) .lang-switcher--mobile {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

@media only screen and (max-width: 480px) {
    .lang-switcher--mobile .lang-toggle__label {
        display: none;
    }

    .lang-switcher--mobile .lang-toggle__code {
        display: inline-block !important;
    }

    .lang-switcher--mobile .lang-toggle {
        gap: 7px;
        padding: 0 11px;
    }
}

@media only screen and (max-width: 360px) {
    .lang-switcher--mobile .lang-toggle__icon {
        display: none;
    }
}

@media only screen and (max-width: 400px) {
    .lang-switcher--mobile {
        top: 12px;
        right: 10px;
    }

    .lang-switcher--mobile .lang-panel {
        width: calc(100vw - 20px);
    }
}

/* --------------------------------------------------------------------------
   6. Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .lang-switcher,
    .lang-switcher *,
    .lang-switcher *::before,
    .lang-switcher *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
