/* Atba Immobilier: search results (acheter, louer, saisonnier). Loads after site.css. */

.search-intro { padding-bottom: 28px; }
.search-title { margin-top: 20px; font-size: clamp(2.75rem, 6vw, 5.5rem); font-weight: 500; letter-spacing: -.05em; line-height: .95; margin-inline-start: -.03em; }
.search-intro .lede { margin-top: 14px; }

/* Deal tabs: links, one per results page */
.deal-tabs { display: flex; gap: 0; margin-top: 32px; border-bottom: 1px solid var(--line); }
.deal-tabs a { position: relative; padding: 14px 24px 14px 0; margin-inline-end: 24px; font-weight: 500; color: var(--muted); text-decoration: none; }
.deal-tabs a::after { content: ""; position: absolute; inset-inline: 0 24px; bottom: -1px; height: 2px; background: var(--cobalt); transform: scaleX(0); transition: transform .35s var(--ease); }
.deal-tabs a[aria-current] { color: var(--ink); }
.deal-tabs a[aria-current]::after, .deal-tabs a:hover::after { transform: scaleX(1); }
[dir="rtl"] .deal-tabs a { padding: 14px 0 14px 24px; }

/* Filters: one bar, stuck under the header while the results scroll */
.filters-bar { position: sticky; top: var(--header-h); z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); }
.admin-bar .filters-bar { top: calc(var(--header-h) + 32px); }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; padding-block: 16px; }
.filters .field { flex: 1 1 150px; }
.filters .field-small { flex: 0 1 110px; }
.check { display: inline-flex; align-items: center; gap: 8px; height: 48px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--cobalt); }
.filters-actions { display: flex; align-items: center; gap: 16px; }
.filters-reset { font-size: .9375rem; color: var(--muted); text-underline-offset: .2em; }
.filters-toggle { display: none; }

/* Results */
.results { padding-top: 32px; padding-bottom: clamp(72px, 10vw, 136px); }
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; margin-bottom: 32px; }
.results-count { font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; }
.results-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.field-inline { display: flex; align-items: center; gap: 10px; }
.field-inline label { color: var(--muted); font-weight: 400; white-space: nowrap; }
.site-main .field-inline select { height: 40px; width: auto; }
.view-toggle { display: flex; border: 1px solid var(--line); }
.view-toggle a { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; text-decoration: none; font-weight: 500; color: var(--muted); }
.view-toggle a[aria-current] { background: var(--ink); color: var(--paper); }
.results-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 24px; }
.results-grid .card-name { font-size: 1.25rem; }

/* Live results: the button is only the no-JavaScript fallback (and closes the drawer on phones) */
.results-body { transition: opacity .2s; }
.results-body.is-loading { opacity: .45; }
@media (min-width: 861px) {
  .filters.is-live .filters-actions .btn { display: none; }
}

/* Map view */
.results-map { height: clamp(420px, 70vh, 720px); }
.map-fallback { padding: 24px; }
.map-pop { display: grid; gap: 2px; min-width: 160px; text-decoration: none; color: var(--ink) !important; font: 400 .9375rem/1.4 var(--font); }
.map-pop strong { font-weight: 500; font-size: 1rem; }
.map-pop span:last-child { font-weight: 500; font-variant-numeric: tabular-nums; }
.leaflet-popup-content-wrapper { border-radius: 0 !important; }

/* Empty state */
.empty { max-width: 640px; padding: 48px 0; display: grid; gap: 16px; }
.empty-title { font-size: clamp(1.5rem, 2.6vw, 2.125rem); font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.empty > p { color: var(--muted); }
.alert-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 8px; }
.alert-form .field { flex: 1 1 260px; }

[dir="rtl"] .search-title { letter-spacing: 0; line-height: 1.25; margin-inline-start: 0; font-weight: 600; }

@media (max-width: 1100px) {
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phones: the filters become a drawer behind "Filtres" (open by default when JavaScript is off) */
@media (max-width: 860px) {
  .filters-toggle:not([hidden]) { display: inline-flex; width: 100%; margin-block: 12px; }
  .filters.is-collapsible:not(.is-open) { display: none; }
  .filters { padding-top: 0; max-height: calc(100dvh - var(--header-h) - 80px); overflow-y: auto; }
  .filters .field, .filters .field-small { flex: 1 1 100%; }
  .filters-actions { flex: 1 1 100%; }
  .filters-actions .btn { flex: 1; }
  .results-grid { grid-template-columns: 1fr; }
  .results-head { margin-bottom: 24px; }
  .deal-tabs a { padding-inline-end: 16px; margin-inline-end: 16px; }
}
