/* Bayraklı dil seçici açılır menü. Header tasarımıyla uyumlu, kompakt. */
.lang-switch {
  position: relative;
  display: inline-block;
  font-family: inherit;
  z-index: 1000;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid #e3e3e3;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  color: #222;
  line-height: 1;
  transition: border-color .2s, box-shadow .2s;
  white-space: nowrap;
}
.lang-current:hover { border-color: #c0392b; }
.lang-switch.open .lang-current { border-color: #c0392b; box-shadow: 0 0 0 2px rgba(192,57,43,.12); }

.lang-flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06);
  flex: none;
  display: block;
}

.lang-current .lang-name { font-weight: 600; }

.lang-caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #c0392b;
  margin-left: 2px;
  transition: transform .2s;
}
.lang-switch.open .lang-caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  max-height: 340px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.lang-switch.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-menu li { margin: 0; padding: 0; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  white-space: nowrap;
  transition: background .15s;
}
.lang-option:hover { background: #f5f5f5; }
.lang-option.active { background: #fbeae8; color: #c0392b; font-weight: 700; }
.lang-option .lang-name { line-height: 1.2; }

/* RTL: menüyü sola hizala, içerikleri ters çevir */
[dir="rtl"] .lang-menu { right: auto; left: 0; }
[dir="rtl"] .lang-caret { margin-left: 0; margin-right: 2px; }

/* Mobil görünümde de düzgün dursun */
@media (max-width: 768px) {
  .lang-menu { min-width: 170px; max-height: 60vh; }
}
