/**
 * ADVANS — Language selector styles
 * assets/styles/lang.css
 */
@import url('flag-icons/flag-icons-local.min.css');

/* ── Container ──────────────────────────────────────────────────────────────── */
.lang-selector {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* ── Toggle button ─────────────────────────────────────────────────────────── */
.lang-sel__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 9px;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.lang-sel__btn:hover,
.lang-selector.is-open .lang-sel__btn {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(255, 255, 255, 0.45);
}

.lang-sel__flag {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  line-height: 1;
  font-size: 1rem;   /* base para fi */
}
.lang-sel__code { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

.lang-sel__arrow {
  opacity: 0.7;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.lang-selector.is-open .lang-sel__arrow {
  transform: rotate(180deg);
}

/* ── Dropdown list ─────────────────────────────────────────────────────────── */
.lang-sel__list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.10);
  list-style: none;
  margin: 0;
  min-width: 170px;
  padding: 6px;
  z-index: 9999;
}

.lang-selector.is-open .lang-sel__list {
  display: block;
  animation: langDropIn 0.15s ease;
}

@keyframes langDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Dropdown items ────────────────────────────────────────────────────────── */
.lang-sel__item {
  align-items: center;
  border-radius: 6px;
  color: #1f2937;
  display: flex;
  gap: 8px;
  padding: 7px 12px;
  text-decoration: none;
  transition: background 0.15s;
}

.lang-sel__item:hover {
  background: #f0f4f8;
  color: #002D57;
}

.lang-sel__item.is-active {
  background: #eef2ff;
  color: #002D57;
  font-weight: 700;
}

/* Code label (EN, FR…) — bold, fixed width so names align */
.lang-sel__item-code {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  min-width: 1.8em;
  text-transform: uppercase;
}

/* Full name — secondary, dimmed */
.lang-sel__item-name {
  font-size: 0.8rem;
  font-weight: 400;
  color: #6b7280;
  flex: 1;
}

.lang-sel__item.is-active .lang-sel__item-name {
  color: #374151;
  font-weight: 600;
}

/* ── Inside nav-links row (header-bottom) ───────────────────────────────────── */
.nav-links .lang-selector {
  margin-left: auto;
}

/* Adjust button when inside the dark header-bottom bar */
.header-bottom .lang-sel__btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.20);
  color: #fff;
}
.header-bottom .lang-sel__btn:hover,
.header-bottom .lang-selector.is-open .lang-sel__btn {
  background: rgba(255, 255, 255, 0.18);
}

/* Adjust button in the header-actions row (light backgrounds) */
.header-actions .lang-selector {
  margin-left: 4px;
}
.header-actions .lang-sel__btn {
  background: rgba(0, 45, 87, 0.07);
  border-color: rgba(0, 45, 87, 0.20);
  color: #002D57;
}
.header-actions .lang-sel__btn:hover {
  background: rgba(0, 45, 87, 0.12);
}

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .lang-sel__list {
    right: 0;
    left: auto;
    min-width: 150px;
  }
}
