/* Переключатель языка страницы (flights/widgets/lang_switcher/panel.html).
   Desk (≥640px) — поповер под кнопкой, mweb — шторка снизу. Цвета — slate/blue-600 сайта. */

.ls { position: fixed; inset: 0; z-index: 70; }
.ls[hidden] { display: none; }
.ls-scrim { position: absolute; inset: 0; background: transparent; }
.ls-panel {
  position: absolute; width: 600px; max-width: calc(100vw - 32px); height: min(500px, calc(100vh - 80px));
  background: #fff; color: #0f172a; border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
  display: flex; flex-direction: column; overflow: hidden;
}
.ls-grab { display: none; }
.ls-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ls-view[hidden] { display: none; }
.ls-head { padding: 18px 20px 12px; display: flex; flex-direction: column; gap: 12px; }
.ls-title { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.ls-title b { font-size: 18px; font-weight: 700; flex: 1; min-width: 0; }
.ls-sub { font-size: 13px; color: #64748b; margin-top: -6px; }
.ls-icon-btn {
  width: 32px; height: 32px; border-radius: 9999px; border: 0; background: #f1f5f9; color: #475569;
  display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; font-size: 14px;
}
.ls-icon-btn:hover { background: #e2e8f0; }
.ls-close { display: none; }
.ls-search { position: relative; display: block; }
.ls-search i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 14px; pointer-events: none; }
.ls-search input {
  width: 100%; height: 44px; border-radius: 12px; border: 1px solid transparent; background: #f1f5f9;
  color: #0f172a; font: inherit; font-size: 15px; padding: 0 14px 0 40px; outline: none;
}
.ls-search input::placeholder { color: #94a3b8; }
.ls-search input:focus { background: #fff; border-color: #2563eb; }
.ls-body { overflow-y: auto; padding: 4px 12px 14px; flex: 1; min-height: 0; overscroll-behavior: contain; }
.ls-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 4px; }
.ls-rule { height: 1px; background: #f1f5f9; margin: 8px; }
.ls-empty { padding: 20px 8px; color: #64748b; font-size: 14px; margin: 0; }

.ls-row {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 8px; border-radius: 12px;
  color: #0f172a; text-decoration: none; cursor: pointer; min-width: 0; width: 100%;
  border: 0; background: transparent; font: inherit; text-align: start;
}
.ls-row:hover { background: #f8fafc; }
.ls-row[hidden] { display: none; }
.ls-row:focus-visible, .ls-icon-btn:focus-visible, .ls-toast-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.ls-glyph {
  width: 34px; height: 34px; border-radius: 10px; background: #f1f5f9; color: #334155;
  display: grid; place-items: center; font-size: 14px; font-weight: 600; flex-shrink: 0; line-height: 1;
}
.ls-flag { width: 24px; height: 18px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(15, 23, 42, .08); flex-shrink: 0; margin: 0 5px; object-fit: cover; }
.ls-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ls-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-hint { font-size: 12.5px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-hint[hidden] { display: none; }
.ls-meta { font-size: 13px; color: #94a3b8; white-space: nowrap; flex-shrink: 0; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.ls-meta .fa-chevron-right { font-size: 11px; }
.ls-flags { display: flex; }
.ls-flags img { width: 20px; height: 15px; border-radius: 3px; box-shadow: 0 0 0 1.5px #fff; object-fit: cover; }
.ls-flags img + img { margin-left: -6px; }
.ls-row.is-current .ls-glyph { background: #2563eb; color: #fff; }
.ls-row.is-current .ls-name { font-weight: 700; }
.ls-row.is-current .ls-meta { color: #2563eb; }

/* Подсказка «страница есть на вашем языке» — плавающая карточка, не сдвигает вёрстку */
.ls-toast {
  position: fixed; left: 24px; bottom: 24px; z-index: 65; max-width: 480px;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px;
  background: #fff; color: #0f172a; border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .2); font-size: 14px;
}
.ls-toast[hidden] { display: none; }
.ls-toast > .fa-globe { color: #2563eb; }
.ls-toast-text { flex: 1; min-width: 0; }
.ls-toast-btn {
  font-weight: 600; height: 36px; padding: 0 14px; border-radius: 12px; background: #2563eb; color: #fff;
  display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none;
}
.ls-toast-btn:hover { background: #1d4ed8; }

@media (max-width: 639px) {
  .ls-scrim { background: rgba(15, 23, 42, .45); }
  .ls-panel {
    left: 0; right: 0; bottom: 0; top: auto !important; width: auto; max-width: none;
    height: 84vh; height: 84dvh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .ls-grab { display: block; width: 36px; height: 5px; border-radius: 5px; background: #e2e8f0; margin: 8px auto 0; flex-shrink: 0; }
  .ls-head { padding: 8px 16px 10px; }
  .ls-close { display: inline-grid; }
  .ls-body { padding: 0 8px 16px; }
  .ls-grid { grid-template-columns: minmax(0, 1fr); }
  .ls-row { min-height: 54px; }
  .ls-toast { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: none; flex-wrap: wrap; }
  .ls-toast-text { flex-basis: calc(100% - 80px); }
}
@media (prefers-reduced-motion: no-preference) {
  .ls-panel { animation: ls-in .14s ease-out; }
  @keyframes ls-in { from { opacity: 0; transform: translateY(-4px); } }
}
