/* Language picker — the invoice currency selector's shape: a trigger with the
   flag and the language's own name, and a panel of the rest under it. */

@layer components {
  .lang-select {
    max-inline-size: 22rem;
    position: relative;
  }

  .lang-select__trigger {
    align-items: center;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-ink-secondary);
    cursor: pointer;
    display: flex;
    gap: 0.5rem;
    inline-size: 100%;
    padding: 0.625rem 0.875rem;
  }

  .lang-select__trigger:focus-visible,
  .lang-select:has(.lang-select__menu:not([hidden])) .lang-select__trigger {
    border-color: var(--color-brand);
    box-shadow: var(--shadow-focus);
    outline: none;
  }

  .lang-select__flag {
    flex-shrink: 0;
    font-size: 1.125rem;
    line-height: 1;
  }

  .lang-select__name {
    color: var(--color-ink);
    font-size: 0.9375rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lang-select__chevron {
    color: var(--color-ink-muted);
    flex-shrink: 0;
    margin-inline-start: auto;
  }

  .lang-select__menu {
    inset-block-start: 100%;
    inset-inline-end: 0;
    inset-inline-start: 0;
    list-style: none;
    margin: 0.35rem 0 0;
  }

  .lang-select__menu li {
    list-style: none;
  }

  .lang-select__check {
    color: var(--color-brand);
    flex-shrink: 0;
    margin-inline-start: auto;
    visibility: hidden;
  }

  .lang-select__option[aria-selected="true"] .lang-select__check {
    visibility: visible;
  }
}
