/* ============================================
   search-what.css: the search's What, every filter (Components/_SearchWhat, the fields;
   Listings/_WhatPanel, the panel GET /Listings/What serves). Shown in the search bar's What
   pop-over (Components/_SearchBar), the phone sheet's What card (Components/_SearchSheet) and the
   search page's no-JS filters form (Listings/_SearchFilters, whose footer is listings.css's).
   Behaviour: js/app/search-what.js. Chips and the price range are chips.css and forms.css.
   Mobile first. Tokens only (style.css).
   ============================================ */

/* ---------- The fields ---------- */

.search-filters .search-filters__section {
  min-width: 0;
  margin: 0 0 var(--space-6);
  padding: 0 0 var(--space-6);
  border: 0;
  border-bottom: 1px solid var(--color-border-light);
}

.search-filters .search-filters__section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.search-filters .search-filters__title {
  float: none;
  width: auto;
  margin: 0 0 var(--space-3);
  padding: 0;
  color: var(--color-ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.search-filters__hint {
  margin: calc(var(--space-2) * -1) 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: 14px;
}

.search-filters .bl-chip--tile i {
  color: var(--color-ink);
  font-size: 22px;
  line-height: 1;
}

.search-filters__chips .bl-chip i {
  color: var(--color-text-muted);
  font-size: 14px;
}

.search-filters__group {
  border-bottom: 1px solid var(--color-border-light);
}

.search-filters__group:last-of-type {
  border-bottom: 0;
}

.search-filters__summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-2) 0;
  color: var(--color-ink);
  font-size: 16px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.search-filters__summary::-webkit-details-marker {
  display: none;
}

.search-filters__summary:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.search-filters__summary > i:first-child {
  width: 20px;
  color: var(--color-text-muted);
  text-align: center;
}

.search-filters__summary-text {
  flex: 1;
  min-width: 0;
}

.search-filters__picked {
  color: var(--green-700);
  font-size: 14px;
  font-weight: 500;
}

.search-filters__chevron {
  color: var(--color-text-muted);
  font-size: 14px;
  transition: rotate var(--duration-fast) var(--ease-out);
}

.search-filters__group[open] .search-filters__chevron {
  rotate: 180deg;
}

.search-filters__chips {
  padding: 0 0 var(--space-4);
}

/* ---------- The bar's pop-over: a fixed footer under a scrolling body ---------- */

/* ui.js caps the panel's height to the room under the bar; the body scrolls inside it so Clear and
   "Show N places" stay in view. */
.bl-search__what-panel {
  width: 640px;
  padding: 0;
  overflow: hidden;
}

.bl-search__what-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
}

.search-what {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.search-what__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--space-5) var(--space-5) var(--space-4);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.search-what__footer {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-border-light);
  background-color: var(--color-surface);
}

.search-what__clear {
  text-decoration: underline;
}

.search-what__submit {
  min-width: 168px;
  justify-content: center;
}

/* The count is being refreshed. */
.search-what__submit[aria-busy="true"] {
  opacity: 0.75;
}

/* A compact pop-over: section titles a step smaller than the page form's. */
.bl-search__what-panel .search-filters .search-filters__title {
  font-size: 16px;
}

.bl-search__what-panel .search-filters .search-filters__section {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
}

/* ---------- Loading, or a load that failed ---------- */

.search-what__status {
  margin: 0;
  padding: var(--space-5);
  color: var(--color-text-muted);
  font-size: 14px;
}

.search-what__retry {
  margin-left: var(--space-2);
}

/* ---------- The phone sheet's What card ---------- */

.search-what-card {
  padding: 0 var(--space-4) var(--space-4);
}

.search-what-card .search-what__status {
  padding: 0 0 var(--space-2);
}

.search-what-card .search-what__body {
  padding: 0;
  overflow: visible;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .search-filters__chevron {
    transition: none;
  }
}
