/* ==========================================================================
   Globality International — Control Flotante Tipo Bandera (Language Switcher)
   Diseñado para convivir armoniosamente con la interfaz de Globality.
   ========================================================================== */

.globality-lang-wrap {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Botón flotante tipo píldora / bandera */
.globality-lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 14, 38, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  padding: 8px 14px 8px 10px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.18);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.globality-lang-btn:hover {
  background: rgba(15, 23, 52, 0.95);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 25px rgba(99, 102, 241, 0.35);
}

.globality-lang-btn:active {
  transform: translateY(0) scale(0.97);
}

/* Bandera destacada */
.globality-lang-flag {
  font-size: 1.45rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Código del idioma activo */
.globality-lang-code {
  letter-spacing: 0.05em;
  font-size: 0.82rem;
  color: #f1f5f9;
  text-transform: uppercase;
}

/* Flechita / Chevron */
.globality-lang-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.65;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.globality-lang-wrap.is-open .globality-lang-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Menú desplegable flotante */
.globality-lang-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  min-width: 230px;
  background: rgba(11, 16, 38, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transform-origin: bottom left;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

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

/* Cabecera del menú */
.globality-lang-menu-head {
  padding: 8px 12px 6px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 4px;
}

.globality-lang-menu-head span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Opción individual de idioma */
.globality-lang-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.globality-lang-opt:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

.globality-lang-opt.is-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.2));
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

.globality-lang-opt-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.globality-lang-opt-flag {
  font-size: 1.35rem;
  line-height: 1;
}

.globality-lang-opt-name {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.globality-lang-opt-name strong {
  font-size: 0.86rem;
  font-weight: 700;
}

.globality-lang-opt-name small {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 500;
}

.globality-lang-opt.is-active .globality-lang-opt-name small {
  color: #a5b4fc;
}

/* Marca de selección (Checkmark) */
.globality-lang-check {
  display: none;
  color: #22c55e;
  font-size: 0.88rem;
}

.globality-lang-opt.is-active .globality-lang-check {
  display: inline-block;
}

/* Badge de escala internacional */
.globality-lang-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Transición suave al cambiar textos */
.gl-translating {
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

/* Ajustes Responsive / Móvil */
@media (max-width: 768px) {
  .globality-lang-wrap {
    bottom: 84px;
    left: 14px;
  }

  .globality-lang-btn {
    padding: 7px 12px 7px 9px;
    font-size: 0.8rem;
  }

  .globality-lang-flag {
    font-size: 1.3rem;
  }

  .globality-lang-menu {
    min-width: 215px;
    bottom: calc(100% + 8px);
  }
}

/* Si la vista está en un iframe o modal, mantener escala compacta */
.in-modal .globality-lang-wrap,
.is-modal-view .globality-lang-wrap {
  bottom: 16px;
  left: 16px;
}
