/*
 * The search card, one design wherever a page has a search (home, /sale, /rent, /rent-and-sale). Moved out of the home
 * page's partial on 22 Nov 2026 so the listings use the same component: put .ua-search-card on the card and
 * .searchFormId on its form, with the same parts (type, property type, location, Find; .hs-adv with .hs-range Min|Max
 * pairs; #more-option-div under it).
 */
/*
 * Advanced search in the same dress as the AI panel above it. Laid out by the card's own width (a container
 * query), not the screen's: the card is ~600px beside the featured card on a small laptop, ~785-900px on a
 * wide screen and the full width on a phone, and one set of screen breakpoints fitted none of those well.
 *   narrow card:  everything stacked; min/max side by side
 *   >= 560px:     type + property type / location + Find / the three ranges across
 *   >= 820px:     type, property type, location and Find on one line
 * Only the look and the order on screen change: names, ids and the scripts are the ones the search used.
 */
.ua-search-card { container: hsc / inline-size; }
.ua-search-card .searchFormId { padding: 0 12px 2px; }
.ua-search-card .searchFormId > .row {
    margin: 0; padding: 0 !important; background: transparent !important; box-shadow: none !important; border-radius: 0 !important;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px;
}
.ua-search-card .searchFormId > .row > [class*="col-"] { width: auto; max-width: none; padding: 0 !important; margin: 0 !important; }
.ua-search-card .searchFormId .form-control,
.ua-search-card .searchFormId .form-select {
    height: 48px; min-height: 48px; border: 1px solid #d9dde6 !important; border-radius: 12px !important; background-color: #fff !important;
    color: #1c2430; font-size: 15px; box-shadow: none !important; padding-left: 14px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.ua-search-card .searchFormId .form-select { padding-right: 34px; background-position: right 12px center; }
.ua-search-card .searchFormId .form-control:focus,
.ua-search-card .searchFormId .form-select:focus { border-color: var(--black-background-color, #171617) !important; outline: 0 !important; }
/* Location: Select2 4.1 puts the chosen tags and the typing box side by side in the field. */
.ua-search-card .commuity-search .select2-container .select2-selection--multiple {
    min-height: 48px !important; border: 1px solid #d9dde6 !important; border-radius: 12px !important;
    /* No top/bottom padding: Select2's own 5px at the bottom sat the text 2.5px above the middle. */
    padding: 0 12px 0 40px !important;
    display: flex; align-items: center; flex-wrap: wrap;
}
.ua-search-card .commuity-search .select2-selection--multiple .select2-selection__rendered { display: flex; flex-wrap: wrap; align-items: center; flex: 0 1 auto; min-width: 0; padding: 0 !important; }
.ua-search-card .commuity-search .select2-search--inline { flex: 1 1 140px; min-width: 0; display: flex; align-items: center; }
.ua-search-card .commuity-search .select2-search--inline .select2-search__field {
    margin: 0 !important; padding: 0 !important; height: 28px; line-height: 28px; font-size: 15px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; resize: none; width: 100% !important; vertical-align: middle;
    /* The same type as the other fields: it was the browser's sans-serif in a very light grey. */
    font-family: inherit; color: #1c2430;
}
.ua-search-card .commuity-search .select2-search__field::placeholder { color: #6b7280; opacity: 1; font-family: inherit; }
.ua-search-card .commuity-search > .position-absolute { left: 14px !important; }
.ua-search-card .searchFormId button[type="submit"].btn {
    height: 48px; width: 100%; border: 0; border-radius: 999px; padding: 0 26px; font-weight: 700; font-size: 15px; white-space: nowrap;
    background: var(--black-background-color, #171617) !important; color: #fff !important;
}
.ua-search-card .searchFormId button[type="submit"].btn:hover { background: #000 !important; }

/* The three ranges: a small label over one rounded box split into Min and Max. */
.ua-search-card .hs-adv { margin: 0; padding: 0; width: auto; }
.ua-search-card .hs-adv:not([style*="none"]) { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 2px 0 10px; }
.ua-search-card .hs-range { min-width: 0; }
/* Bootstrap gives every child of a .row side padding and a fixed width; the ranges fill their grid cells instead. */
.ua-search-card .hs-adv > * { padding-left: 0 !important; padding-right: 0 !important; width: auto; max-width: none; }
.ua-search-card .hs-range__label { display: block; margin: 0 0 6px 2px; font-size: 12.5px; font-weight: 700; color: #4b5563; letter-spacing: .01em; }
.ua-search-card .hs-range__pair { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #d9dde6; border-radius: 12px; background: #fff; overflow: hidden; }
.ua-search-card .hs-range__pair:focus-within { border-color: var(--black-background-color, #171617); }
.ua-search-card .hs-range__pair .form-select { border: 0 !important; border-radius: 0 !important; height: 46px; min-height: 46px; font-size: 14.5px; padding: 0 26px 0 12px; background-position: right 8px center; background-size: 14px 10px; }
.ua-search-card .hs-range__pair .form-select + .form-select { border-left: 1px solid #e6e8ee !important; }
.ua-search-card .hs-adv > .find-advance { margin: 0 !important; }

@container hsc (min-width: 560px) {
    .ua-search-card .searchFormId > .row {
        display: grid; gap: 10px; align-items: start;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        grid-template-areas: "type prop prop" "loc loc find" "adv adv adv";
    }
    .ua-search-card .searchFormId > .row > [class*="col-"] { margin: 0 !important; }
    .ua-search-card .searchFormId > .row > :nth-child(1) { grid-area: type; }
    .ua-search-card .searchFormId > .row > :nth-child(2) { grid-area: prop; }
    .ua-search-card .searchFormId > .row > :nth-child(3) { grid-area: loc; }
    .ua-search-card .searchFormId > .row > :nth-child(4) { grid-area: find; }
    .ua-search-card .searchFormId > .row > .hs-adv { grid-area: adv; }
    .ua-search-card .hs-adv:not([style*="none"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 4px 0 0; }
    .ua-search-card .hs-adv > .find-advance { grid-column: 1 / -1; }
}
@container hsc (min-width: 820px) {
    .ua-search-card .searchFormId > .row {
        grid-template-columns: minmax(110px, .75fr) minmax(170px, 1.15fr) minmax(0, 1.9fr) auto;
        grid-template-areas: "type prop loc find" "adv adv adv adv";
    }
}

/* The row under the fields: plain text controls, like the "Try searching" line. */
.ua-search-card #more-option-div { margin-top: 12px !important; gap: 4px 12px; font-size: 14px; color: #3a4554; }
/* A phone rule kept a second row free for the Map switch; with that switch gone, both controls share one line. */
.ua-search-card .home-search-controls { display: flex !important; flex-wrap: wrap; align-items: center; }
.ua-search-card #more-option-div p { margin: 0; font-weight: 600; color: #1c2430; }
.ua-search-card #more-option-div .mx-3 { margin: 0 !important; align-items: center; gap: 6px; }
.ua-search-card #more-option-div span { color: #c5cad3; }
.ua-search-card #more-option-div button[type="reset"] { color: #3a4554 !important; font-size: 14px; font-weight: 600; padding: 4px 10px; }
