/* ==========================================================================
   BIG ZAINT MULTILINGUAL SYSTEM & LANGUAGE SELECTOR STYLES
   Production-ready light UI, responsive, accessible, with Urdu RTL support
   ========================================================================== */

/* ── 1. Language Selector Wrapper & Button ── */
.bz-lang-selector-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    z-index: 99999;
}

.bz-lang-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 13px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #1e293b;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    user-select: none;
    outline: none;
}

.bz-lang-selector-btn:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.bz-lang-selector-btn:focus-visible {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.bz-lang-globe {
    color: #2563eb;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.bz-lang-current {
    font-size: 0.84rem;
    font-weight: 600;
    color: #0f172a;
}

.bz-lang-chevron {
    color: #64748b;
    font-size: 0.65rem;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.bz-lang-selector-btn[aria-expanded="true"] .bz-lang-chevron {
    transform: rotate(180deg);
}

/* ── 2. Language Dropdown Menu / Popover ── */
.bz-lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-width: min(340px, calc(100vw - 20px));
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
    z-index: 100000;
    overflow: hidden;
    padding: 8px;
}

.bz-lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.bz-lang-dropdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
}

.bz-lang-dropdown-header i {
    color: #2563eb;
    font-size: 0.85rem;
}

.bz-lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding-top: 6px;
    max-height: 380px;
    overflow-y: auto;
}

.bz-lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 8px;
    color: #334155;
    text-decoration: none;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.bz-lang-option:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #e2e8f0;
}

.bz-lang-option.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
    font-weight: 700;
}

.bz-lang-names {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.bz-lang-native {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
}

.bz-lang-option.active .bz-lang-native {
    color: #1d4ed8;
    font-weight: 700;
}

.bz-lang-sub {
    font-size: 0.7rem;
    color: #64748b;
}

.bz-lang-check {
    color: #2563eb;
    font-size: 0.8rem;
    display: none;
}

.bz-lang-option.active .bz-lang-check {
    display: inline-block !important;
}

/* ── 3. Mobile Topbar Language Button ── */
.bz-mobile-lang-wrap {
    display: inline-flex;
    align-items: center;
}

.bz-mob-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 9px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bz-mob-lang-btn i {
    color: #2563eb;
    font-size: 0.8rem;
}

.bz-mob-lang-btn:active {
    transform: scale(0.95);
    background: #f8fafc;
}

/* ── 4. Responsive Viewport Constraints ── */
@media (max-width: 768px) {
    .bz-lang-dropdown {
        position: fixed;
        top: 60px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        max-height: 80vh;
        box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    }
}

/* ── 5. URDU & RTL (Right-to-Left) SUPPORT ── */
[dir="rtl"], .bz-rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

[dir="rtl"] .bz-lang-dropdown {
    right: auto;
    left: 0;
}

@media (max-width: 768px) {
    [dir="rtl"] .bz-lang-dropdown {
        left: 12px;
        right: 12px;
    }
}

[dir="rtl"] .bz-lang-chevron {
    margin-left: 0;
    margin-right: 2px;
}

[dir="rtl"] .nx-desktop-nav,
[dir="rtl"] .nav-buttons,
[dir="rtl"] .bz-header-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .search-box label,
[dir="rtl"] .search-box input {
    text-align: right;
}

[dir="rtl"] .bz-breadcrumb {
    flex-direction: row-reverse;
}
