.contact-phone-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(118px, 38%) minmax(0, 1fr);
  width: 100%;
  gap: 8px;
  margin-bottom: 2px;
}

.contact-label-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 6px;
}

.contact-field-label {
  display: block;
  width: 100%;
  margin: 0;
  color: inherit;
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
}

.contact-field-label .en,
.contact-field-label .cn,
.contact-field-label .lang-en,
.contact-field-label .lang-zh {
  text-align: left;
}

.country-code-control {
  position: relative;
  display: grid;
  grid-template-columns: 24px 12px minmax(30px, 1fr) 30px;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  background: rgba(255, 255, 255, .92);
  color: #333;
}

.country-code-control:focus-within {
  border-color: #42a5f5;
  box-shadow: 0 0 0 2px rgba(66, 165, 245, .2);
}

.country-flag-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 20px;
  overflow: hidden;
}

.country-flag-slot .iti__flag,
.country-option .iti__flag {
  display: block;
  flex: 0 0 auto;
}

.country-flag-slot .iti__flag:empty:not([class*="iti__"]) {
  background-image: none;
}

.country-plus {
  font-size: 14px;
  line-height: 1;
  user-select: none;
}

.country-code-input {
  width: 100% !important;
  min-width: 0;
  height: 36px;
  padding: 0 2px !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #333 !important;
  font-size: 14px !important;
  transform: none !important;
}

.country-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 36px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 4px 4px 0 !important;
  background: transparent !important;
  color: #555 !important;
  box-shadow: none !important;
  cursor: pointer;
  transform: none !important;
}

.country-toggle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.country-code-control.is-open .country-toggle::before {
  transform: translateY(2px) rotate(225deg);
}

.contact-national-phone {
  width: 100% !important;
  min-width: 0;
  margin: 0 !important;
}

.country-dropdown {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 6px);
  left: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 286px;
  overflow: hidden;
  border: 1px solid #d8dce3;
  border-radius: 6px;
  background: #fff;
  color: #252525;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}

.country-dropdown[hidden] {
  display: none !important;
}

.country-search {
  width: calc(100% - 16px) !important;
  height: 36px;
  margin: 8px !important;
  padding: 7px 10px !important;
  border: 1px solid #cfd5dd !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: #333 !important;
  box-shadow: none !important;
  transform: none !important;
}

.country-options {
  max-height: 232px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.country-options .country-option {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 38px;
  gap: 8px;
  padding: 7px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #252525 !important;
  text-align: left;
  cursor: pointer;
  box-shadow: none !important;
  transform: none !important;
}

.country-options .country-option:hover,
.country-options .country-option:focus {
  background: #eef6ff !important;
  outline: 0;
}

.country-option-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.country-option-code {
  color: #606b7a;
  white-space: nowrap;
}

.country-empty {
  padding: 18px 12px;
  color: #777;
  text-align: center;
}

.whatsapp-option {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 2px;
  color: inherit;
  font-size: 13px;
  font-style: italic;
  line-height: 1.4;
  cursor: pointer;
}

.whatsapp-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px !important;
  height: 16px;
  margin: 0 4px 0 2px;
  padding: 0;
  accent-color: #1e88e5;
  transform: none !important;
}

.whatsapp-option .en,
.whatsapp-option .cn,
.whatsapp-option .lang-en,
.whatsapp-option .lang-zh {
  font-style: italic;
}

body.lang-en .whatsapp-option .en,
body.lang-cn .whatsapp-option .cn,
body.en .whatsapp-option .lang-en,
body.zh .whatsapp-option .lang-zh {
  display: inline;
}

@media (max-width: 480px) {
  .contact-phone-field {
    grid-template-columns: minmax(112px, 42%) minmax(0, 1fr);
  }

  .country-dropdown {
    width: min(330px, calc(100vw - 24px));
  }
}
