/* ==========================================================================
   Translatepress Flags – Estilos do Widget
   ========================================================================== */

/* ---------- Anti-FOUC: oculta o widget até o JS inicializar ---------- */
.tpf-wrapper.tpf-loading {
  visibility: hidden;
  opacity: 0;
}

/* ---------- Transição suave ao revelar ---------- */
.tpf-wrapper {
  position: relative;
  display: inline-block;
  font-family: inherit;
  visibility: visible !important;
  opacity: 1 !important;
  transition: opacity 0.2s ease-in;
}

/* ---------- Botão principal ---------- */ 
button.tpf-current {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

button.tpf-current:hover{
  background: none !important;
  background-color: none !important;
}

/* Foco acessível */
button.tpf-current:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.tpf-current .tpf-flag {
  width: 32px;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
}

.tpf-current .tpf-caret {
  width: 14px;
  height: 14px;
  filter: invert(1) brightness(200);
  opacity: 1;
  transition: transform 0.2s ease;
}

/* Rotaciona a seta quando aberto */
.tpf-open .tpf-current .tpf-caret {
  transform: rotate(180deg);
}

/* ---------- Lista dropdown ---------- */
.tpf-list {
  position: absolute;
  top: -4px;
  left: -6px;
  z-index: 9999;
  min-width: 44px;
  margin: 0;
  padding: 0.2rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  display: none;
}

.tpf-open .tpf-list {
  display: block;
}

.tpf-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  cursor: pointer;
  user-select: none;
  justify-content: center;
}

.tpf-list li:hover,
.tpf-list li:focus-visible {
  background: #f6f7f9;
}

.tpf-list img {
  width: 32px;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
}
