/* Locale modal (globe button → Language-and-region / Currency tabs).
   Sibling partial to styles.css — loaded via its own <link> in index.html.
   Layout mirrors the AutoValue locale modal: centered card, tab underline,
   flag + two-line cells in a responsive grid. Logical properties throughout
   so RTL locales (ar/he/fa/ur) mirror correctly. */

.bm-locale-overlay {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
}

.bm-locale-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 768px;
    max-height: 85vh;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.bm-locale-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    padding-inline: 24px;
    flex-shrink: 0;
}

.bm-locale-tabs {
    display: flex;
    gap: 20px;
    padding-top: 12px;
}

.bm-locale-tab {
    position: relative;
    padding: 0 0 10px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    transition: color 0.15s;
}
.bm-locale-tab:hover { color: #1f2937; }
.bm-locale-tab.is-active { color: #111827; }
.bm-locale-tab.is-active::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: #111827;
}

.bm-locale-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-block: 10px;
    border: none;
    border-radius: 50%;
    background: none;
    color: #6b7280;
    cursor: pointer;
}
.bm-locale-close:hover { background: #f3f4f6; }
.bm-locale-close .material-symbols-outlined { font-size: 20px; }

.bm-locale-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.bm-locale-body::-webkit-scrollbar { width: 6px; }
.bm-locale-body::-webkit-scrollbar-track { background: transparent; }
.bm-locale-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.bm-locale-h {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}
.bm-locale-h--region { margin-top: 28px; }

.bm-locale-group { margin-bottom: 20px; }
.bm-locale-group-h {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9ca3af;
}

.bm-locale-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.bm-locale-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: start;
    transition: background-color 0.15s;
}
.bm-locale-cell:hover,
.bm-locale-cell.is-selected { background: #f3f4f6; }
.bm-locale-cell:focus-visible { outline: 1px solid #1a73e8; outline-offset: -1px; }

.bm-locale-flag {
    width: 24px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 2px;
    object-fit: cover;
}
.bm-locale-flag--empty { background: #f3f4f6; display: inline-block; }

.bm-locale-cell-text { min-width: 0; }
.bm-locale-cell-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    color: #1f2937;
}
.bm-locale-cell-sub {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.25;
    color: #6b7280;
}

/* Globe trigger in the top navbar (replaces the old language dropdown). */
.bm-locale-trigger {
    /* Same footprint as the mobile burger (.mnav-toggle): 40x40, 12px
       radius — the two controls sit side by side and must read as twins. */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: none;
    color: #5f6368;
    cursor: pointer;
}
.bm-locale-trigger:hover { background: #f6f7fb; color: #1a73e8; }
.bm-locale-trigger .material-symbols-outlined { font-size: 20px; }

/* Mobile: bottom-sheet presentation (standing rule for every modal ≤640px). */
@media (max-width: 640px) {
    .bm-locale-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .bm-locale-card {
        max-width: none;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        animation: bmLocaleSlideUp 0.22s ease-out;
    }
    .bm-locale-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bm-locale-top { padding-inline: 16px; }
    .bm-locale-body { padding: 16px; }
}

@keyframes bmLocaleSlideUp {
    from { transform: translateY(24px); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
}

/* marketing nav: globe hovers like the other nav items */
.nav-cta .bm-locale-trigger{background:none;border:none;color:var(--muted,#6b7280)}
.nav-cta .bm-locale-trigger:hover{background:none;color:var(--fg,#111827)}
