/* REATS · Search Experience — facet pickers */

.sx-root {
  position: relative;
  z-index: 5;
}

.sx-field:has(.sx-dropdown.is-open) {
  z-index: 2;
}

.search-form.sx-form {
  --sx-control-height: 54px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  grid-template-columns: unset;
}

.search-card .search-form.sx-form,
.glass .search-form.sx-form {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 22, 31, 0.1);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 32px rgba(20, 22, 31, 0.08);
}

.sx-form .sx-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.sx-form {
  overflow: visible;
}

.sx-field {
  position: relative;
  min-width: 0;
}

.sx-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #5c6478;
  margin-bottom: 6px;
}

.sx-picker-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sx-picker-wrap .sx-picker {
  flex: 1;
  min-width: 0;
}

.sx-picker-wrap .sx-picker__clear {
  position: absolute;
  inset-inline-end: 36px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

/* Picker — NOT a text input */
.sx-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--sx-control-height, 54px);
  height: var(--sx-control-height, 54px);
  box-sizing: border-box;
  padding: 8px 10px 8px 12px;
  border: 1.5px solid rgba(20, 22, 31, 0.12);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  text-align: start;
  font: inherit;
  color: #14161f;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.sx-picker:hover {
  border-color: rgba(47, 125, 63, 0.35);
  background: #fafcfa;
}

.sx-picker.is-open,
.sx-picker:focus-visible {
  outline: none;
  border-color: #2f7d3f;
  box-shadow: 0 0 0 3px rgba(47, 125, 63, 0.15);
}

.sx-picker.has-value {
  border-color: rgba(47, 125, 63, 0.4);
  background: rgba(232, 245, 234, 0.5);
}

.sx-picker__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: #2f7d3f;
  display: grid;
  place-items: center;
}

.sx-picker__icon svg {
  width: 20px;
  height: 20px;
}

.sx-picker__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sx-picker__placeholder {
  font-size: 0.92rem;
  color: #8b93a7;
  font-weight: 500;
}

.sx-picker__placeholder[hidden] {
  display: none;
}

.sx-picker--combo {
  cursor: text;
}

.sx-picker--combo .sx-picker__chev {
  cursor: pointer;
}

.sx-picker--combo .sx-picker__body {
  flex-wrap: wrap;
}

.sx-picker-input {
  flex: 1 1 80px;
  min-width: 48px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: #14161f;
  outline: none;
  padding: 2px 0;
  cursor: text;
}

.sx-picker-input::placeholder {
  color: #8b93a7;
}

.sx-picker--combo.has-value:not(.is-open) .sx-picker-input::placeholder {
  color: transparent;
}

.sx-picker--combo.is-open .sx-picker-input {
  min-width: 120px;
}

.sx-picker__chev {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid #8b93a7;
  border-bottom: 2px solid #8b93a7;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
  margin-inline-start: 4px;
}

.sx-picker.is-open .sx-picker__chev {
  transform: rotate(-135deg) translateY(2px);
}

.sx-picker__clear {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(20, 22, 31, 0.08);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
  color: #5c6478;
  cursor: pointer;
}

.sx-picker__clear:hover {
  background: rgba(20, 22, 31, 0.14);
}

.sx-picker__clear[hidden] {
  display: none;
}

/* Chips inside picker */
.sx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.sx-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: #2f7d3f;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 100%;
}

.sx-chip span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sx-chip__x {
  border: 0;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
}

.sx-chip__x:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Dropdown — anchored to .sx-field (position: relative) */
.sx-dropdown {
  position: absolute;
  z-index: 9000;
  top: calc(100% + 6px);
  inset-inline: 0;
  width: auto;
  min-width: 100%;
  background: #fff;
  border: 1px solid rgba(20, 22, 31, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(20, 22, 31, 0.16);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-height: min(400px, 70vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.sx-dropdown.is-open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.sx-dropdown[hidden]:not(.is-open) {
  display: none;
}

.sx-dropdown__filter {
  padding: 10px 10px 0;
  flex-shrink: 0;
}

.sx-filter-input {
  width: 100%;
  border: 1px solid rgba(20, 22, 31, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
}

.sx-filter-input:focus {
  border-color: #2f7d3f;
  box-shadow: 0 0 0 2px rgba(47, 125, 63, 0.12);
}

.sx-smart-hint {
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #5c6478;
  border-bottom: 1px solid rgba(20, 22, 31, 0.06);
  background: #f8faf8;
}

.sx-smart-hint[hidden] {
  display: none;
}

.sx-smart-apply {
  margin-inline-start: 6px;
  border: 0;
  background: #2f7d3f;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}

.sx-dropdown__body {
  padding: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.sx-group__title {
  padding: 6px 10px 4px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8b93a7;
}

.sx-group--level2 {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(20, 22, 31, 0.08);
}

.sx-group--level2 .sx-group__title {
  color: #2f7d3f;
}

.sx-option__sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: #8b93a7;
}

.sx-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: start;
  color: #14161f;
  transition: background 0.1s;
}

.sx-option:hover,
.sx-option.is-focused {
  background: rgba(47, 125, 63, 0.1);
}

.sx-option--freetext {
  border: 1px dashed rgba(45, 106, 79, 0.35);
  background: rgba(45, 106, 79, 0.04);
}

.sx-option--freetext .sx-option__label {
  font-weight: 600;
}

.sx-option.is-selected {
  background: rgba(47, 125, 63, 0.14);
}

.sx-option__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(47, 125, 63, 0.12);
  color: #2f7d3f;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sx-option__icon svg {
  width: 18px;
  height: 18px;
}

.sx-option__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.sx-option__check {
  color: #2f7d3f;
  font-weight: 800;
}

.sx-empty {
  padding: 16px;
  text-align: center;
  color: #8b93a7;
  font-size: 0.88rem;
}

/* When picker */
.sx-dropdown--when {
  padding: 12px;
  min-width: 280px;
}

.sx-dropdown--when .sx-dropdown__body {
  margin-bottom: 4px;
}

.sx-picker.has-value:not(.is-open) .sx-chips--single:not(:empty) + .sx-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  min-width: 0;
}

.sx-when-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.sx-preset {
  border: 1px solid rgba(20, 22, 31, 0.1);
  background: #fff;
  border-radius: 12px;
  padding: 11px 10px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
}

.sx-preset:hover,
.sx-preset.is-selected {
  border-color: #2f7d3f;
  background: rgba(47, 125, 63, 0.1);
  color: #0c3c1e;
}

.sx-when-custom__title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #5c6478;
}

.sx-when-custom__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.sx-when-custom__row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #5c6478;
}

.sx-when-custom__row input[type="date"] {
  border: 1px solid rgba(20, 22, 31, 0.12);
  border-radius: 10px;
  padding: 8px;
  font: inherit;
}

.sx-form .sx-submit {
  flex-shrink: 0;
  min-height: var(--sx-control-height, 54px);
  height: var(--sx-control-height, 54px);
  max-height: var(--sx-control-height, 54px);
  padding: 0 20px;
  font-size: 0.92rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  align-self: flex-end;
}

.sx-form--compact .sx-fields,
.site-search-modal__form.sx-form .sx-fields {
  grid-template-columns: 1fr;
}

.sx-form--compact,
.site-search-modal__form.sx-form {
  flex-direction: column;
  align-items: stretch;
}

.sx-form--compact .sx-submit,
.site-search-modal__form.sx-form .sx-submit {
  width: 100%;
}

/* Hide legacy text inputs if any remain */
.sx-form .search-field,
.sx-form .field-wrap {
  display: none !important;
}

/* Overflow fix — dropdowns must escape clipped parents */
body.bz-pilot-layout .bz-pilot-intro,
body.bz-pilot-layout .bz-pilot-intro .search-section,
.search-section,
.search-card,
.search-page-form-block,
.search-page-form-block .search-card,
.bz-block.search-page-form-block {
  overflow: visible !important;
}

.search-section .container {
  overflow: visible;
}

body.bz-pilot-layout .bz-main:has(.sx-dropdown.is-open) {
  overflow: visible !important;
}

/* Dropdown must paint above listing cards (sibling .bz-main__content) */
body.sx-dropdown-open .bz-pilot-intro,
body.sx-dropdown-open .search-section,
body.sx-dropdown-open .search-page-form-block {
  position: relative;
  z-index: 10050 !important;
}

body.sx-dropdown-open .sx-dropdown {
  z-index: 10051;
}

.bz-main__content {
  position: relative;
  z-index: 2;
}

#searchResultsRoot.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 900px) {
  .sx-form .sx-fields {
    grid-template-columns: 1fr;
  }

  .sx-form {
    flex-direction: column;
    align-items: stretch;
  }

  .sx-submit {
    width: 100%;
  }
}
