/* ZIP / city location field (Figma: Monarch / Car Shipping / Input / Location Autocomplete) */

.us-location-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.us-location-field__box {
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
}

.us-location-field.is-open {
    z-index: 40;
}

.us-location-field.is-open .us-location-field__box {
    border-radius: 4px 4px 0 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.us-location-field.is-success .us-location-field__box {
    border-color: #3fa420;
}

.us-location-field.is-error .us-location-field__box,
.us-location-field.is-nudge .us-location-field__box {
    border-color: #f90000;
}

.us-location-field.is-nudge.is-success .us-location-field__box {
    border-color: #3fa420;
}

.us-location-field__control {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 16px;
}

.us-location-field.is-open .us-location-field__control {
    border-bottom: 1px solid #e7e7e7;
}

.us-location-field__search-icon {
    flex-shrink: 0;
}

.us-location-field__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 24px;
    color: #010101;
    caret-color: #6227a7;
    background: transparent;
    border: none;
    outline: none;
}

.us-location-field__input::placeholder {
    color: #717171;
}

/* Dropdown */

.us-location-field__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: -1px;
    right: -1px;
    z-index: 50;
    overflow: hidden;
    background-color: #ffffff;
    border: 1px solid #e7e7e7;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.us-location-field.is-open .us-location-field__dropdown {
    display: block;
}

.us-location-field__dropdown[hidden] {
    display: none !important;
}

.us-location-field__section {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    line-height: 12px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #6227a7;
}

.us-location-field__list {
    max-height: 224px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: #717171 #f7f7f7;
}

.us-location-field__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    font-size: 16px;
    line-height: 24px;
    color: #010101;
    border-top: 1px solid #e7e7e7;
    cursor: pointer;
}

.us-location-field__row:first-child {
    border-top: none;
}

.us-location-field__row:hover {
    background-color: #F8F9F9;
}

.us-location-field__row.is-active,
.us-location-field__row.is-best {
    background-color: #f1e8ff;
}

.us-location-field__row--empty,
.us-location-field__row--empty:hover {
    color: #717171;
    background-color: #ffffff;
    cursor: default;
}

.us-location-field__row-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.us-location-field__badge {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 18px;
    color: #ffffff;
    white-space: nowrap;
    background-color: #6227a7;
    border-radius: 1000px;
}

.us-location-field__select-hint {
    padding: 8px 16px;
    font-size: 14px;
    line-height: 20px;
    text-align: left;
    color: #010101;
    background-color: #f7f7f7;
}

/* Texts under the field */

.us-location-field__status {
    font-size: 12px;
    line-height: 18px;
}

.us-location-field__hint {
    color: #717171;
}

.us-location-field__confirmed {
    color: #3fa420;
}

.us-location-field__error {
    color: #f90000;
}

.us-location-field__confirmed[hidden],
.us-location-field__error[hidden] {
    display: none;
}

.us-location-field.is-success .us-location-field__hint,
.us-location-field.is-nudge .us-location-field__hint,
.us-location-field.is-error .us-location-field__hint {
    display: none;
}

@media screen and (max-width: 767px) {
    .us-location-field__list {
        max-height: 200px;
    }
}