/* =========================================================
   SELECTOR DE IDIOMA · ESTILO COMPARTIDO
   Úsalo junto con css/style.css o el <style> propio de cada
   página. Pensado para una .topbar con position: relative
   y 64px de alto (ajusta --lang-topbar-height si difiere).
   ========================================================= */

.languageSelector {
  position: absolute;
  right: 20px;
  top: 0;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 1002;
}

.languageFlag {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 50%;
  background: rgba(4, 17, 27, .72);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.languageFlag:hover {
  transform: translateY(-2px) scale(1.08);
  background: rgba(239, 24, 32, .25);
  border-color: rgba(255, 255, 255, .9);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .25);
}

.languageFlag.active {
  background: rgba(4, 17, 27, .92);
  border-color: #ef1820;
  box-shadow: 0 0 0 2px rgba(239, 24, 32, .55);
  transform: scale(1.08);
}

.languageFlag img {
  width: 18px;
  height: 13px;
  display: block;
  object-fit: cover;
  border-radius: 2px;
  pointer-events: none;
}

.languageFlag:focus-visible {
  outline: 2px solid #ffd000;
  outline-offset: 2px;
}

@media (max-width: 800px) {
  .languageSelector {
    position: fixed;
    right: 8px;
    top: 0;
  }

  .mainNav {
    padding-right: 260px;
  }
}
