/* Language Switcher Styles */

/* Desktop Language Switcher */
.lang-switcher {
    position: relative;
    float: left;
    margin-left: 10px;
    z-index: 9999;
}

/* Đảm bảo khối right không cắt mất dropdown */
.header_top .right {
    overflow: visible !important;
}

.lang-current {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 25px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.lang-current:hover {
    transform: scale(1.15);
}

.lang-current-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 17px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    border-radius: 1px;
}

.lang-current-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1px;
}

/* Dropdown Menu (Shared for Desktop & Mobile) */
.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    list-style: none;
    margin: 0 !important;
    padding: 8px 0;
    min-width: 170px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 99999 !important;
}

.lang-dropdown.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(4px) !important;
}

.lang-dropdown li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2 !important;
    text-align: left;
    border-bottom: 1px solid #f9f9f9;
}

.lang-dropdown li:last-child {
    border-bottom: none;
}

.lang-dropdown li:hover {
    background: #f8fbff;
    padding-left: 24px;
}

.lang-flag {
    width: 18px;
    height: 12px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.lang-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lang-name {
    font-size: 14px;
    color: #444;
    font-weight: 500;
}

/* Translation Loader Indicator */
.translation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.translation-overlay.show {
    opacity: 1;
    visibility: visible;
}

.lang-loader-content {
    text-align: center;
}

.lang-loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
    margin: 0 auto 20px;
}

.translation-overlay p {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Language Switcher inside right menu */
.lang-switcher-mobile-menu {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.lang-current-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

.lang-current-mobile .lang-current-flag {
    width: 28px;
    height: 19px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Mobile Dropdown Position */
@media (max-width: 991px) {
    .lang-switcher-mobile-menu .lang-dropdown {
        left: 0;
        right: auto;
        top: calc(100% + 5px);
    }
}

/* Hide Google Translate default widget */
#google_translate_element,
.goog-te-banner-frame,
.skiptranslate,
.goog-te-gadget,
.goog-te-combo {
    display: none !important;
}

body {
    top: 0 !important;
}