.ka-countrycontext-selector {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ka-countrycontext-label {
  margin: 0;
  font-size: 0.875rem;
  color: #2f3a45;
}

.ka-countrycontext-select {
  min-width: 11rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  padding: 0.35rem 0.6rem;
  background: #fff;
  color: #17212b;
}

.ka-countrycontext-select:disabled,
.ka-countrycontext-dropdown button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.ka-countrycontext-locked-message {
  display: block;
  max-width: 18rem;
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.3;
}

.ka-countrycontext-message {
  margin-top: 0.35rem;
  color: #b42318;
  font-size: 0.8rem;
  line-height: 1.3;
}

.ka-countrycontext-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
}

.ka-countrycontext-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 29, 0.55);
}

/* Bootstrap's mobile dropdown backdrop must be positioned for z-index to work. */
.dropdown-backdrop {
  position: fixed !important;
  inset: 0;
  z-index: 999 !important;
}

.ka-countrycontext-modal-dialog {
  position: relative;
  z-index: 2;
  width: min(94vw, 36rem);
  margin: 10vh auto 0;
  background: #fff;
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
  text-align: center;
}

.ka-countrycontext-modal-title {
  margin: 0 0 0.5rem;
  color: #0f1720;
}

.ka-countrycontext-modal-text {
  margin: 0 0 1rem;
  color: #36424d;
  line-height: 1.5;
}

.ka-countrycontext-country-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  margin: 1.25rem 0;
}

.ka-countrycontext-country-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.9rem 0.6rem;
  border: 1px solid #dbe4ef;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.ka-countrycontext-country-card--detected {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.ka-countrycontext-country-card--current {
  border-color: #e2e8f0;
}

.ka-countrycontext-country-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.ka-countrycontext-country-iso {
  font-size: 1.45rem;
  line-height: 1.1;
  color: #1d4ed8;
}

.ka-countrycontext-country-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #17212b;
}

.ka-countrycontext-country-arrow {
  font-size: 1.5rem;
  font-weight: 700;
  color: #64748b;
}

.ka-countrycontext-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.ka-countrycontext-modal-actions .btn {
  min-width: 11rem;
}

/* Compact country suggestion layout. */
.ka-countrycontext-modal-dialog {
  position: relative;
  text-align: left;
}

.ka-countrycontext-modal-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-right: 2rem;
  font-size: 1.35rem;
}

.ka-countrycontext-modal-title-icon {
  display: inline-flex !important;
  flex: 0 0 1.25rem;
  align-items: center;
  justify-content: center;
  width: 1.25rem !important;
  height: 1.25rem !important;
  margin: 0;
  color: currentColor;
  background: transparent;
  line-height: 1;
}

.ka-countrycontext-modal-title-icon svg {
  display: block !important;
  width: 1.1rem !important;
  height: 1.1rem !important;
  max-width: none;
}

/* Prevent a cached pre-1.7.3 template from bringing back the large icon. */
.ka-countrycontext-modal .ka-countrycontext-modal-icon {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ka-countrycontext-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.ka-countrycontext-modal-close:hover,
.ka-countrycontext-modal-close:focus {
  color: #17212b;
}

.ka-countrycontext-modal-lead {
  margin: 1.25rem 0 0.35rem;
  font-size: 1.2rem;
  line-height: 1.35;
  color: #17212b;
}

.ka-countrycontext-modal-lead strong,
.ka-countrycontext-modal-text strong {
  font-weight: 700;
}

.ka-countrycontext-modal-text {
  margin-bottom: 1.25rem;
}

.ka-countrycontext-modal-actions {
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 0.6rem;
}

.ka-countrycontext-modal-actions .btn {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.ka-countrycontext-modal-button-flag {
  display: inline-block;
  margin-right: 0.55rem;
  font-size: 1.1em;
  line-height: 1;
  vertical-align: -0.08em;
}

.ka-countrycontext-modal-footer {
  margin: 1rem 0 0;
  color: #64748b;
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 520px) {
  .ka-countrycontext-modal-dialog {
    width: calc(100vw - 2rem);
    margin-top: 5vh;
    padding: 1rem;
  }

  .ka-countrycontext-country-comparison {
    gap: 0.3rem;
  }

  .ka-countrycontext-country-name {
    font-size: 0.85rem;
  }

  .ka-countrycontext-modal-actions {
    flex-direction: column-reverse;
  }

  .ka-countrycontext-modal-actions .btn {
    width: 100%;
  }
}

.ka-countrycontext-dropdown {
  display: block;
  position: relative;
  z-index: 1001;
}

.ka-countrycontext-dropdown .ka-countrycontext-dropdown__selector {
  position: relative;
}

.ka-countrycontext-dropdown .ka-countrycontext-dropdown__selector button {
  width: 100%;
  margin: 0;
  padding: 12px 20px;
  border: 1px solid #1C1A19;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ka-countrycontext-dropdown .ka-countrycontext-dropdown__selector button span {
  font-size: 14px;
  line-height: 140%;
  font-weight: 400;
  color: #1C1A19 !important;
}

.ka-countrycontext-dropdown ul.dropdown-menu {
  width: 100%;
  position: relative;
  z-index: 1002;
  margin-top: 5px;
  list-style: none;
  max-height: 20rem;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #1C1A19;
  border-radius: 15px;
}

.ka-countrycontext-dropdown ul.dropdown-menu li + li {
  margin-top: 5px;
}

.ka-countrycontext-dropdown ul.dropdown-menu a.dropdown-item {
  display: block;
  padding: 5px 10px;
  background: #E8E5E3;
  border-radius: 5px;
  color: #1C1A19 !important;
  font-size: 14px;
  line-height: 140%;
  font-weight: 400;
  text-decoration: none;
}

.ka-countrycontext-dropdown ul.dropdown-menu a.dropdown-item:hover,
.ka-countrycontext-dropdown ul.dropdown-menu a.dropdown-item:focus,
.ka-countrycontext-dropdown ul.dropdown-menu li.current a.dropdown-item {
  background: #B6A792 !important;
  color: #fff !important;
}

.ka-countrycontext-dropdown .ka-countrycontext-dropdown__selector button {
  display: flex !important;
}

.ka-countrycontext-dropdown .ka-countrycontext-dropdown__selector select,
.ka-countrycontext-dropdown .ka-countrycontext-label {
  display: none !important;
}

.ka-countrycontext-dropdown .ka-countrycontext-dropdown__selector.open > ul.dropdown-menu,
.ka-countrycontext-dropdown .ka-countrycontext-dropdown__selector button + ul[style="display: block;"] {
  display: block !important;
}

/*
 * Keep the menu position supplied by Bootstrap/the active theme.
 * Do not reset it to `unset`: that breaks the dropdown stacking context
 * and can leave the mobile `.dropdown-backdrop` above the menu.
 */
