/* GWF Country Field — functional styles only; typography and field look come from the Breakdance form. */

.gwf-country {
  position: relative;
  width: 100%;
}

/* Extra specificity: Breakdance's per-form rules (.breakdance .bde-form-builder-X .breakdance-form …) set padding-right. */
.breakdance-form .gwf-country.gwf-country .gwf-country__input.breakdance-form-field__input {
  width: 100%;
  padding-right: 2.5em;
}

/* Flag box; the sprite image comes from flags.css, loaded on demand by the script. */
.gwf-flag {
  display: inline-block;
  flex: none;
  width: 20px;
  height: 15px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  vertical-align: middle;
}

/* Flag of the selected country inside the input. */
.breakdance-form .gwf-country.has-flag .gwf-country__input.breakdance-form-field__input {
  padding-left: calc(var(--bde-form-input-padding-left, 16px) + 28px);
}

.gwf-country__flag {
  position: absolute;
  top: 50%;
  left: var(--bde-form-input-padding-left, 16px);
  transform: translateY(-50%);
  pointer-events: none;
}

.gwf-country:not(.has-flag) .gwf-country__flag {
  display: none;
}

.gwf-country__toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5em;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  box-shadow: none;
}

.gwf-country__toggle svg {
  transition: transform 0.15s ease;
}

.gwf-country.is-open .gwf-country__toggle svg {
  transform: rotate(180deg);
}

.gwf-country__list {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 16rem;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background: var(--gwf-country-list-bg, #fff);
  color: var(--gwf-country-list-color, #1a1a1a);
  border: 1px solid var(--gwf-country-list-border, rgba(0, 0, 0, 0.15));
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  font: inherit;
  text-align: left;
}

.gwf-country__list[hidden] {
  display: none;
}

.gwf-country__option,
.gwf-country__empty {
  margin: 0;
  padding: 0.5em 0.9em;
  line-height: 1.35;
}

.gwf-country__option {
  display: flex;
  align-items: center;
  gap: 0.6em;
  cursor: pointer;
}

.gwf-country__option.is-current {
  font-weight: 600;
}

.gwf-country__option.is-active {
  background: var(--gwf-country-active-bg, #e8eef5);
}

.gwf-country__empty {
  opacity: 0.7;
}

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

@media (prefers-reduced-motion: reduce) {
  .gwf-country__toggle svg {
    transition: none;
  }
}

@media (forced-colors: active) {
  .gwf-country__option.is-active {
    outline: 2px solid Highlight;
    outline-offset: -2px;
  }
}
