/* ==========================================================
   SELETOR DE IDIOMAS (I18N) - ESTILO LISTA VERTICAL ESCURA
   Layout idêntico à referência: Bandeiras Reais + Nome Nativo
   ========================================================== */

.lang-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  user-select: none;
  z-index: 1000;
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* BOTÃO DE DISPARO NO CABEÇALHO */
.lang-dropdown-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(23, 27, 38, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
  padding: 6px 13px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  line-height: 1;
}

.lang-dropdown-btn:hover {
  background: rgba(35, 42, 58, 0.95);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.lang-dropdown-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 16px;
  flex-shrink: 0;
}

.lang-flag-img {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  display: block;
}

.lang-globe-icon {
  width: 18px;
  height: 18px;
  color: #94a3b8;
  display: block;
}

.lang-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
}

.lang-caret {
  transition: transform 0.22s ease;
  color: #94a3b8;
  flex-shrink: 0;
}

.lang-dropdown-wrapper.open .lang-caret {
  transform: rotate(180deg);
}

/* MENU SUSPENSO VERTICAL ESCURO (EXATAMENTE COMO NA FOTO) */
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 235px;
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #171b26;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), 0 4px 14px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  pointer-events: none;
  z-index: 1001;
}

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

/* BARRA DE ROLAGEM ELEGANTE */
.lang-dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.lang-dropdown-menu::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}

.lang-dropdown-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.lang-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

/* ITENS DO MENU (BANDEIRA + TEXTO NATIVO LADO A LADO) */
.lang-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1.25;
}

.lang-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.lang-dropdown-item.active {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  font-weight: 700;
}

.lang-item-flag {
  width: 22px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lang-item-name {
  display: inline-block;
  color: inherit;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-dropdown-item:hover .lang-globe-icon {
  color: #ffffff;
}

.lang-dropdown-item.active .lang-globe-icon {
  color: #38bdf8;
}

@media (max-width: 640px) {
  .lang-name {
    display: none;
  }
  .lang-dropdown-btn {
    padding: 6px 10px;
  }
}
