/* ═══════════════════════════════════════════════════════════════════════
   drwCheck · language switcher (dropdown with flags)
   ═══════════════════════════════════════════════════════════════════════
   Styles of selector-idioma.js. Reusable in the public website and in the
   management app.

   Uses the tokens of temas.css when they exist (with fallbacks, so it also
   works on its own):
     --c-marca      colour of the button over the header (white on the
                    dark planner headers, grey on the original white one)
     --c-primario-suave, --a-texto, --a-radio, --a-radio-lg, --f-texto

   The menu is always light, like the Ant Design dropdown of planner,
   whatever the header colour is.
   ═══════════════════════════════════════════════════════════════════════ */

.vp-language {
  position: relative;
  display: inline-flex;
}

/* ── Button: current flag + caret ─────────────────────────────────────── */
.vp-language__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;             /* comfortable touch target on site */
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--a-radio, 6px);
  background: transparent;
  color: var(--c-marca, currentColor);
  font: inherit;
  cursor: pointer;
}
.vp-language__trigger:hover,
.vp-language__trigger[aria-expanded="true"] {
  background: rgba(127, 127, 127, .2);
}
.vp-language__trigger:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.vp-language__flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  font-size: 11px;             /* short label, when there is no flag */
  font-weight: 600;
  line-height: 1;
}
.vp-language__flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.vp-language__caret {
  width: 10px;
  height: 10px;
  opacity: .75;
  transition: transform .2s ease;
}
.vp-language__trigger[aria-expanded="true"] .vp-language__caret {
  transform: rotate(180deg);
}

/* ── List ─────────────────────────────────────────────────────────────── */
.vp-language__menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 4px);
  right: 0;
  min-width: 168px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #FFFFFF;
  color: var(--a-texto, rgba(0, 0, 0, .88));
  border-radius: var(--a-radio-lg, 8px);
  box-shadow: 0 6px 16px 0 rgba(0, 0, 0, .08),
              0 3px 6px -4px rgba(0, 0, 0, .12),
              0 9px 28px 8px rgba(0, 0, 0, .05);
}
.vp-language__menu[hidden] {
  display: none;
}

.vp-language__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--a-radio, 6px);
  background: transparent;
  color: inherit;
  font: 400 14px/1.5715 var(--f-texto, -apple-system, "Segoe UI", Roboto, sans-serif);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.vp-language__item:hover {
  background: rgba(0, 0, 0, .04);
}
.vp-language__item:focus-visible {
  outline: none;
  background: rgba(0, 0, 0, .04);
  box-shadow: inset 0 0 0 2px var(--c-primario, #1677FF);
}
/* Selected language: light tint of the theme colour, text stays dark
   (brand colours do not reach 4.5:1 as text). */
.vp-language__item[aria-checked="true"] {
  background: var(--c-primario-suave, #E6F4FF);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .vp-language__caret { transition: none; }
}
