.custom-places-autocomplete,
.custom-places-dropdown,
.custom-places-autocomplete .results-container {
  position: relative;
  max-width: 400px !important;
  width: 100%;
}

.custom-places-autocomplete input {
  width: 100%;
  padding: 10px 40px 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
}

.custom-places-autocomplete .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #2F6690;
  pointer-events: none;
}

.custom-places-autocomplete .search-icon svg {
  width: 100%;
  height: 100%;
}

.custom-places-autocomplete .results-container {
  position: absolute;
  top: 100%;
  left: 0;
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 1000;
  display: none;
  box-sizing: border-box;
}

.custom-places-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 1000;
  display: none;
  box-sizing: border-box;
}

.custom-places-autocomplete .result-item {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  box-sizing: border-box;
  width: 100%;
}

.custom-places-autocomplete .result-item:before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #2F6690;
  border-radius: 50%;
  flex-shrink: 0;
}

.custom-places-autocomplete .result-item:last-child {
  border-bottom: none;
}

.custom-places-autocomplete .result-item:hover {
  background-color: #f5f5f5;
}

.custom-places-autocomplete .result-item.selected {
  background-color: #f0f0f0;
}

.locality-container {
  position: relative;
  width: 100%;
  min-width: 270px;
  max-width: 400px;
}

.locality-container input[type="text"] {
  width: 100%;
  padding-right: 40px; /* Make room for the close button */
  padding-left: 32px; /* Make room for the search icon */
}

/* Locality Search Input */
.locality-search-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.6;
}

input#locality-search {
    font-size: 14px;
    width: 270px;
    outline: 0;
    opacity: 1;
    border-radius: 0;
    padding: 16px 0 14px 0;
    margin-left: 24px;
}

.locality-search-close:hover {
  color: #333;
}

.locality-search-close:focus {
  outline: none;
  color: #333;
}

/* Ensure the input has proper padding for the icons */
#locality-search {
  padding-left: 32px;
  padding-right: 40px;
  width: 100%;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}
/* Custom Places Autocomplete Styles */
.search-results-container {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-width: 400px;
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
  display: none;
}

.locality-search-close {
  position: absolute;
  left: 270px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

@media (max-width: 1200px) {
  .locality-search-close {
    left: calc(100% - 24px);
  }

  input#locality-search {
    width: calc(100% - 24px);
  }
}

.result-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
}

.result-item:hover {
  background-color: #f5f5f5;
}

.result-item svg {
  width: 14px;
  height: 14px;
  margin-right: 8px;
  fill: #2f6690;
}

.result-item[aria-selected="true"] {
  background-color: #f5f5f5;
}
