/* Hide server-rendered template containers; JS moves their children into place */
#nabcep-lang-dropdown-template,
#nabcep-lang-dropdown-mobile-template {
  display: none;
}

.stm_mobile__header > .container > .stm_flex {
  flex-direction: row !important;
  justify-content: space-between;
  padding-right: 50px;
  gap: 1rem;
}

.custom-g-dropdown {
  position: relative;
  cursor: pointer;
}

/* ── Selected (trigger) area ── */
.custom-g-dropdown__selected {
  height: 38px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.custom-g-dropdown__selected::after {
  content: "\f0d7";
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", dashicons;
  font-weight: 700;
  color: #333333;
  transition: transform 0.25s ease;
}

.custom-g-dropdown.open .custom-g-dropdown__selected::after {
  transform: rotate(180deg);
}

/* Trigger button – no GTranslate involvement, just shows the active flag */
.custom-g-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 28px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.custom-g-dropdown__trigger > img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* ── Options panel ── */
.custom-g-dropdown__options {
  position: absolute;
  top: 38px;
  right: 0;
  height: 0;
  width: 0;
  opacity: 0;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 9999;
}

.custom-g-dropdown.open .custom-g-dropdown__options {
  min-height: 82px;
  height: auto;
  width: 160px;
  opacity: 1;
  visibility: visible;
  transition: all 0.25s ease-in-out;
}

/* Option links */
.custom-g-dropdown__options > a {
  display: grid;
  grid-template-columns: 50px auto 40px;
  gap: 2px;
  opacity: 0;
  height: 41px;
  width: 100%;
  color: #333333;
  font-size: 13px;
  font-weight: 500;
  align-items: center;
  transform: translateX(-70px);
  text-decoration: none;
  padding: 5px;
}

.custom-g-dropdown.open .custom-g-dropdown__options > a {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out;
}

.custom-g-dropdown__options > a.selected::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", dashicons;
  font-weight: 700;
  justify-self: center;
}

.custom-g-dropdown__options > a:hover {
  text-decoration: none;
  background-color: #f2f2f2;
  color: #333333;
}

/* Flag images from GTranslate shortcode output */
.custom-g-dropdown__options > a > img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  justify-self: center;
}

/* ── Mobile variant ── */
/* Align the panel to the left of the trigger so it doesn't clip off the
   right edge of the screen (trigger sits just left of the hamburger). */
.custom-g-dropdown--mobile {
  margin-right: 8px;
  margin-top: 2px;
}
