/* Shared language switcher chrome. Each site overrides the custom properties. */

.ts-lang {
  --ts-lang-bg: rgba(14, 16, 24, 0.62);
  --ts-lang-border: rgba(255, 255, 255, 0.38);
  --ts-lang-ink: #fff;
  --ts-lang-active-bg: #fff;
  --ts-lang-active-ink: #10121a;
  --ts-lang-font: system-ui, -apple-system, "Segoe UI", sans-serif;

  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--ts-lang-border);
  border-radius: 999px;
  background: var(--ts-lang-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-sizing: border-box;
}

.ts-lang button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  margin: 0;
  background: transparent;
  color: var(--ts-lang-ink);
  font-family: var(--ts-lang-font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.ts-lang button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.ts-lang button[aria-pressed="true"] {
  background: var(--ts-lang-active-bg);
  color: var(--ts-lang-active-ink);
}

.ts-lang button:focus-visible {
  outline: 2px solid var(--ts-lang-active-bg);
  outline-offset: 2px;
}

/* Mount wrapper the page shells place where the control belongs. */
.ts-lang-mount {
  display: flex;
  justify-content: flex-start;
}

.ts-lang--popup {
  position: relative;
  z-index: 3;
  margin: 0 0 12px;
}

#gbcs-popup-card > .ts-lang--popup {
  margin: 0 auto 14px;
}

#scrim .modal-header > .ts-lang--popup {
  margin: 0 0 10px;
}

/* Translated copy is usually longer than English — never let it push a scrollbar. */
[data-i18n],
[data-i18n-html] {
  overflow-wrap: anywhere;
}

#gbcs-popup-card h2,
#gbcs-popup-card p,
#scrim .hero-step-title,
#scrim .hero-step-subtitle,
#scrim .fi-text,
#scrim .btn,
#scrim .step-desc,
#scrim .field-icon-label,
#scrim .confirm-intro,
#scrim .vip-raffle-box p,
#scrim label {
  overflow-wrap: anywhere;
}

#scrim .btn {
  white-space: normal;
  height: auto;
  min-height: 44px;
}

/* Right-to-left support (Hebrew). */
html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .ts-lang {
  direction: ltr;
}

html[dir="rtl"] #scrim .modal-body,
html[dir="rtl"] #gbcs-popup-card {
  text-align: right;
}

html[dir="rtl"] #scrim .step-actions {
  flex-direction: row-reverse;
}

html[dir="rtl"] #scrim .field-icon-label,
html[dir="rtl"] #scrim .field-label-row,
html[dir="rtl"] #scrim .feature-item,
html[dir="rtl"] #scrim .privacy-note,
html[dir="rtl"] #scrim .trust-icon-note,
html[dir="rtl"] #scrim .urgency-banner,
html[dir="rtl"] #scrim .mini-privacy,
html[dir="rtl"] #scrim .plain-note,
html[dir="rtl"] #scrim .fine-print,
html[dir="rtl"] #scrim .secure-footnote {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir="rtl"] #scrim .input,
html[dir="rtl"] #scrim .select,
html[dir="rtl"] #gbcs-popup-card .gbcs-desc {
  text-align: right;
}

/* The phone and email composers stay left-to-right so +972 and @ read correctly. */
html[dir="rtl"] #scrim .phone-split,
html[dir="rtl"] #scrim .email-split {
  direction: ltr;
}

html[dir="rtl"] #scrim .phone-local,
html[dir="rtl"] #scrim .email-local {
  text-align: left;
}

@media (max-width: 768px) {
  .ts-lang {
    padding: 2px;
  }

  .ts-lang button {
    padding: 6px 7px;
    font-size: 10px;
    letter-spacing: 0.04em;
  }

  #gbcs-popup-card,
  #scrim .modal {
    max-width: calc(100vw - 20px);
  }
}

@media (min-width: 769px) {
  .ts-lang button {
    padding: 7px 11px;
  }
}
