/*
 * Home page search — [belle_home_search] (inc/belle-home-search.php).
 * Everything is scoped to .bhs. Filled chips, the Buy/Rent toggle and the
 * button use the Elementor kit's Primary colour (Site Settings → Global
 * Colors), hover uses the kit's "Primary Hover"; fallbacks for pages
 * without the kit CSS.
 */

.bhs {
    --bhs-gold: #AA8656;
    --bhs-gold-ink: var(--e-global-color-primary, #AA8656);
    --bhs-gold-deep: var(--e-global-color-54c3f6d, #8E6D43); /* kit "Primary Hover" */
    --bhs-ink: #3C3633;
    --bhs-muted: #6F675F;
    --bhs-line: #D9D1C5;
    --bhs-line-soft: #ECE6DC;
    --bhs-soft: #F9F6F0;
    --bhs-surface: #FFFFFF;
    position: relative;
    z-index: 1;
    margin: 0;
    font-family: inherit;
    color: var(--bhs-ink);
}

.bhs *,
.bhs *::before,
.bhs *::after { box-sizing: border-box; }

/* ── Buy / Rent ─────────────────────────────────────────────────────── */
.bhs__deal {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin: 0 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.bhs__deal-opt { position: relative; margin: 0; cursor: pointer; }
.bhs__deal-opt input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    margin: 0; opacity: 0; cursor: pointer;
}
.bhs__deal-opt span {
    display: flex; align-items: center; justify-content: center;
    min-width: 104px; height: 42px; padding: 0 24px;
    border-radius: 999px;
    font-size: 16px; font-weight: 600; line-height: 1; letter-spacing: .01em;
    color: var(--bhs-ink);
    transition: background-color .15s ease, color .15s ease;
}
.bhs__deal-opt:hover span { background: var(--bhs-soft); }
.bhs__deal-opt input:checked + span { background: var(--bhs-gold-ink); color: #fff; }
.bhs__deal-opt input:focus-visible + span { outline: 3px solid var(--bhs-gold); outline-offset: 2px; }

/* ── Card + rows ────────────────────────────────────────────────────── */
.bhs__card {
    background: var(--bhs-surface);
    border-radius: 16px;
    padding: 26px 28px 22px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .12);
}

.bhs__row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    column-gap: 20px;
    align-items: start;
}
.bhs__row + .bhs__row { margin-top: 14px; }

.bhs__label {
    font-size: 16px; font-weight: 600; line-height: 1.25;
    color: var(--bhs-ink);
    padding-top: 11px; /* centre on the first line of chips */
}
.bhs__unit {
    display: block;
    margin-top: 2px;
    font-size: 12px; font-weight: 500; letter-spacing: .02em;
    color: var(--bhs-muted);
}
.bhs__unit[hidden], .bhs__chips[hidden] { display: none; }

.bhs__chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Chip ───────────────────────────────────────────────────────────── */
.bhs-chip { position: relative; margin: 0; cursor: pointer; }
.bhs-chip__input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    margin: 0; opacity: 0; cursor: pointer;
}
.bhs-chip__text {
    display: inline-flex; align-items: center;
    height: 42px; padding: 0 18px;
    border: 1px solid var(--bhs-line);
    border-radius: 999px;
    background: var(--bhs-surface);
    font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap;
    color: var(--bhs-ink);
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.bhs-chip:hover .bhs-chip__text { border-color: var(--bhs-gold); background: var(--bhs-soft); }
.bhs-chip__input:checked + .bhs-chip__text {
    border-color: var(--bhs-gold-ink);
    background: var(--bhs-gold-ink);
    color: #fff;
    font-weight: 600;
}
.bhs-chip__input:focus-visible + .bhs-chip__text { outline: 3px solid var(--bhs-gold); outline-offset: 2px; }

.bhs-chip.is-empty,
.bhs-chip.is-empty .bhs-chip__input { cursor: not-allowed; }
.bhs-chip.is-empty .bhs-chip__text {
    border-style: dashed;
    border-color: var(--bhs-line-soft);
    background: var(--bhs-surface);
    color: #B3ABA2;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.bhs__foot {
    display: flex; align-items: center; justify-content: flex-end; gap: 16px;
    margin-top: 22px; padding-top: 20px;
    border-top: 1px solid var(--bhs-line-soft);
}
.bhs__clear {
    margin-right: auto;
    padding: 8px 2px;
    border: 0; background: none;
    font: inherit; font-size: 15px; font-weight: 500;
    color: var(--bhs-muted);
    text-decoration: underline; text-underline-offset: 3px;
    cursor: pointer;
}
.bhs__clear:hover { color: var(--bhs-ink); }
.bhs__clear[hidden] { display: none; }
.bhs__clear:focus-visible { outline: 3px solid var(--bhs-gold); outline-offset: 2px; border-radius: 4px; }

.bhs__submit {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-width: 240px; height: 52px; padding: 0 30px;
    border: 0; border-radius: 999px;
    background: var(--bhs-gold-ink);
    font: inherit; font-size: 16px; font-weight: 600; line-height: 1;
    color: #fff;
    cursor: pointer;
    transition: background-color .15s ease;
}
/* Theme Options custom CSS puts a light gold gradient on every
   button[type="submit"] with !important; white text on it is hard to read. */
.bhs .bhs__submit { background: var(--bhs-gold-ink) !important; }
.bhs .bhs__submit:hover { background: var(--bhs-gold-deep) !important; }
.bhs__submit:focus-visible { outline: 3px solid var(--bhs-gold); outline-offset: 3px; }
.bhs .bhs__submit:disabled { background: #CFC7BC !important; cursor: not-allowed; }
.bhs__icon { flex: 0 0 auto; }

.bhs__sr {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* No JS: hide the rent budgets while Buy is picked, and the other way round. */
.bhs:has(input[value="for-sale"]:checked) .bhs__chips[data-deal="for-rent"],
.bhs:has(input[value="for-rent"]:checked) .bhs__chips[data-deal="for-sale"] { display: none; }
.bhs:has(input[value="for-rent"]:checked) .bhs__chips[data-deal="for-rent"] { display: flex; }

/* ── Tablet / phone ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .bhs__deal { display: flex; width: 100%; }
    .bhs__deal-opt { flex: 1 1 0; }
    .bhs__deal-opt span { min-width: 0; height: 40px; font-size: 15px; }

    .bhs__card { padding: 18px 16px 16px; border-radius: 14px; }
    .bhs__row { grid-template-columns: minmax(0, 1fr); }
    .bhs__row + .bhs__row { margin-top: 16px; }
    .bhs__label { padding-top: 0; margin-bottom: 8px; font-size: 15px; }
    .bhs__unit { display: inline; margin: 0 0 0 4px; }
    .bhs__unit[hidden] { display: none; }
    .bhs__chips { gap: 6px; }
    .bhs-chip__text { height: 38px; padding: 0 14px; font-size: 14px; }

    .bhs__foot { flex-direction: column-reverse; align-items: stretch; gap: 6px; margin-top: 18px; padding-top: 16px; }
    .bhs__clear { margin: 0 auto; }
    .bhs__submit { width: 100%; min-width: 0; height: 50px; }
}
