/*
 * The front property search widget.
 *
 * A second sheet layered over `search.css` rather than edits inside it:
 * `search.css` is also the developer-search widget's sheet
 * (`front/developers/search.blade.php` reuses `.searchOptions`,
 * `.collapseSearch`, `.estateTypeLabel`...), so changing those selectors would
 * restyle a screen this work never looked at. Everything here is prefixed
 * `sw-` / `sw__`, the way `property-search.css` owns `psr-`, and the two
 * property screens now share one palette.
 *
 * Loaded after `search.css` on the home page and the results page.
 */

:root {
    --sw-accent: #05af78;
    --sw-accent-dark: #048d61;
    --sw-accent-soft: rgba(5, 175, 120, .12);
    --sw-cta: #af2029;
    --sw-cta-dark: #8e1a21;
    --sw-ink: #1d2a3b;
    --sw-muted: #6b7490;
    --sw-line: #e7ebf1;
    --sw-surface: #fff;
    --sw-radius: 14px;
    --sw-shadow: 0 2px 14px rgba(29, 42, 59, .07);
    --sw-shadow-pop: 0 18px 46px rgba(29, 42, 59, .18);
    --sw-field-h: 58px;
}

/* ---------------------------------------------------------------- the panel */

/*
 * Above `.searchOverlay` (1000), which dims the rest of the page while a
 * dropdown is open: at the old 998 the overlay greyed out the widget the
 * visitor was in the middle of using.
 */
.sw {
    position: relative;
    z-index: 1001;
}

.sw__panel {
    padding: 1rem .75rem;
}

@media (min-width: 992px) {
    .sw__panel {
        padding: 1.1rem 1.25rem 1.25rem;
    }
}

/* ---------------------------------------------------------------- the deals */

.sw__deals {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin-bottom: .9rem;
}

.sw__deals .customSelectButton + .customSelectButton-label {
    margin: 0;
    padding: 9px 26px;
    font-size: 13px;
    letter-spacing: .01em;
}

.sw__deals .customSelectButton:checked + .customSelectButton-label {
    background-color: var(--sw-accent);
    border-color: rgba(255, 255, 255, .35);
    box-shadow: 0 6px 18px rgba(5, 175, 120, .35);
}

.sw__deals .customSelectButton:focus-visible + .customSelectButton-label {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ the bar */

.sw__bar {
    display: grid;
    grid-template-columns: 1fr;
    background: var(--sw-surface);
    border-radius: var(--sw-radius);
    box-shadow: var(--sw-shadow);
}

/* Force the last cell to span 100% width on screens under 992px */
@media (max-width: 991.98px) {
    .sw__bar > .sw__cell:last-child {
        grid-column: 1 / -1;
    }
}

@media (min-width: 768px) {
    .sw__bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 992px) {
    .sw__bar {
        /* estate | location | price | area | more | word | submit */
        grid-template-columns: 1.05fr 1.05fr 1fr 1fr auto minmax(120px, .95fr) auto;
    }

    /* Reset the last child to take its normal grid position on desktop */
    .sw__bar > .sw__cell:last-child {
        grid-column: auto;
    }

    /* The developer bar: subdistrict | status | price | word | submit. */
    .sw__bar--4 {
        grid-template-columns: 1.15fr 1fr 1fr 1.1fr auto;
    }
}

/*
 * Separators are drawn as insets on the cell rather than as borders on the
 * bar, so a cell can still paint its own hover background edge to edge and
 * the rounded corners stay clean.
 */
.sw__cell {
    position: relative;
    min-width: 0;
}

.sw__cell + .sw__cell::before {
    content: '';
    position: absolute;
    background: var(--sw-line);
    left: 16px;
    right: 16px;
    top: 0;
    height: 1px;
}

.sw__cell + .sw__cell:last-child::before {
    opacity: 0;
}

@media (min-width: 768px) {
    .sw__cell:nth-child(odd) + .sw__cell::before {
        left: 0;
        right: auto;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 60%;
    }
}

@media (min-width: 992px) {
    .sw__cell + .sw__cell::before {
        left: 0;
        right: auto;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 58%;
    }
}

/* ---------------------------------------------------------------- triggers */

.sw__trigger {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    height: var(--sw-field-h);
    padding: 0 1rem;
    border: 0;
    background: transparent;
    text-align: start;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color .18s ease;
}

.sw__trigger:hover,
.sw__trigger:focus-visible {
    background: rgba(5, 175, 120, .06);
}

.sw__trigger:focus-visible {
    outline: 2px solid var(--sw-accent);
    outline-offset: -2px;
}

.sw__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1 1 auto;
}

.sw__label {
    font-size: 10.5px;
    line-height: 1.2;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sw-muted);
    white-space: nowrap;
    font-feature-settings: 'case';
}

.sw__value {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--sw-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sw__value.is-empty {
    font-weight: 600;
    color: #b8becb;
}

.sw__icon {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--sw-muted);
    transition: transform .2s ease, color .18s ease;
}

.sw__trigger:hover .sw__icon {
    color: var(--sw-accent);
}

.sw__trigger[aria-expanded="true"] .sw__caret {
    transform: rotate(180deg);
    color: var(--sw-accent);
}

/* ----------------------------------------------------------------- the word */

.sw__word {
    display: flex;
    align-items: center;
    height: var(--sw-field-h);
    padding: 0 .35rem 0 1rem;
}

.sw__word .searchWord {
    height: auto;
    padding: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--sw-ink);
    background: transparent;
}

.sw__word .searchWord::placeholder {
    font-weight: 500;
    font-size: 13px;
    color: #9aa2b5;
}

.sw__word .searchWord:focus {
    outline: none;
}

/* ----------------------------------------------------------- advanced + CTA */

.sw__more {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: 100%;
    height: var(--sw-field-h);
    padding: 0 1rem;
    border: 0;
    background: transparent;
    color: var(--sw-ink);
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease;
}

.sw__more:hover,
.sw__more:focus-visible {
    color: var(--sw-accent);
    background: rgba(5, 175, 120, .06);
}

.sw__more:focus-visible {
    outline: 2px solid var(--sw-accent);
    outline-offset: -2px;
}

.sw__more-text {
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

@media (min-width: 992px) {
    .sw__more-text {
        display: none;
    }
}

/* How many advanced filters are currently applied. */
.sw__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--sw-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.sw__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    height: var(--sw-field-h);
    padding: 0 1.5rem;
    border: 0;
    background: var(--sw-cta);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .02em;
    border-radius: 0 0 var(--sw-radius) var(--sw-radius);
    cursor: pointer;
    transition: background-color .18s ease;
}

.sw__submit:hover,
.sw__submit:focus-visible {
    background: var(--sw-cta-dark);
}

.sw__submit:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.sw__submit-text {
    display: inline;
}

@media (min-width: 768px) {
    .sw__submit {
        border-radius: 0 0 var(--sw-radius) var(--sw-radius);
    }
}

@media (min-width: 992px) {
    .sw__submit {
        border-radius: 0 var(--sw-radius) var(--sw-radius) 0;
        padding: 0 1.75rem;
    }

    .sw__submit-text {
        display: none;
    }

    .sw__submit i {
        font-size: 16px;
    }
}

@media (min-width: 1200px) {
    .sw__submit {
        padding: 0 2.25rem;
    }

    .sw__submit-text {
        display: inline;
    }
}

/* ------------------------------------------------------------- the dropdown */

/*
 * Deliberately not Bootstrap's `.collapse`. The layout loads Tailwind through
 * `@vite` whenever `APP_DEBUG` is on, and Tailwind's own `collapse` utility is
 * `visibility: collapse` — so on any developer's machine a `.collapse.show`
 * panel laid itself out at full size and painted nothing at all. Two
 * frameworks claim that class name; the widget uses neither.
 */
.sw__pop {
    display: none;
    position: absolute;
    z-index: 1002;
    top: calc(100% + 10px);
    left: 0;
    width: min(420px, calc(100vw - 2rem));
    padding: 1.1rem 1.15rem 1.25rem;
    background: var(--sw-surface);
    border: 1px solid var(--sw-line);
    border-radius: var(--sw-radius);
    box-shadow: var(--sw-shadow-pop);
}

.sw__pop.is-open {
    display: block;
}

/*
 * The old sheet pinned the arrow at a fixed `left: 119px`, which only ever
 * lined up under the first column; it is anchored to its own cell here.
 */
.sw__pop::before,
.sw__pop::after {
    content: '';
    position: absolute;
    left: 28px;
    width: 0;
    height: 0;
    border-style: solid;
}

.sw__pop::before {
    top: -9px;
    border-width: 0 9px 9px 9px;
    border-color: transparent transparent var(--sw-line) transparent;
}

.sw__pop::after {
    top: -8px;
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent var(--sw-surface) transparent;
}

/* A dropdown under a right-hand cell is right-aligned so it stays on screen. */
.sw__pop--end {
    left: auto;
    right: 0;
}

.sw__pop--end::before,
.sw__pop--end::after {
    left: auto;
    right: 28px;
}

.sw__pop--wide {
    width: min(620px, calc(100vw - 2rem));
}

.sw__pop-title {
    display: block;
    margin-bottom: .8rem;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--sw-muted);
}

.sw__pop-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.sw__pop-inputs {
    width: 100%;
    margin-top: 1rem;
}

.sw__pop .form-control {
    height: 46px;
    border-color: var(--sw-line);
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--sw-ink);
}

.sw__pop .form-control:focus {
    border-color: var(--sw-accent);
    box-shadow: 0 0 0 3px var(--sw-accent-soft);
}

/* ------------------------------------------------------- the range control */

/*
 * The paired from/to field the dashboard filters use
 * (`property-range-input` in `dashboard/assets/css/demo.css`): one bordered
 * box that lights up as a whole, a caption above and two borderless numbers
 * joined by a dash. Two separate bordered inputs read as two unrelated
 * questions; this reads as one range, which is what it is.
 */
.sw-range {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .2rem;
    width: 100%;
    min-height: 52px;
    padding: .42rem .8rem .5rem;
    border: 1px solid var(--sw-line);
    border-radius: 12px;
    background: var(--sw-surface);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.sw-range:focus-within {
    border-color: var(--sw-accent);
    box-shadow: 0 0 0 3px var(--sw-accent-soft);
}

.sw-range__label {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: 10.5px;
    line-height: 1;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--sw-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The currency or area unit, rewritten by `search.js` when the pill flips. */
.sw-range__unit {
    font-weight: 700;
    color: var(--sw-accent-dark);
    letter-spacing: 0;
}

.sw-range__fields {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.sw-range__sep {
    flex: 0 0 auto;
    width: 10px;
    height: 1px;
    background: #c6cdda;
}

/*
 * `.form-control` is on these inputs so the transferred `numbersOnly` /
 * `moreThanEight` behaviour and the site's own form styling still apply; the
 * box around them is the border now, so the input itself carries none.
 */
.sw-range .sw-range__control.form-control {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--sw-ink);
}

.sw-range .sw-range__control.form-control:focus {
    border: 0;
    box-shadow: none;
}

.sw-range .sw-range__control.form-control::placeholder {
    font-weight: 500;
    color: #a9b1c2;
}

/* A number spinner inside a borderless field only ever gets in the way. */
.sw-range__control::-webkit-outer-spin-button,
.sw-range__control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sw-range__control[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Estate-type radios inside the dropdown. */
.sw__pop .estateSelectList {
    justify-content: flex-start;
    gap: .15rem;
    margin: -5px;
}

/* ------------------------------------------------------- a list in a panel */

.sw__filter {
    margin-bottom: .7rem;
}

.sw__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
    /* Room for the scrollbar, so a long name never sits under it. */
    padding-right: 4px;
    margin-right: -4px;
}

.sw__list--plain {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
}

.sw__option {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .42rem .55rem;
    border-radius: 9px;
    font-size: 13px;
    color: var(--sw-ink);
    cursor: pointer;
    transition: background-color .15s ease;
}

.sw__option:hover {
    background: var(--sw-accent-soft);
}

.sw__option.is-hidden {
    display: none;
}

.sw__option input {
    position: absolute;
    left: -9999px;
}

.sw__option span {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sw__option span::before {
    content: '';
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-right: .5rem;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px #c3cad8;
    transition: box-shadow .15s ease;
}

.sw__option input:checked + span {
    font-weight: 600;
    color: var(--sw-accent-dark);
}

.sw__option input:checked + span::before {
    box-shadow: inset 0 0 0 5px var(--sw-accent);
}

.sw__option input:focus-visible + span::before {
    outline: 2px solid var(--sw-accent);
    outline-offset: 2px;
}

/* The desktop dropdowns are inert on phones - the offcanvas sheets take over. */
@media (max-width: 991.98px) {
    .sw__pop:not(.sw__pop--always) {
        display: none !important;
    }

    /*
     * A cell with no offcanvas twin keeps its panel on a phone, where it reads
     * better inline than floating over the stacked bar.
     */
    .sw__pop--always.is-open {
        position: static;
        width: auto;
        margin: 0 .5rem .75rem;
        box-shadow: none;
    }

    .sw__pop--always::before,
    .sw__pop--always::after {
        display: none;
    }

    .sw__list {
        grid-template-columns: 1fr;
        max-height: 50vh;
    }
}

/* ---------------------------------------------------------- the pill toggle */

.sw__pop .switch-wrapper,
.sw-sheet .switch-wrapper {
    border-color: var(--sw-line);
    background: #f2f4f8;
}

.sw__pop .switch-wrapper .highlighter,
.sw-sheet .switch-wrapper .highlighter {
    background: var(--sw-accent);
}

.sw__pop .switch-wrapper label {
    min-width: 68px;
}

/* -------------------------------------------------------------- the overlay */

.searchOverlay.active {
    position: fixed !important;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(9, 16, 28, .32);
}

/* ------------------------------------------------------ results-page extras */

.sw__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: .85rem;
}

/*
 * Solid rather than another pane of glass: the panel is translucent, and how
 * far the hero or the page-title band reaches behind it differs per page — on
 * the developer index it stops short, which left a white chip on white.
 */
.sw__reset {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: 7px 16px;
    border: 1px solid var(--sw-line);
    border-radius: 20px;
    background: var(--sw-surface);
    color: var(--sw-ink);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--sw-shadow);
    transition: background-color .18s ease, color .18s ease;
}

.sw__reset:hover,
.sw__reset:focus-visible {
    background: var(--sw-accent);
    border-color: var(--sw-accent);
    color: #fff;
}

/*
 * On the results page the widget sits on the page background rather than over
 * the hero image, so the glass treatment has nothing to sit on and the white
 * labels are unreadable. It gets a solid card there instead.
 */
.sw--results {
    margin-top: -70px;
}

.sw--results .main-search-background {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.42);
}

/* ------------------------------------------------------------ mobile sheets */

.sw-sheet .offcanvas-header {
    padding-bottom: .35rem;
}

.sw-sheet .offcanvas-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--sw-ink);
}

.sw-sheet .offcanvas-body {
    padding-top: .25rem;
}

.sw-sheet__done {
    width: 100%;
    height: 48px;
    margin-top: 1.1rem;
    border: 0;
    border-radius: 10px;
    background: var(--sw-accent);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
}

.sw-sheet__done:hover,
.sw-sheet__done:focus-visible {
    background: var(--sw-accent-dark);
}

/* ======================================================== the search modals */

/*
 * `search.css` styles `.modal-body`, `.customSelectButtonCity-label` and the
 * district/street rows for the whole front site, so the two search modals are
 * re-skinned from here under their own `.sw-modal` hook instead. Everything
 * below is scoped to it; nothing outside the location and advanced modals
 * changes.
 */

.sw-modal .modal-dialog {
    max-width: min(1120px, calc(100vw - 2rem));
}

.sw-modal .modal-content {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(29, 42, 59, .28);
    overflow: hidden;
}

.sw-modal .modal-header {
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.35rem .9rem;
    border-bottom: 1px solid var(--sw-line);
    background: var(--sw-surface);
}

.sw-modal .modal-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: 15px;
    font-weight: 700;
    color: var(--sw-ink);
}

.sw-modal .modal-title i {
    font-size: 15px;
    color: var(--sw-accent);
}

.sw-modal .modal-body {
    padding: 1.1rem 1.35rem 1.35rem;
    background: #fbfcfd;
}

.sw-modal .modal-footer {
    gap: .6rem;
    padding: .85rem 1.35rem;
    border-top: 1px solid var(--sw-line);
    background: var(--sw-surface);
}

/* The footer's two buttons, rather than four bootstrap classes each. */
.sw-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-width: 132px;
    height: 44px;
    padding: 0 1.25rem;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.sw-modal__btn--ghost {
    border-color: var(--sw-line);
    background: var(--sw-surface);
    color: var(--sw-muted);
}

.sw-modal__btn--ghost:hover,
.sw-modal__btn--ghost:focus-visible {
    border-color: #d5dbe6;
    background: #f2f4f8;
    color: var(--sw-ink);
}

.sw-modal__btn--primary {
    background: var(--sw-accent);
    color: #fff;
}

.sw-modal__btn--primary:hover,
.sw-modal__btn--primary:focus-visible {
    background: var(--sw-accent-dark);
    color: #fff;
}

/*
 * On a phone the modal is full screen, so the footer is the one thing that
 * has to stay reachable without scrolling to the end of a long district list.
 */
@media (max-width: 991.98px) {
    .sw-modal .modal-dialog {
        max-width: none;
    }

    .sw-modal .modal-content {
        border-radius: 0;
    }

    .sw-modal .modal-header,
    .sw-modal .modal-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .sw-modal .modal-footer {
        padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -6px 18px rgba(29, 42, 59, .08);
    }

    .sw-modal__btn {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* ------------------------------------------- shared bits inside the modals */

.sw-modal__section {
    margin-bottom: 1.1rem;
}

.sw-modal__section:last-child {
    margin-bottom: 0;
}

.sw-modal__section-title {
    display: block;
    margin-bottom: .55rem;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--sw-muted);
}

/* The white card each group of controls sits on. */
.sw-modal__card {
    padding: .95rem 1rem 1rem;
    border: 1px solid var(--sw-line);
    border-radius: 14px;
    background: var(--sw-surface);
}

/* ---------------------------------------------- the advanced filters modal */

.sw-adv__ranges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: .7rem;
}

/*
 * The pill lists (`customLabel`) come from `search.css`; only their spacing
 * inside the new cards is set here, so the rows breathe evenly.
 */
.sw-adv__options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .1rem;
    margin: -4px;
}

/* --------------------------------------------------- the location modal */

.sw-loc__tools {
    position: sticky;
    top: -20px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    padding: .85rem 0;
    background: #fbfcfd;
}

.sw-loc__search {
    position: relative;
    flex: 1 1 220px;
    min-width: 0;
}

.sw-loc__search > i {
    position: absolute;
    top: 50%;
    inset-inline-start: 14px;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--sw-muted);
    pointer-events: none;
}

.sw-loc__search-input.form-control {
    height: 44px;
    padding-inline: 36px 38px;
    border: 1px solid var(--sw-line);
    border-radius: 11px;
    background: var(--sw-surface);
    font-size: 13.5px;
    color: var(--sw-ink);
}

.sw-loc__search-input.form-control:focus {
    border-color: var(--sw-accent);
    box-shadow: 0 0 0 3px var(--sw-accent-soft);
}

.sw-loc__search-clear {
    position: absolute;
    top: 50%;
    inset-inline-end: 8px;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef1f6;
    color: var(--sw-muted);
    font-size: 11px;
    cursor: pointer;
}

.sw-loc__search.is-filled .sw-loc__search-clear {
    display: inline-flex;
}

.sw-loc__search-clear:hover {
    background: #e2e7ef;
    color: var(--sw-ink);
}

.sw-loc__actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex: 0 0 auto;
}

.sw-loc__btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    height: 44px;
    padding: 0 .95rem;
    border: 1px solid var(--sw-line);
    border-radius: 11px;
    background: var(--sw-surface);
    color: var(--sw-ink);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.sw-loc__btn:hover,
.sw-loc__btn:focus-visible {
    border-color: var(--sw-accent);
    background: var(--sw-accent-soft);
    color: var(--sw-accent-dark);
}

.sw-loc__btn[disabled] {
    opacity: .45;
    pointer-events: none;
}

/* The chosen subdistricts, suburbs and streets, each removable in one click. */
.sw-loc__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin-bottom: .9rem;
}

.sw-loc__chips:empty {
    display: none;
}

.sw-loc__chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    max-width: 240px;
    padding: 6px 8px 6px 12px;
    border: 1px solid rgba(5, 175, 120, .28);
    border-radius: 18px;
    background: var(--sw-accent-soft);
    color: var(--sw-accent-dark);
    font-size: 12.5px;
    font-weight: 600;
}

.sw-loc__chip > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sw-loc__chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(5, 175, 120, .2);
    color: var(--sw-accent-dark);
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
}

.sw-loc__chip-remove:hover {
    background: var(--sw-accent);
    color: #fff;
}

/* A chip that stands for the whole selection rather than one row. */
.sw-loc__chip--clear {
    border-color: var(--sw-line);
    background: var(--sw-surface);
    color: var(--sw-muted);
    cursor: pointer;
}

.sw-loc__chip--clear:hover {
    border-color: var(--sw-cta);
    color: var(--sw-cta);
}

/* ---------------------------------------------------------- the city tabs */

.sw-modal .nav-tabs {
    gap: .3rem;
    margin-bottom: .2rem;
    padding-bottom: .55rem;
    /* A row of cities is wider than a phone; it scrolls rather than wraps. */
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
}

.sw-modal .nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.sw-modal .nav-tabs::-webkit-scrollbar-thumb {
    border-radius: 2px;
    background: #d9dfe8;
}

.sw-modal .nav-item {
    flex: 0 0 auto;
}

.sw-modal .customSelectButtonCity + .customSelectButtonCity-label {
    margin: 0;
    padding: 9px 18px;
    border: 1px solid var(--sw-line);
    border-radius: 20px;
    background: var(--sw-surface);
    color: var(--sw-muted);
    font-size: 12.5px;
    font-weight: 600;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.sw-modal .customSelectButtonCity:hover + .customSelectButtonCity-label {
    border-color: var(--sw-accent);
    background: var(--sw-accent-soft);
    color: var(--sw-accent-dark);
}

.sw-modal .customSelectButtonCity:checked + .customSelectButtonCity-label {
    border-color: var(--sw-accent);
    background: var(--sw-accent);
    color: #fff;
}

.sw-modal .customSelectButtonCity:focus-visible + .customSelectButtonCity-label {
    outline: 2px solid var(--sw-accent);
    outline-offset: 2px;
}

/* The streets button rides at the end of the tab row. */
.sw-loc__streets-tab {
    margin-inline-start: auto;
    padding-inline-start: .6rem;
}

.sw-modal #selectStreetsWindow span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: 9px 18px;
    border-radius: 20px;
    background: var(--sw-cta);
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
}

.sw-modal #selectStreetsWindow span:hover {
    background: var(--sw-cta-dark);
}

.sw-modal #selectStreetsWindow i {
    margin-left: 0;
}

/* How many streets are currently ticked, so the button is worth pressing. */
.sw-loc__streets-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .25);
    font-size: 11px;
    line-height: 1;
}

.sw-loc__streets-count:empty {
    display: none;
}

/* --------------------------------------------- districts, suburbs, streets */

.sw-loc__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .7rem;
    margin: .85rem 0 0;
}

.sw-loc__district {
    padding: .8rem .85rem .55rem;
    border: 1px solid var(--sw-line);
    border-radius: 14px;
    background: var(--sw-surface);
}

.sw-loc__district.is-hidden,
.sw-loc__row.is-hidden {
    display: none;
}

.sw-loc__district:has(.chooseDistrict:checked) {
    border-color: rgba(5, 175, 120, .45);
    box-shadow: 0 0 0 3px var(--sw-accent-soft);
}

.sw-modal .districtBlockHeader {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    padding: 0 0 .5rem;
    border-bottom: 1px solid var(--sw-line);
}

.sw-modal .districtBlockHeader label {
    margin: 0;
    color: var(--sw-ink);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

.sw-modal .subdistrictsContent {
    padding: 0;
    margin: .5rem 0 0;
    list-style: none;
}

.sw-modal .subdistrictItem,
.sw-modal .suburbItem,
.sw-modal .streetItem {
    gap: .55rem;
    margin: 0;
    padding: .3rem .4rem;
    border-radius: 9px;
    transition: background-color .15s ease;
}

.sw-modal .subdistrictItem:hover,
.sw-modal .suburbItem:hover,
.sw-modal .streetItem:hover {
    background: var(--sw-accent-soft);
}

.sw-modal .subdistrictItem label,
.sw-modal .suburbItem label,
.sw-modal .streetItem label {
    margin: 0;
    color: var(--sw-ink);
    font-size: 13px;
    cursor: pointer;
}

.sw-modal .subdistrictItem input:checked ~ label,
.sw-modal .suburbItem input:checked ~ label,
.sw-modal .streetItem input:checked ~ label {
    color: var(--sw-accent-dark);
    font-weight: 600;
}

.sw-modal .form-check-input {
    flex: 0 0 auto;
    margin: 0;
    width: 18px;
    height: 18px;
    border-color: #c3cad8;
    cursor: pointer;
}

.sw-modal .form-check-input:checked {
    border-color: var(--sw-accent);
    background-color: var(--sw-accent);
}

.sw-modal .form-check-input:focus {
    border-color: var(--sw-accent);
}

/* The suburb list is one flat list, not a district tree. */
.sw-loc__suburbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .1rem;
}

.sw-modal .sw-loc__suburbs .suburbItem {
    flex: none;
    margin: 0;
}

.sw-loc__streets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: .1rem;
}

/* Nothing matched the filter box. */
.sw-loc__empty {
    padding: 2rem 1rem;
    border: 1px dashed var(--sw-line);
    border-radius: 14px;
    background: var(--sw-surface);
    color: var(--sw-muted);
    font-size: 13px;
    text-align: center;
}

.sw-loc__empty[hidden] {
    display: none;
}

/* A subdistrict has to be chosen before there are any streets to list. */
.sw-loc__hint {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .85rem;
    padding: .7rem .9rem;
    border: 1px solid rgba(5, 175, 120, .25);
    border-radius: 12px;
    background: var(--sw-accent-soft);
    color: var(--sw-accent-dark);
    font-size: 12.5px;
    font-weight: 600;
}

.sw-loc__hint[hidden] {
    display: none;
}

/* --------------------------------------------------------- the scroll lock */

/*
 * Bootstrap only sets `overflow: hidden` on `<body>`, which mobile Safari and
 * Chrome ignore once the touch starts inside the sheet: the page behind kept
 * scrolling under the open panel and the visitor lost their place. Pinning
 * the document holds it still; `search-widget.js` restores the offset when
 * the last panel closes.
 */
html.sw-locked,
html.sw-locked body {
    overflow: hidden !important;
    overscroll-behavior: none;
}

html.sw-locked body {
    position: fixed;
    inset-inline: 0;
    width: 100%;
}

/* The sheets and the modals scroll on their own; the page behind must not. */
.sw-sheet .offcanvas-body,
.sw-modal .modal-body {
    overscroll-behavior: contain;
}
