.phone-input-group {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 18px;
}

/* ===== WRAPPER — matches underline input style ===== */
.country-selector-wrapper {
  flex: 0 0 auto;
  position: relative;
  border: none;
  border-bottom: 1px solid rgba(195, 138, 110, 0.28);
  border-radius: 0;
  background: transparent;
  transition: border-color 0.2s;
  min-width: 105px;
}

.country-selector-wrapper.open,
.country-selector-wrapper:focus-within {
  border-bottom-color: var(--primary-col);
}

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

/* ===== TRIGGER BUTTON ===== */
.country-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 9px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: "Cera Godrej Interio", Arial, sans-serif;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
}

.trigger-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 18px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.trigger-flag img {
  width: 26px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.trigger-code {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  font-family: "Cera Godrej Interio", Arial, sans-serif;
}

/* ===== CHEVRON — prominent terracotta, clearly signals dropdown ===== */
.dropdown-chevron {
  width: 16px;
  height: 16px;
  color: var(--primary-col);
  flex-shrink: 0;
  transition: transform 0.2s ease;
  margin-left: 4px;
  opacity: 0.85;
  stroke-width: 2.5;
}

.country-selector-wrapper.open .dropdown-chevron {
  transform: rotate(180deg);
}

/* ===== DROPDOWN PANEL — light theme for legibility ===== */
.country-dropdown-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 290px;
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.22),
    0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e8e8e8;
  z-index: 9999;
  overflow: hidden;
}

/* ===== SEARCH ===== */
.country-search-wrapper {
  position: relative;
  padding: 10px 10px 8px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #aaa;
  pointer-events: none;
}

.country-search-input {
  width: 100%;
  padding: 7px 10px 7px 36px;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  font-size: 12.5px;
  font-family: "Cera Godrej Interio", Arial, sans-serif;
  background: #f7f7f7;
  color: #333;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}

.country-search-input:focus {
  border-color: var(--primary-col);
  background: #fff;
}

/* ===== OPTIONS LIST ===== */
.country-options-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.country-options-list::-webkit-scrollbar { width: 4px; }
.country-options-list::-webkit-scrollbar-track { background: transparent; }
.country-options-list::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

/* ===== OPTION CARD ===== */
.country-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.country-option:hover {
  background: #f5f5f5;
  border-color: #e8e8e8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.country-option.selected {
  background: rgba(195, 138, 110, 0.08);
  border-color: rgba(195, 138, 110, 0.25);
}

.option-flag {
  width: 34px;
  height: 22px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
  background: #f0f0f0;
  padding: 1px;
  box-sizing: border-box;
}

.option-name {
  flex: 1;
  font-size: 13px;
  color: #2c2c2c;
  font-family: "Cera Godrej Interio", Arial, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.option-code {
  font-size: 12px;
  color: #888;
  font-family: "Cera Godrej Interio", Arial, sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}

.no-results {
  padding: 12px 10px;
  font-size: 13px;
  color: #999;
  text-align: center;
  font-family: "Cera Godrej Interio", Arial, sans-serif;
}

/* ===== PHONE INPUT — matches underline input style ===== */
#phone-input {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-bottom: 1px solid rgba(195, 138, 110, 0.28);
  border-radius: 0;
  font-size: 14px;
  font-family: "Cera Godrej Interio", Arial, sans-serif;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  transition: border-color 0.2s;
}

/* Higher specificity than #rp-modal-form input[type="tel"] to cancel the
   18px bottom margin that misaligns the phone input inside the flex row */
#rp-modal-form #phone-input {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  width: auto;
}

#phone-input::placeholder {
  color: rgba(195, 138, 110, 0.42);
  font-size: 13px;
}

#phone-input:focus {
  outline: none;
  border-bottom-color: var(--primary-col);
  box-shadow: none;
}

/* ===== TABLET & DESKTOP (1200px) ===== */
@media (max-width: 1200px) {
  .phone-input-group {
    gap: 10px;
    margin-bottom: 16px;
  }

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

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

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

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

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

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

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

/* ===== MOBILE (520px) ===== */
@media (max-width: 520px) {
  .phone-input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 0;
  }

  .country-selector-wrapper {
    width: 100%;
    min-width: auto;
    margin-bottom: 18px;
  }

  .country-dropdown-trigger {
    padding: 9px 0;
    font-size: 13px;
  }

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

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

/* ===== SMALL MOBILE (375px) ===== */
@media (max-width: 375px) {
  .phone-input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 0;
  }

  .country-selector-wrapper {
    width: 100%;
    min-width: auto;
    margin-bottom: 16px;
  }

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

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