/*
 * Xevendi mockup — the one search-bar shape, used wherever people search (owner, 2026-11-16: "i like this shape …
 * throughout the app it should follow"). Equal-height rounded rectangles with a 1 px border: a location box with
 * clear and search inside, dropdown chips with a chevron that turn teal-tinted when set, and one solid action at the
 * end. Homepage hero (.sb--hero), search filter bar (.filter-bar), Sell and Find-an-agency searches.
 * Loaded last so it settles the older chip and field styles. Tokens come from styles.css.
 */
:root { --sb-h: 40px; --sb-r: 10px; }

/* ---------- location box: text, clear (×) and search inside one rectangle ---------- */
.sb-box {
  position: relative; display: flex; align-items: center; gap: 2px; height: var(--sb-h); padding-right: 4px;
  border: 1px solid var(--line-strong); border-radius: var(--sb-r); background: #fff;
  transition: border-color var(--d1) var(--ease), box-shadow var(--d1) var(--ease);
}
.sb-box:hover { border-color: var(--stone-500); }
.sb-box:focus-within { border-color: var(--sea-600); box-shadow: inset 0 0 0 1px var(--sea-600); }
.sb-box input, .sb-box input:hover, .sb-box input:focus {
  flex: 1; min-width: 0; width: auto; height: 100%; padding: 0 4px 0 14px; border: 0; border-radius: inherit;
  background: transparent; box-shadow: none; outline: none; font-size: 15px; color: var(--text-1);
  caret-color: var(--sea-600); text-overflow: ellipsis;
}
.sb-box input::placeholder { color: var(--text-2); }
.sb-box input::-webkit-search-cancel-button { display: none; }
.sb-icon {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-1); cursor: pointer; transition: background-color var(--d1) var(--ease);
}
.sb-icon:hover { background: var(--stone-100); }
.sb-icon:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.sb-icon[hidden] { display: none; }
.sb-clear-dot { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--stone-800); color: #fff; }

/* ---------- dropdown chips (buttons and native selects share the look) ---------- */
.sb-chip {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--sb-h);
  padding: 0 12px 0 16px; border: 1px solid var(--line-strong); border-radius: var(--sb-r); background-color: #fff;
  color: var(--text-1); font: 600 15px/1 var(--font-ui); white-space: nowrap; cursor: pointer;
  transition: background-color var(--d1) var(--ease), border-color var(--d1) var(--ease), box-shadow var(--d1) var(--ease), color var(--d1) var(--ease);
}
.sb-chip:hover { border-color: var(--stone-500); }
.sb-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sb-chip.is-active, .sb-chip[aria-expanded="true"] {
  background-color: var(--sea-50); border-color: var(--sea-600); box-shadow: inset 0 0 0 1px var(--sea-600); color: var(--sea-800);
}
.sb-chip .icon { flex: none; }
select.sb-chip { padding: 0 36px 0 16px; background-position: right 12px center; background-size: 14px; }
.sb-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--sea-600); color: #fff; font: 700 12px/1 var(--font-ui);
}
.sb-count[hidden] { display: none; }

/* ---------- the one solid action ---------- */
.sb-go {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--sb-h); padding: 0 18px;
  border: 0; border-radius: var(--sb-r); background: var(--sea-600); color: #fff; font: 700 15px/1 var(--font-ui);
  white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color var(--d1) var(--ease), transform var(--d1) var(--ease);
}
.sb-go:hover { background: var(--sea-700); color: #fff; }
.sb-go:active { transform: translateY(1px); }
.sb-go:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- choice menu (opens from a chip in a popover) ---------- */
.popover.popover--menu { min-width: 200px; padding: 6px; }
.sb-menu { display: grid; gap: 2px; }
.sb-option {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; height: 40px; padding: 0 12px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-1); font: 600 15px/1 var(--font-ui); text-align: left; cursor: pointer;
}
.sb-option:hover { background: var(--stone-100); }
.sb-option:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sb-option .icon { visibility: hidden; color: var(--sea-600); }
.sb-option[aria-pressed="true"] { background: var(--sea-50); color: var(--sea-800); }
.sb-option[aria-pressed="true"] .icon { visibility: visible; }

/* ---------- homepage hero: one white strip of the same controls, slim (owner: "not so thick") ---------- */
/* position + z-index: the strip (and its autocomplete list) stacks above the "Try …" hint that follows it; both
   animate in, and without this the later hint paints over the open list (owner, 2026-11-16). */
.sb--hero {
  position: relative; z-index: 2; --sb-h: 48px; width: 100%; max-width: 860px; display: flex; align-items: center; gap: 8px; padding: 8px;
  border-radius: 16px; background: #fff; color: var(--text-1); text-align: left;
  box-shadow: 0 20px 48px rgb(19 18 17 / .26), 0 4px 12px rgb(19 18 17 / .1);
}
.sb--hero .sb-box { flex: 1; min-width: 0; }
.sb--hero .sb-box input { padding-left: 16px; font-size: 16px; }
.sb--hero .home-cat { display: flex; flex: none; }
.home-cat[hidden] { display: none; }
.sb--hero select.sb-chip { field-sizing: content; min-width: 7rem; }
.hero--z .sb-hint { margin: 14px 0 0; font-size: 13px; color: rgb(255 255 255 / .92); text-shadow: 0 1px 8px rgb(19 18 17 / .45); }
.hero--z .sb-hint .linklike { color: #fff; font-weight: 600; text-decoration-color: rgb(255 255 255 / .55); text-underline-offset: 3px; }
@media (max-width: 599px) {
  .sb--hero { --sb-h: 44px; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: 14px; }
  .sb--hero .sb-box { flex: 1 0 100%; height: 48px; }
  .sb--hero .home-cat { flex: 1 1 0; min-width: 0; }
  .sb--hero select.sb-chip { width: 100%; min-width: 0; field-sizing: fixed; }
  .sb--hero .home-cat[hidden] + .sb-go { flex: 1; }
}

/* ---------- Sell valuation search and Find an agency ---------- */
.sx-searchrow { --sb-h: 52px; align-items: center; }
.sx-searchrow .sb-box { flex: 1 1 260px; }
.sx-searchrow .sb-go { padding: 0 24px; }
.ag-filters .sb-box { background: #fff; }
.sb-glyph { flex: none; margin-left: 12px; color: var(--text-2); }
.sb-glyph + input, .sb-box .sb-glyph + input:hover, .sb-box .sb-glyph + input:focus { padding-left: 8px; }

/* ---------- listing page: Travel times "Add a destination" box (travel.js) ---------- */
.travel-field { position: relative; max-width: 560px; margin-bottom: 4px; --sb-h: 44px; }
.travel-field .sb-box:has(input:disabled) { background: var(--bg-muted); }
.travel-field input:disabled { cursor: not-allowed; }
.travel-rows li .sb-icon { margin-left: auto; }
.travel-rows:empty { display: none; }

/* ---------- search results filter bar ---------- */
.filter-bar .search-field--bar { flex: none; width: clamp(220px, 24vw, 320px); }
.filter-bar .sb-chip, .filter-bar .sb-go { flex: none; }
.filter-bar .all-filters { gap: 8px; padding: 0 14px; }
@media (max-width: 1179px) {
  .filter-bar .save-search { width: var(--sb-h); padding: 0; }
  .filter-bar .save-search span { display: none; }
}
@media (max-width: 767px) {
  .filter-bar .search-field--bar { width: auto; }
}
