.custom-select-wrapper-phone {
  flex-shrink: 0;
  min-width: 64px;
  position: relative;
  align-self: stretch;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
  z-index: 1;
}

/* Menú abierto: por encima de columnas vecinas del grid (origen/fechas/email, z-index alto en calendario). */
.custom-select-wrapper-phone:has(.custom-select-dropdown-phone.show) {
  z-index: 10001;
}

.custom-select-wrapper-phone select.cotiz-phone-native-select,
.custom-select-wrapper-phone select[name='codigo_pais'] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Refuerzo: Tailwind (base.html) puede resetear buttons; estas reglas tienen precedencia alta. */
.contenedor-cotizador-form .custom-select-wrapper-phone .custom-select-button-phone {
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.custom-select-button-phone {
  flex-shrink: 0;
  width: 64px;
  box-sizing: border-box;
  min-height: 24px;
  height: auto;
  text-align: center;
  background-color: #E6ECF7;
  border: none !important;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  color: #051F3F;
  font-size: 14px;
  font-family: inherit;
  font-weight: bold;
  padding: 0;
  padding-right: 20px;
  cursor: pointer;
  position: relative;
  border-radius: 9999px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23051F3F' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  background-color: #E6ECF7;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.custom-select-dropdown-phone {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background-color: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10002;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  padding: 8px 0;
  min-width: 280px;
}

.custom-select-dropdown-phone.show {
  display: block !important;
  visibility: visible !important;
  pointer-events: auto;
}

/* Clase en el wrapper cuando el menú está en body (portal); el form sigue pudiendo tener overflow. */
.phone-country-dropdown-open {
  z-index: 10;
}

.custom-select-dropdown-item-phone {
  padding: 10px 16px;
  color: #2b2e4a;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  transition: background-color 0.2s ease;
  -webkit-transition: background-color 0.2s ease;
  -moz-transition: background-color 0.2s ease;
  -o-transition: background-color 0.2s ease;
}

.custom-select-dropdown-item-phone:hover,
.custom-select-dropdown-item-phone.selected {
  background-color: #dcffe6;
  color: #2b2e4a;
}

.custom-select-dropdown-phone::-webkit-scrollbar {
  width: 8px;
}

.custom-select-dropdown-phone::-webkit-scrollbar-track {
  background: #E6ECF7;
  border-radius: 4px;
}

.custom-select-dropdown-phone::-webkit-scrollbar-thumb {
  background: #8C96A9;
  border-radius: 4px;
}

.custom-select-dropdown-phone::-webkit-scrollbar-thumb:hover {
  background: #6B7A99;
}

.custom-select-dropdown-phone {
  scrollbar-width: thin;
  scrollbar-color: #8C96A9 #E6ECF7;
}
