/* Language Dropdown Styles */
.back-lang-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}
/* Crucial Reset: override theme's default styling for spans inside the searchbar list */
.back-lang-dropdown span {
    background: transparent !important;
    display: inline-block !important;
    height: auto !important;
    width: auto !important;
    border-radius: 0 !important;
    margin: 0 !important;
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
}
.back-lang-dropdown .lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1a1a1a;
    background: rgba(243, 244, 246, 0.85);
    border: 1px solid rgba(229, 231, 235, 1);
    font-size: 11px;
    font-family: 'SpartanSemiBold', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    padding: 7px 12px;
    border-radius: 50px; /* premium pill shape */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    line-height: 1 !important;
}
html.back-dark body .back-lang-dropdown .lang-trigger {
    color: #e5e7eb;
    background: rgba(31, 41, 55, 0.85);
    border: 1px solid rgba(55, 65, 81, 1);
}
.back-lang-dropdown .lang-trigger:hover {
    color: #ffffff !important;
    background: #0088cb;
    border-color: #0088cb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 136, 203, 0.25);
}
.back-lang-dropdown .lang-trigger:hover .lang-chevron {
    color: #ffffff;
}
.back-lang-dropdown .lang-flag {
    width: 18px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.back-lang-dropdown .lang-chevron {
    width: 8px;
    height: 8px;
    color: #6b7280;
    transition: all 0.3s ease;
}
html.back-dark body .back-lang-dropdown .lang-chevron {
    color: #9ca3af;
}
.back-lang-dropdown:hover .lang-chevron,
.back-lang-dropdown.open .lang-chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu (Submenu) */
.back-lang-dropdown .lang-submenu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    padding: 6px !important;
    margin-top: 10px;
    border: 1px solid rgba(243, 244, 246, 1);
    list-style: none !important;
    display: block !important; /* override parent flex */
    flex-direction: unset !important;
    align-items: unset !important;
}
html.back-dark body .back-lang-dropdown .lang-submenu {
    background: #111827;
    border-color: #1f2937;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 4px 6px rgba(0, 0, 0, 0.1);
}
.back-lang-dropdown:hover .lang-submenu,
.back-lang-dropdown.open .lang-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.back-lang-dropdown .lang-submenu li {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important; /* override parent flex item */
    width: 100% !important;
}
.back-lang-dropdown .lang-submenu li a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 8px 12px !important;
    color: #374151 !important;
    font-size: 12px !important;
    font-family: 'SpartanMedium', sans-serif;
    font-weight: 600 !important;
    transition: all 0.2s ease;
    text-decoration: none;
    text-transform: none !important;
    width: 100% !important;
    text-align: left;
    border-radius: 6px;
}
html.back-dark body .back-lang-dropdown .lang-submenu li a {
    color: #d1d5db !important;
}
.back-lang-dropdown .lang-submenu li a:hover {
    background: #f3f4f6 !important;
    color: #0088cb !important;
    transform: translateX(3px);
}
html.back-dark body .back-lang-dropdown .lang-submenu li a:hover {
    background: #1f2937 !important;
    color: #38bdf8 !important;
}
.back-lang-dropdown .lang-submenu li a.active {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}
html.back-dark body .back-lang-dropdown .lang-submenu li a.active {
    background: #1e3a8a !important;
    color: #60a5fa !important;
}

/* Navigation Menu Spacing Optimization for Desktop */
@media screen and (min-width: 992px) {
    .back-header .back-menus > li > a {
        padding: 26px 15px 26px 15px !important;
    }
    .back-header .back-menus > li.has-sub > a {
        padding-right: 28px !important;
    }
    .back-inner-menus .back-menus > .has-sub > a:before {
        right: 10px !important;
    }
}
