/* Native country dropdown (full list from server) */
.form-country-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.4;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #222;
  cursor: pointer;
}

.form-country-select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-country-filter {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1.4;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #fff;
  color: #222;
}

.form-country-filter:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-country-filter::placeholder {
  color: #888;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Country combo: raise z-index so dropdown is not covered by shipping block below */
.country-combo-field {
  position: relative;
  z-index: 300;
}

/* Country combo: input + filter panel */
.country-name-combo {
  position: relative;
  width: 100%;
  z-index: 1;
}

.country-name-combo-inner {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.country-name-combo--with-chevron .country-name-combo-input {
  flex: 1;
  min-width: 0;
  padding-right: 12px;
  border-radius: 6px 0 0 6px;
  border-right: none;
}

.country-name-combo--with-chevron .country-name-combo-input:focus {
  border-right: none;
  box-shadow: none;
}

.country-name-combo--with-chevron:focus-within .country-name-combo-input,
.country-name-combo--with-chevron:focus-within .country-name-combo-chevron {
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.country-name-combo--with-chevron:focus-within .country-name-combo-chevron {
  box-shadow: none;
  border-left-color: #4a90e2;
}

.country-name-combo-chevron {
  flex-shrink: 0;
  width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid #ddd;
  border-left: 1px solid #e8e8e8;
  border-radius: 0 6px 6px 0;
  background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
  color: #444;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.country-name-combo-chevron:hover {
  background: #eaeaea;
  color: #111;
}

.country-name-combo-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.4;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #222;
}

.country-name-combo:not(.country-name-combo--with-chevron) .country-name-combo-input {
  width: 100%;
}

.country-name-combo-input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.country-name-combo-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: min(320px, 55vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  z-index: 500;
}

.country-name-combo-panel.is-open {
  display: block;
}

.country-name-combo-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  color: #222;
}

.country-name-combo-row:last-of-type {
  border-bottom: none;
}

.country-name-combo-row:hover,
.country-name-combo-row:focus {
  background: #f4f4f4;
  outline: none;
}

.country-name-combo-row--hl,
.country-name-combo-row.country-name-combo-row--hl:hover {
  background: #e8f2fc;
  outline: none;
}

.country-name-combo-row-name {
  flex: 1;
  min-width: 0;
}

.country-name-combo-row-code {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.country-name-combo-empty,
.country-name-combo-more {
  padding: 12px;
  font-size: 13px;
  color: #888;
  text-align: center;
}

/* Legacy: click-to-open picker (still in JS for other pages if any) */
.country-pick {
  position: relative;
  width: 100%;
  z-index: 30;
}

.country-pick-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  color: #1a1a1a;
  text-align: left;
  border-bottom: 2px solid #222;
  padding-bottom: 2px;
  line-height: 1.4;
}

.country-pick-toggle:hover {
  color: #000;
  border-bottom-color: #e74c3c;
}

.country-pick-toggle:focus {
  outline: none;
  border-bottom-color: #4a90e2;
}

.country-pick-name {
  font-weight: 600;
  font-size: 16px;
}

.country-pick-caret {
  font-size: 10px;
  color: #666;
  user-select: none;
}

.country-pick-panel {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: min(100%, 420px);
  max-height: min(320px, 55vh);
  flex-direction: column;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 500;
}

.country-pick-panel.is-open {
  display: flex;
}

.country-pick-search {
  flex-shrink: 0;
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: none;
  border-bottom: 1px solid #eee;
  box-sizing: border-box;
}

.country-pick-search:focus {
  outline: none;
  background: #fafafa;
}

.country-pick-results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}

.country-pick-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  color: #222;
}

.country-pick-row:hover,
.country-pick-row:focus {
  background: #f4f4f4;
  outline: none;
}

.country-pick-row-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-pick-row-code {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  letter-spacing: 0.03em;
}

.country-pick-more,
.country-pick-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: #888;
  text-align: center;
}
