/* ========================================================
   דרך ארץ גרופ — תמיכה בריבוי שפות (עברית, אנגלית, צרפתית, רוסית)
   Derech Eretz Group — Multilingual System (HE / EN / FR / RU)
   ======================================================== */

/* Language Switcher Component */
.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-inline: 8px;
  z-index: 50;
  font-family: inherit;
}

.lang-current-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid rgba(16, 47, 83, 0.14);
  border-radius: 9999px;
  color: var(--navy, #102f53);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(10, 36, 62, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  min-height: 36px;
}

.lang-current-btn:hover {
  background: #f4faff;
  border-color: #08b4de;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(8, 180, 222, 0.16);
}

.lang-current-btn:active {
  transform: scale(0.98);
}

.lang-current-btn:focus-visible {
  outline: 3px solid #0089ba;
  outline-offset: 2px;
}

/* Authentic Flag Badge */
.lang-flag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 15px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  vertical-align: middle;
  background-color: #f1f5f9;
  box-shadow: 0 0 0 1px rgba(16, 47, 83, 0.14), 0 1px 2px rgba(10, 36, 62, 0.06);
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.lang-flag-badge svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.lang-code {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #102f53;
  line-height: 1;
}

.lang-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #617d96;
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), color 0.2s ease;
}

.lang-switch.is-open .lang-arrow {
  transform: rotate(180deg);
  color: #08b4de;
}

/* Floating Dropdown Card */
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 185px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 47, 83, 0.12);
  border-radius: 14px;
  box-shadow: 0 16px 36px -4px rgba(10, 36, 62, 0.16), 0 4px 12px rgba(10, 36, 62, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 6px;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.32, 0.72, 0, 1), transform 0.2s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.2s;
}

.lang-switch.is-open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.lang-option:hover,
.lang-option:focus {
  background: #f0f8fd;
  outline: none;
}

.lang-option:hover .lang-flag-badge,
.lang-option:focus .lang-flag-badge {
  transform: scale(1.06);
  box-shadow: 0 0 0 1px rgba(8, 180, 222, 0.4), 0 2px 6px rgba(8, 180, 222, 0.15);
}

.lang-option:hover .lang-name,
.lang-option:focus .lang-name {
  color: #088eb1;
}

.lang-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #102f53;
  flex: 1;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.lang-badge-code {
  font-size: 10px;
  font-weight: 700;
  color: #64819a;
  background: #edf4f8;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.lang-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: #08b4de;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.lang-option.is-selected {
  background: #e5f5fc;
}

.lang-option.is-selected .lang-name {
  color: #058bb0;
  font-weight: 700;
}

.lang-option.is-selected .lang-badge-code {
  background: #08b4de;
  color: #ffffff;
}

.lang-option.is-selected .lang-check {
  opacity: 1;
  transform: scale(1);
}

/* ========================================================
   LTR LAYOUT OVERRIDES (English, French, Russian)
   ======================================================== */

html[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] body {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .skip {
  right: auto;
  left: 20px;
}

html[dir="ltr"] .hero-copy,
html[dir="ltr"] .hero .hero-copy {
  direction: ltr;
  text-align: center;
  left: auto;
  right: auto;
  align-items: center;
  justify-content: center;
}

html[dir="ltr"] .hero-actions,
html[dir="ltr"] .hero .hero-actions {
  direction: ltr;
  justify-content: center;
}

html[dir="ltr"] .hero-actions .button {
  direction: ltr;
}

html[dir="ltr"] .hero-actions .button span {
  display: inline-block;
}

html[dir="ltr"] .header-cta span {
  display: inline-block;
}

html[dir="ltr"] .text-link span {
  display: inline-block;
}

html[dir="ltr"] .trust-item {
  direction: ltr;
  border-right: 0;
  border-left: 1px solid var(--border);
}

html[dir="ltr"] .sell-content {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .sell-photo {
  background-position: right 54%;
}

html[dir="ltr"] .sell:after {
  background: linear-gradient(270deg, transparent 0%, #f3faff45 20%, #f3faffe8 36%, #f3faff 53%);
}

html[dir="ltr"] .footer-main {
  direction: ltr;
}

html[dir="ltr"] .footer-main > div {
  direction: ltr;
  text-align: left;
  border-inline-start: 1px solid #d4e9f2;
}

html[dir="ltr"] .footer-main > div:first-child {
  border: 0;
}

html[dir="ltr"] .footer-brand .identity {
  direction: ltr;
}

html[dir="ltr"] .footer-brand .identity > span {
  direction: ltr;
}

html[dir="ltr"] .footer-contact > a[dir="ltr"] {
  text-align: left;
}

html[dir="ltr"] .footer-statement {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .footer-statement p {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .vehicle-card {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .vehicle-copy {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .vehicle-copy h3 {
  padding-right: 0;
  padding-left: 45px;
}

html[dir="ltr"] .vehicle-copy .round {
  right: auto;
  left: 20px;
}

html[dir="ltr"] .vehicle-meta {
  direction: ltr;
}

html[dir="ltr"] .vehicle-meta span + span {
  border-left: 0;
  border-right: 1px solid #a2cde1;
  padding-left: 0;
  padding-right: 18px;
}

html[dir="ltr"] .page-shell {
  direction: ltr;
}

html[dir="ltr"] .page-hero-copy {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .page-story {
  text-align: left;
}

html[dir="ltr"] .step-card {
  text-align: left;
}

html[dir="ltr"] .page-faq {
  text-align: left;
}

html[dir="ltr"] .page-form {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .field-grid input {
  text-align: left;
}

html[dir="ltr"] .calculator-layout {
  direction: ltr;
}

html[dir="ltr"] .result-value {
  text-align: left;
}

html[dir="ltr"] .vehicle-lookup-layout {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .vehicle-lookup-result dd {
  text-align: right;
}

html[dir="ltr"] .showcase-card h3 {
  text-align: left;
}

html[dir="ltr"] .showcase-card > a {
  direction: ltr;
}

html[dir="ltr"] .showcase-card > a span {
  transform: rotate(180deg);
  display: inline-block;
}

html[dir="ltr"] .page-cta .button span {
  display: inline-block;
}

html[dir="ltr"] .breadcrumbs span[aria-hidden="true"] {
  transform: scaleX(-1);
  display: inline-block;
}

@media (max-width: 850px) {
  .lang-switch {
    margin-inline: 4px;
  }
  .lang-current-btn {
    padding: 4px 8px;
    gap: 6px;
    font-size: 12px;
    min-height: 32px;
  }
  .lang-flag-badge {
    width: 20px;
    height: 14px;
  }
  .lang-menu {
    min-width: 170px;
  }
}
