/* -------------------------------------------------------- */
/* 🔹 Country Selector                                      */
/* -------------------------------------------------------- */
/* Flag button opening a menu of the supported countries.    */
/* Built on <details>, so it opens and closes without JS —   */
/* the page module only adds outside-click and Escape        */

.country-selector {
  position: relative;
}

.country-selector__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  height: 44px;
  padding: 0 var(--space-m);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-medium);
  color: var(--color-on-surface-variant);
  cursor: pointer;
  list-style: none;
}

/* Hides the default disclosure triangle */
.country-selector__trigger::-webkit-details-marker {
  display: none;
}

.country-selector__trigger:hover {
  background-color: var(--color-press-highlight);
}

.country-selector__chevron {
  display: block;
  transition: transform 0.15s ease;
}

.country-selector[open] .country-selector__chevron {
  transform: rotate(180deg);
}

.country-selector__menu {
  position: absolute;
  top: calc(100% + var(--space-xs));
  right: 0;
  min-width: 180px;
  padding: var(--space-xxs) 0;
  background-color: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow);
  z-index: 200;
}

.country-selector__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-l);
  padding: var(--space-s) var(--space-m);
  font-size: var(--text-body-medium);
  color: var(--color-on-surface);
  text-decoration: none;
  white-space: nowrap;
}

a.country-selector__option:hover {
  background-color: var(--color-scaffold-bg);
  text-decoration: none;
}

.country-selector__option--selected {
  color: var(--color-primary);
}
