#fvt-floating {
  position: fixed;
  left: 18px;
  right: auto;
  bottom: 18px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#fvt-btn {  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  cursor: pointer;
  background: #fff;
  color: #111;
  font-size: 14px;
}

#fvt-panel {
  /* Keep the button fixed in place; the panel must not change layout */
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  margin-top: 0;
  width: 260px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  overflow: hidden;
  display: none;
}

#fvt-panel.open { display: block; }

#fvt-panel .row {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 8px;
}

#fvt-panel select {
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);
}

#fvt-hint {
  font-size: 12px;
  opacity: 0.75;
  padding: 10px 12px;
  line-height: 1.35;
  white-space: pre-line;
}

.fvt-toast {
  position: fixed;
  left: 18px;
  right: auto;
  bottom: 82px;
  z-index: 999999;
  background: #111;
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  transition: 180ms ease;
  max-width: 320px;
}
.fvt-toast.show {
  opacity: 1;
  transform: translateY(0);
}


/* Language selector with flags */
#fvt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
}

#fvt-btn .fvt-flag {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.04);
}

#fvt-btn .fvt-flag img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#fvt-btn .fvt-label {
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

#fvt-btn .fvt-caret { color: #111; }

#fvt-panel {
  width: 520px;
  max-width: calc(100vw - 40px);
  max-height: min(70vh, 520px);
  overflow: auto;
}

.fvt-lang-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 560px) {
  #fvt-panel { width: 360px; }
  .fvt-lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.fvt-lang-item {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fvt-lang-item:hover {
  background: rgba(0,0,0,0.04);
}

.fvt-lang-item .fvt-flag {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.06);
}

.fvt-lang-item .fvt-name {
  font-size: 16px;
}

.fvt-lang-item.is-active .fvt-name {
  font-weight: 600;
}

.fvt-sep {
  border-top: 1px solid rgba(0,0,0,0.06);
}

.fvt-flag svg{width:100%;height:100%;display:block;}

/* Editor click-mode buttons */
#fvt-mode-wrap {
  margin-top: 10px;
}
#fvt-mode-label {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 6px;
}
.fvt-mode-row {
  display: flex;
  gap: 6px;
}
.fvt-mode-btn {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.fvt-mode-btn.active {
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08) inset;
}

/* =========================================================
   FVT THEME-PROOF FLOATING LANGUAGE MENU
   Keeps the selector colors/design consistent on every theme.
   Added to prevent WordPress themes from overriding button styles.
   ========================================================= */
#fvt-floating,
#fvt-floating *,
#fvt-floating *::before,
#fvt-floating *::after {
  box-sizing: border-box !important;
}

#fvt-floating {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  color: #111111 !important;
  background: transparent !important;
  isolation: isolate !important;
}

#fvt-floating button,
#fvt-floating button:hover,
#fvt-floating button:focus,
#fvt-floating button:active {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  line-height: normal !important;
  outline: none !important;
  transform: none !important;
  text-decoration: none !important;
  background-image: none !important;
}

#fvt-floating #fvt-btn,
#fvt-floating #fvt-btn:hover,
#fvt-floating #fvt-btn:focus,
#fvt-floating #fvt-btn:active {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111111 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
  padding: 10px 14px !important;
  min-height: auto !important;
  min-width: auto !important;
  width: auto !important;
  height: auto !important;
  cursor: pointer !important;
}

#fvt-floating #fvt-btn .fvt-label,
#fvt-floating #fvt-btn .fvt-caret {
  color: #111111 !important;
  font-weight: 400 !important;
}

#fvt-floating #fvt-panel {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111111 !important;
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18) !important;
}

#fvt-floating .fvt-lang-grid {
  background: #ffffff !important;
}

#fvt-floating .fvt-lang-item,
#fvt-floating .fvt-lang-item:visited,
#fvt-floating .fvt-lang-item:hover,
#fvt-floating .fvt-lang-item:focus,
#fvt-floating .fvt-lang-item:active {
  appearance: none !important;
  -webkit-appearance: none !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  color: #111111 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  text-align: left !important;
  text-decoration: none !important;
  padding: 12px 14px !important;
  margin: 0 !important;
  min-height: auto !important;
  cursor: pointer !important;
}

#fvt-floating .fvt-lang-item:hover,
#fvt-floating .fvt-lang-item:focus {
  background: #f5f5f5 !important;
  background-color: #f5f5f5 !important;
  color: #111111 !important;
}

#fvt-floating .fvt-lang-item .fvt-name,
#fvt-floating .fvt-lang-item:hover .fvt-name,
#fvt-floating .fvt-lang-item:focus .fvt-name,
#fvt-floating .fvt-lang-item:active .fvt-name {
  color: #111111 !important;
  font-size: 16px !important;
}

#fvt-floating .fvt-lang-item.is-active,
#fvt-floating .fvt-lang-item.is-active:hover,
#fvt-floating .fvt-lang-item.is-active:focus {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111111 !important;
}

#fvt-floating .fvt-lang-item.is-active .fvt-name {
  color: #111111 !important;
  font-weight: 600 !important;
}

#fvt-floating .fvt-flag {
  background: rgba(0, 0, 0, 0.04) !important;
  border: 0 !important;
  box-shadow: none !important;
}

#fvt-floating .fvt-flag img,
#fvt-floating .fvt-flag svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

#fvt-floating .fvt-sep,
#fvt-floating #fvt-panel .row {
  border-color: rgba(0, 0, 0, 0.06) !important;
  background: #ffffff !important;
}

#fvt-floating #fvt-hint {
  background: #ffffff !important;
  color: #667085 !important;
  opacity: 1 !important;
}

#fvt-floating select,
#fvt-floating input,
#fvt-floating textarea {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111111 !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

#fvt-floating .fvt-mode-btn,
#fvt-floating .fvt-mode-btn:hover,
#fvt-floating .fvt-mode-btn:focus,
#fvt-floating #fvt-auto-btn,
#fvt-floating #fvt-auto-btn:hover,
#fvt-floating #fvt-auto-btn:focus {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111111 !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}


/* =========================================================
   FVT LAYOUT TWEAKS
   Fix flag vertical alignment and add more space between flag and language name.
   ========================================================= */
#fvt-floating #fvt-btn,
#fvt-floating .fvt-lang-item {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  line-height: 1.2 !important;
}

#fvt-floating #fvt-btn .fvt-flag,
#fvt-floating .fvt-lang-item .fvt-flag {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}

#fvt-floating #fvt-btn .fvt-label,
#fvt-floating .fvt-lang-item .fvt-name {
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}

#fvt-floating #fvt-btn .fvt-caret {
  align-self: center !important;
}
