/**
 * Language Dropdown - 5 Languages
 * Globe icon + current code, dropdown with native names
 */

/* =============================================================================
   LANGUAGE DROPDOWN TOGGLE (Globe + Current Code)
   ========================================================================== */

.stitch-lang-dropdown {
  position: relative;
}

.stitch-lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid #e8e0d8;
  border-radius: 20px;
  color: #3a3632;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.stitch-lang-toggle:hover {
  background: rgba(212, 228, 220, 0.2);
  border-color: #4c6358;
  color: #4c6358;
}

.stitch-lang-toggle svg:first-child {
  width: 18px;
  height: 18px;
  color: #6b6661;
}

.stitch-lang-toggle:hover svg:first-child {
  color: #4c6358;
}

.stitch-lang-current {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #3a3632;
}

.stitch-lang-toggle svg:last-child {
  width: 12px;
  height: 12px;
  color: #a8a199;
  transition: transform 0.2s ease;
}

.stitch-lang-toggle[aria-expanded="true"] svg:last-child {
  transform: rotate(180deg);
}

/* =============================================================================
   LANGUAGE DROPDOWN MENU
   ========================================================================== */

.stitch-lang-menu {
  min-width: 200px !important;
  padding: 8px !important;
  margin-top: 8px !important;
  background: #fff8f3 !important;
  border: 1px solid #e8e0d8 !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 16px rgba(107, 102, 97, 0.1) !important;
}

.stitch-lang-menu li {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.stitch-lang-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  background: transparent !important;
}

.stitch-lang-item:hover {
  background: rgba(212, 228, 220, 0.2) !important;
}

.stitch-lang-item.active {
  background: rgba(212, 228, 220, 0.3) !important;
}

/* Language Code Pill */
.stitch-lang-code-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  padding: 0 8px;
  background: transparent;
  border: 1.5px solid #4c6358;
  border-radius: 12px;
  color: #4c6358;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.stitch-lang-item:hover .stitch-lang-code-pill {
  background: #4c6358;
  color: #ffffff;
  border-color: #4c6358;
}

.stitch-lang-item.active .stitch-lang-code-pill {
  background: #4c6358;
  color: #ffffff;
  border-color: #4c6358;
}

/* Language Native Name */
.stitch-lang-name {
  flex: 1;
  color: #3a3632;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.stitch-lang-item:hover .stitch-lang-name {
  color: #4c6358;
}

.stitch-lang-item.active .stitch-lang-name {
  color: #4c6358;
  font-weight: 600;
}

/* =============================================================================
   MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 767px) {
  .stitch-lang-toggle {
    padding: 5px 10px;
    gap: 4px;
  }

  .stitch-lang-toggle svg:first-child {
    width: 16px;
    height: 16px;
  }

  .stitch-lang-current {
    font-size: 12px;
  }

  .stitch-lang-menu {
    min-width: 180px !important;
  }

  .stitch-lang-item {
    padding: 8px 10px !important;
    gap: 10px !important;
  }

  .stitch-lang-code-pill {
    min-width: 28px;
    height: 22px;
    font-size: 10px;
  }

  .stitch-lang-name {
    font-size: 13px;
  }
}

/* =============================================================================
   FIX UTF-8 DISPLAY (No Mojibake)
   ========================================================================== */

.stitch-lang-name {
  /* Ensure proper UTF-8 rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Force proper character encoding for Cyrillic and Baltic */
.stitch-lang-item[href*="ru-ru"] .stitch-lang-name,
.stitch-lang-item[href*="lt-lt"] .stitch-lang-name,
.stitch-lang-item[href*="lv-lv"] .stitch-lang-name,
.stitch-lang-item[href*="et-ee"] .stitch-lang-name {
  font-feature-settings: normal;
}
