/* Country and city controls: the searchable city pill and its list. Matches the other filter pills. */

/* The real select keeps the value for the code that reads it; the pill is what people use. */
#cityFilter.nx-geo-native { display: none !important; }

/* Long country names must not stretch the pill. */
#mkHomeFilters #countryFilter, .country-select-wrap #countryFilter { max-width: 210px; text-overflow: ellipsis; }

/* In the header (pages other than home): same look as the country select beside it. */
.country-select-wrap .nx-geo-trigger {
  min-width: 120px;
  max-width: 200px;
  padding: 4px 26px 4px 10px;
  border-radius: 40px;
  border: 1px solid var(--border);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236b7a8a' d='M5 7L1 3h8z'/%3E%3C/svg%3E") no-repeat right 8px center;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--nx-ink, var(--text));
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* In the home filter row: the pill style of the other filters. */
#mkHomeFilters .nx-geo-trigger {
  min-height: 44px;
  min-width: 0;
  max-width: 240px;
  padding: 0 40px 0 18px;
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-pill);
  background: var(--nx-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236B6660' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right 16px center;
  color: var(--nx-ink);
  font-size: 14px;
  font-weight: 500;
  transition: border-color var(--nx-speed), color var(--nx-speed);
}
.nx-geo-trigger:focus-visible { outline: 2px solid var(--nx-orange, #E8590C); outline-offset: 2px; }
#mkHomeFilters .nx-geo-trigger:focus, #mkHomeFilters .nx-geo-trigger.mk-active, #mkHomeFilters .nx-geo-trigger.is-open { border-color: var(--nx-orange); color: var(--nx-orange); }
.country-select-wrap .nx-geo-trigger.mk-active, .country-select-wrap .nx-geo-trigger.is-open { border-color: var(--orange); }
.nx-geo-trigger:disabled { cursor: not-allowed; opacity: 0.6; }
body.dark .country-select-wrap .nx-geo-trigger { color: var(--input-text, #EDE6DC); }

/* The list */
.nx-geo-pop {
  position: fixed;
  z-index: 10040;
  display: flex;
  flex-direction: column;
  max-height: min(360px, 60vh);
  border: 1px solid var(--border, #E2DBD1);
  border-radius: 16px;
  background: var(--card, #fff);
  box-shadow: 0 12px 36px rgba(28, 28, 28, 0.16);
  overflow: hidden;
  font-size: 14px;
  color: var(--nx-ink, #1C1C1C);
}
body.dark .nx-geo-pop { color: var(--input-text, #EDE6DC); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5); }
.nx-geo-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border, #E2DBD1); color: var(--text-muted, #6B6660); }
.nx-geo-search input { flex: 1; min-width: 0; min-height: 36px; border: 0; outline: none; background: transparent; font: inherit; color: inherit; }
.nx-geo-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.nx-geo-list li { padding: 9px 12px; border-radius: 10px; cursor: pointer; line-height: 1.3; }
.nx-geo-list li.is-active { background: var(--hover-bg, rgba(232, 89, 12, 0.08)); }
.nx-geo-list li[aria-selected="true"] { color: var(--nx-orange, #E8590C); font-weight: 600; }
.nx-geo-list li.nx-geo-empty { cursor: default; color: var(--text-muted, #6B6660); }
.nx-geo-more { margin: 0; padding: 8px 14px 10px; border-top: 1px solid var(--border, #E2DBD1); font-size: 12px; color: var(--text-muted, #6B6660); }
.nx-geo-more[hidden] { display: none; }

/* The sell form's country list looks like its other fields. */
#sellCountry { width: 100%; }

/* Phones and small tablets: the header row has to fit, so the place filters stay compact there. */
@media (max-width: 768px) {
  nav .country-select-wrap #countryFilter { min-width: 80px; max-width: 112px; }
  nav .country-select-wrap .nx-geo-trigger { min-width: 80px; max-width: 124px; font-size: 0.7rem; }
}

/* The smallest phones (320 px): the header row was 4 px too wide, so the whole page scrolled sideways. */
@media (max-width: 340px) {
  nav .country-select-wrap #countryFilter { min-width: 72px; max-width: 96px; }
  nav .country-select-wrap .nx-geo-trigger { min-width: 72px; max-width: 104px; }
}
