/* Searchable country select (combobox over a native <select>) */
.country-select-wrap {
  position: relative;
  width: 100%;
}

.country-select-wrap > select.country-select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.country-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  height: var(--input-height-md, 2.75rem);
  padding: 0 var(--space-4, 1rem);
  box-sizing: border-box;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-family-primary, inherit);
  font-size: var(--font-size-base, 1rem);
  color: var(--color-gray-900, #111827);
  background: var(--bg-primary, #fff);
  border: var(--border-width-medium, 1px) solid var(--border-color-light, #d1d5db);
  border-radius: var(--radius-md, 0.5rem);
  appearance: none;
  -webkit-appearance: none;
  transition: var(--transition-colors, border-color 0.15s ease), var(--transition-shadow, box-shadow 0.15s ease);
}

.country-select-trigger:hover {
  border-color: var(--border-color-default, #9ca3af);
}

.country-select-wrap.is-open .country-select-trigger,
.country-select-trigger:focus {
  outline: none;
  border-color: var(--color-primary-500, #3b82f6);
  box-shadow: var(--shadow-focus, 0 0 0 3px rgba(59, 130, 246, 0.25));
}

.country-select-trigger .country-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-select-trigger .country-select-value.is-placeholder {
  color: #9ca3af;
}

.country-select-trigger .country-select-chevron {
  flex-shrink: 0;
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: rotate(45deg);
  margin-top: -0.2rem;
  transition: transform 0.15s ease;
}

.country-select-wrap.is-open .country-select-chevron {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.country-select-panel {
  display: none;
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.country-select-wrap.is-open .country-select-panel {
  display: block;
}

.country-select-search {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
}

.country-select-search:focus {
  background: #f9fafb;
}

.country-select-options {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 240px;
  overflow-y: auto;
}

.country-select-option {
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  color: #111827;
  cursor: pointer;
}

.country-select-option:hover,
.country-select-option.is-active {
  background: #eff6ff;
  color: #1d4ed8;
}

.country-select-option.is-selected {
  font-weight: 600;
}

.country-select-empty {
  padding: 0.75rem;
  font-size: 0.875rem;
  color: #6b7280;
}
