.phone-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}

/* ===== WRAPPER ===== */
.country-selector-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.32);
  border-radius: 4px;
  transition: border-color 0.18s ease;
}

.country-selector-wrapper:focus-within {
  border-color: rgb(126, 90, 37);
}

/* ===== CUSTOM DROPDOWN CONTAINER ===== */
.custom-country-dropdown {
  position: relative;
  width: 100%;
}

/* ===== TRIGGER BUTTON ===== */
.country-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: "Cera Godrej Interio", Arial, sans-serif;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  outline: none;
}

.country-dropdown-trigger:focus-visible {
  outline: 2px solid rgb(126, 90, 37);
  outline-offset: -2px;
  border-radius: 3px;
}

/* ===== FLAG ===== */
#country-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  width: auto;
  min-width: 20px;
  flex-shrink: 0;
  pointer-events: none;
}

#country-flag img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

/* ===== DIAL CODE ===== */
#country-dial-code {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  flex-shrink: 0;
}

/* ===== CHEVRON ===== */
.country-dropdown-arrow {
  width: 16px;
  height: 16px;
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: #666;
}

.country-dropdown-trigger[aria-expanded="true"] .country-dropdown-arrow {
  transform: rotate(180deg);
}

/* ===== DROPDOWN PANEL ===== */
.country-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  z-index: 10005;
  overflow: hidden;
}

.country-dropdown-panel.open {
  display: block;
}

.country-dropdown-panel.opens-up {
  top: auto;
  bottom: calc(100% + 4px);
}

/* ===== SEARCH ===== */
.country-search-wrapper {
  padding: 8px 8px 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #fafafa;
}

#country-search {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 6px 10px !important;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18) !important;
  border-radius: 4px !important;
  background: #fff !important;
  font-size: 13px !important;
  font-family: "Cera Godrej Interio", Arial, sans-serif !important;
  color: #333 !important;
  margin: 0 !important;
  outline: none;
  transition: border-color 0.15s ease !important;
}

#country-search:focus {
  border-color: rgb(126, 90, 37) !important;
  box-shadow: none !important;
  outline: none !important;
}

/* ===== COUNTRY LIST ===== */
.country-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}

.country-list::-webkit-scrollbar {
  width: 4px;
}

.country-list::-webkit-scrollbar-track {
  background: transparent;
}

.country-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 2px;
}

/* ===== LIST ITEMS ===== */
.country-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  transition: background 0.12s ease;
  font-family: "Cera Godrej Interio", Arial, sans-serif;
}

.country-list-item:hover {
  background: rgba(126, 90, 37, 0.08);
}

.cli-flag {
  display: flex;
  align-items: center;
  width: 22px;
  min-width: 22px;
  height: 15px;
  flex-shrink: 0;
}

.cli-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.cli-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cli-code {
  font-size: 12px;
  color: #888;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 6px;
}

/* ===== SEPARATOR ===== */
.country-list-separator {
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  margin: 4px 10px;
}

/* ===== EMPTY STATE ===== */
.country-list-empty {
  padding: 14px 12px;
  text-align: center;
  color: #999;
  font-size: 13px;
  font-style: italic;
}

/* ===== PHONE INPUT ===== */
#phone-input {
  flex: 9;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 14px;
  font-family: "Cera Godrej Interio", Arial, sans-serif;
  margin-top: 15px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

#phone-input:focus {
  outline: none;
  border-color: rgb(126, 90, 37);
  box-shadow: 0 0 0 3px rgba(126, 90, 37, 0.12);
}

/* ===== 1200px ===== */
@media (max-width: 1200px) {
  .phone-input-group {
    gap: 8px;
    margin-bottom: 12px;
  }

  .country-selector-wrapper {
    min-width: 90px;
  }

  .country-dropdown-trigger {
    padding: 8px 6px;
    font-size: 13px;
    gap: 5px;
  }

  #country-flag {
    height: 18px;
    width: auto;
    min-width: 18px;
  }

  #country-dial-code {
    font-size: 13px;
  }

  #phone-input {
    padding: 10px;
    font-size: 13px;
  }
}

/* ===== 900px ===== */
@media (max-width: 900px) {
  .phone-input-group {
    gap: 8px;
    margin-bottom: 12px;
  }

  .country-selector-wrapper {
    min-width: 80px;
  }

  .country-dropdown-trigger {
    padding: 8px 5px;
    font-size: 12px;
    gap: 4px;
  }

  #country-flag {
    height: 16px;
    width: auto;
  }

  #country-dial-code {
    font-size: 12px;
  }

  .country-dropdown-panel {
    min-width: 220px;
  }

  #phone-input {
    padding: 10px;
    font-size: 12px;
  }
}

/* ===== 520px ===== */
@media (max-width: 520px) {
  .phone-input-group {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .country-selector-wrapper {
    width: 100%;
    min-width: auto;
  }

  .country-dropdown-trigger {
    padding: 8px;
    font-size: 12px;
  }

  #country-flag {
    height: 16px;
    width: auto;
  }

  #country-dial-code {
    font-size: 12px;
  }

  .country-dropdown-panel {
    min-width: 100%;
    left: 0;
    right: 0;
  }

  #phone-input {
    width: 100%;
    margin-top: 0;
    padding: 10px;
    font-size: 12px;
  }
}

/* ===== 375px ===== */
@media (max-width: 375px) {
  .phone-input-group {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
  }

  .country-selector-wrapper {
    width: 100%;
    min-width: auto;
  }

  .country-dropdown-trigger {
    padding: 7px;
    font-size: 11px;
    gap: 4px;
  }

  #country-flag {
    height: 14px;
    width: auto;
  }

  #country-dial-code {
    font-size: 11px;
  }

  .country-dropdown-panel {
    min-width: 100%;
  }

  #phone-input {
    width: 100%;
    margin-top: 0;
    padding: 9px;
    font-size: 11px;
  }
}
