.cf7-country-autocomplete {
  position: relative;
  display: block;
  width: 100%;
}

.cf7-country-autocomplete__control {
  position: relative;
  display: flex;
  width: 100%;
}

.cf7-country-autocomplete__input {
  width: 100%;
  padding-right: 4.75rem;
}

.cf7-country-autocomplete__clear,
.cf7-country-autocomplete__toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: inherit;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.8;
  z-index: 2;
}

.cf7-country-autocomplete__clear:hover,
.cf7-country-autocomplete__clear:focus,
.cf7-country-autocomplete__toggle:hover,
.cf7-country-autocomplete__toggle:focus {
  opacity: 1;
}

.cf7-country-autocomplete__clear {
  right: 2rem;
  font-size: 1.1rem;
}

.cf7-country-autocomplete__toggle {
  right: 0.5rem;
}

.cf7-country-autocomplete__portal {
  z-index: 2147483000;
}

.cf7-country-autocomplete__portal.is-desktop {
  position: fixed;
  max-height: 18rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.5rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.cf7-country-autocomplete__portal.is-mobile {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.42);
}

.cf7-country-autocomplete__mobile {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #fff;
}

.cf7-country-autocomplete__mobile-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cf7-country-autocomplete__mobile-search-wrap {
  flex: 1 1 auto;
}

.cf7-country-autocomplete__mobile-search {
  width: 100%;
  min-height: 2.875rem;
}

.cf7-country-autocomplete__mobile-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.75rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.cf7-country-autocomplete__mobile-list {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.cf7-country-autocomplete__dropdown {
  display: none !important;
}

.cf7-country-autocomplete__option,
.cf7-country-autocomplete__empty {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0.875rem;
}

.cf7-country-autocomplete__option {
  cursor: pointer;
}

.cf7-country-autocomplete__option + .cf7-country-autocomplete__option {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.cf7-country-autocomplete__option:hover,
.cf7-country-autocomplete__option.is-active {
  background: rgba(0, 0, 0, 0.04);
}

.cf7-country-autocomplete__flag {
  min-width: 1.5rem;
  width: 1.5rem;
  height: 1.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0.125rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

.cf7-country-autocomplete__flag-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cf7-country-autocomplete__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cf7-country-autocomplete__line,
.cf7-country-autocomplete__subline {
  white-space: normal;
  line-height: 1.35;
}

.cf7-country-autocomplete__subline {
  opacity: 0.8;
  font-size: 0.92em;
}

.cf7-country-autocomplete__empty {
  color: rgba(0, 0, 0, 0.65);
}

.cf7-country-autocomplete.is-open .cf7-country-autocomplete__toggle {
  transform: translateY(-50%) rotate(180deg);
}

.cf7-country-autocomplete--mobile-open,
.cf7-country-autocomplete--mobile-open body {
  overflow: hidden;
}

@media (max-width: 767px) {
  .cf7-country-autocomplete__option,
  .cf7-country-autocomplete__empty {
    padding: 0.9rem 1rem;
  }

  .cf7-country-autocomplete__flag {
    width: 1.75rem;
    min-width: 1.75rem;
    height: 1.25rem;
  }
}
