/**
 * Language Selector Component - icac_theme
 * Dropdown visual con banderas + motor Google Translate oculto.
 * Figma node: 22935:125810
 */

/* ============================================================
   Suprimir COMPLETAMENTE la barra de Google Translate
   Cubre todas las variantes de clase e inyecciones inline
   ============================================================ */

/* El iframe de la barra superior */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame {
  display: none !important;
  height: 0 !important;
  max-height: 0 !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  top: -9999px !important;
}

/* Neutralizar el body offset que Google inyecta con inline style */
body,
body.translated-ltr,
body.translated-rtl {
  top: 0 !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Widget oculto - posicionado fuera de pantalla para que pueda inicializar */
#google_translate_element {
  pointer-events: none !important;
  opacity: 0 !important;
}

/* ============================================================
   Wrapper
   ============================================================ */
.lang-selector {
  position: relative;
  display: inline-block;
  font-family: 'Inter', sans-serif;
}

/* ============================================================
   Trigger (botón cerrado)
   ============================================================ */
.lang-selector__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background-color: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  color: #0a0a0a;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  white-space: nowrap;
  transition: background-color 0.15s ease;
  text-decoration: none;
  outline: none;
}

.lang-selector__trigger:hover,
.lang-selector--open .lang-selector__trigger {
  background-color: #f5f5f5;
}

.lang-selector__trigger:focus-visible {
  box-shadow: 0 0 0 2px rgba(10, 10, 10, 0.12);
}

/* Bandera en el trigger */
.lang-selector__trigger-flag {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

/* Texto del idioma actual */
.lang-selector__trigger-text {
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-selector__item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Chevron */
.lang-selector__trigger-chevron {
  width: 10px;
  height: 6px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.lang-selector--open .lang-selector__trigger-chevron {
  transform: rotate(180deg);
}

/* ============================================================
   Panel del dropdown
   ============================================================ */
.lang-selector__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 167px;
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  padding: 4px;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.lang-selector--open .lang-selector__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ============================================================
   Lista de idiomas
   ============================================================ */
.lang-selector__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ============================================================
   Item de idioma
   ============================================================ */
.lang-selector__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 32px 6px 8px;
  border-radius: 2px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #0a0a0a;
  text-decoration: none;
  cursor: pointer;
  background-color: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: background-color 0.1s ease;
}

.lang-selector__item:hover {
  background-color: #f5f5f5;
}

.lang-selector__item:focus-visible {
  outline: 2px solid rgba(10, 10, 10, 0.12);
  outline-offset: -2px;
}

/* Item activo */
.lang-selector__item--active {
  background-color: #f5f5f5;
  border-radius: 6px;
  font-weight: 400;
}

/* Bandera en el item */
.lang-selector__item-flag {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
