/* GhostSignal i18n — language switcher + RTL overrides */

.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 14px;
  z-index: 200;
  flex-shrink: 0;
}

.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--border, #d8d4b8);
  border-radius: 50px;
  padding: 8px 12px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #2a3a1f);
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  min-height: 40px;
}
.lang-current:hover,
.lang-current:focus-visible {
  border-color: var(--leaf, #6ba368);
  background: rgba(255,255,255,0.98);
  outline: none;
}
.lang-current .lang-flag { font-size: 15px; line-height: 1; }
.lang-current .lang-label {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.lang-current .lang-chevron { font-size: 10px; opacity: 0.65; margin-left: 2px; }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  background: #fff;
  border: 1px solid var(--border, #d8d4b8);
  border-radius: 14px;
  padding: 8px;
  min-width: 180px;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  box-shadow: 0 12px 40px rgba(31, 58, 15, 0.18);
  display: none;
  flex-direction: column;
  gap: 2px;
  max-height: min(360px, 70vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 300;
}
.lang-dropdown.open { display: flex; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  color: var(--text, #2a3a1f);
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px; /* touch target */
  -webkit-tap-highlight-color: transparent;
}
.lang-option:hover,
.lang-option:focus-visible { background: var(--cream-2, #f3eedd); outline: none; }
.lang-option .lang-flag { font-size: 16px; }
.lang-option .lang-label { flex: 1; }
.lang-option.active {
  background: var(--sage-pale, #d8e6c8);
  font-weight: 600;
}

/* Mobile: keep switcher fully on-screen; dropdown tappable below switcher */
@media (max-width: 900px) {
  .lang-switcher {
    margin-left: 8px;
    position: relative;
  }
  .lang-current {
    padding: 8px 11px;
    font-size: 12px;
    min-height: 40px;
  }
  .lang-current .lang-label {
    max-width: 64px;
  }
  .lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 180px;
    width: max-content;
    max-width: calc(100vw - 24px);
    max-height: min(360px, 70vh);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 12px 40px rgba(31, 58, 15, 0.22);
    z-index: 300;
  }
  .lang-option {
    padding: 12px 14px;
    font-size: 15px;
    min-height: 48px;
  }
}

/* Backdrop when open (mobile) */
.lang-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31, 58, 15, 0.28);
  z-index: 9998;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.lang-backdrop.open { display: block; }
@media (min-width: 901px) {
  .lang-backdrop { display: none !important; }
}

/* Google Translate cleanup */
.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }
.goog-te-gadget { display: none !important; }

/* RTL */
html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .container,
html[dir="rtl"] nav .container,
html[dir="rtl"] .hero .container,
html[dir="rtl"] footer .container { direction: rtl; }
html[dir="rtl"] .hero h1,
html[dir="rtl"] .hero p.lead,
html[dir="rtl"] .section-head,
html[dir="rtl"] .section-head h2,
html[dir="rtl"] .section-head .section-sub { text-align: right; }
html[dir="rtl"] .cta,
html[dir="rtl"] .hero-meta { justify-content: flex-start; }
html[dir="rtl"] .features .feature,
html[dir="rtl"] .step,
html[dir="rtl"] .plan,
html[dir="rtl"] .testimonial,
html[dir="rtl"] .download-card,
html[dir="rtl"] .faq-item { text-align: right; }
html[dir="rtl"] .plan ul li { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .testimonial .author { flex-direction: row-reverse; }
html[dir="rtl"] .faq-q { flex-direction: row-reverse; }
html[dir="rtl"] .note-box { flex-direction: row-reverse; }
html[dir="rtl"] .badge-card { direction: rtl; }
html[dir="rtl"] .lang-switcher { margin-left: 0; margin-right: 14px; }
html[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
@media (max-width: 900px) {
  html[dir="rtl"] .lang-dropdown {
    left: 12px !important;
    right: 12px !important;
  }
}

html[dir="rtl"].lang-ar,
html[dir="rtl"].lang-ar body {
  font-family: 'Inter', 'Noto Sans Arabic', 'Tahoma', system-ui, sans-serif;
}
html[dir="rtl"].lang-ar h1,
html[dir="rtl"].lang-ar h2,
html[dir="rtl"].lang-ar h3,
html[dir="rtl"].lang-ar .font-display,
html[dir="rtl"].lang-ar .section h2,
html[dir="rtl"].lang-ar .hero h1,
html[dir="rtl"].lang-ar .feature h3,
html[dir="rtl"].lang-ar .step h3,
html[dir="rtl"].lang-ar .plan h3,
html[dir="rtl"].lang-ar .download-card h3 {
  font-family: 'Playfair Display', 'Noto Naskh Arabic', 'Tahoma', serif;
}
