/* ── Search filters bar ─────────────────────────── */
.search-filters {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: .875rem 0;
  margin-bottom: 1.5rem;
  position: sticky;
  top: var(--navbar-height);
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.search-filters-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

/* ── City autocomplete ─────────────────────────── */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  max-height: 200px;
  overflow-y: auto;
}
.autocomplete-dropdown li {
  padding: .5rem .75rem;
  cursor: pointer;
  font-size: .875rem;
}
.autocomplete-dropdown li:hover {
  background: var(--primary);
  color: var(--white);
}

/* ── Results grid ───────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}
@media (max-width: 1024px) { .results-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .results-grid { grid-template-columns: 1fr; } }

/* ── Referee card ───────────────────────────────── */
.referee-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease;
}
.referee-card:hover {
  border-color: var(--border-dark);
}
.referee-card-header { display: flex; align-items: center; gap: .85rem; }
.referee-card-avatar-wrap { flex-shrink: 0; }
.referee-card-avatar {
  width: 56px; height: 56px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--primary-tint);
}
.referee-card-avatar.avatar-initials {
  width: 56px; height: 56px;
  font-size: 1.1rem;
  background: var(--primary-tint);
  color: var(--primary-dark);
}
.referee-card-name { font-weight: 700; font-size: .95rem; }
.referee-card-location {
  display: flex; align-items: center; gap: .3rem;
  color: var(--text-secondary); font-size: .8rem;
}
.referee-card-rating { display: flex; align-items: center; gap: .75rem; }
.referee-card-matches { font-size: .8rem; color: var(--text-muted); }
.referee-card-sports { display: flex; flex-wrap: wrap; gap: .35rem; }
.referee-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--border); flex-wrap: wrap; gap: .5rem; }
.referee-card-price { font-size: 1.25rem; font-weight: 800; color: var(--primary-dark); }
.referee-card-actions { display: flex; gap: .5rem; }

/* Catégories sur la carte arbitre */
.referee-card-categories { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.cat-pill {
    font-size: .72rem; padding: .15rem .5rem;
    background: var(--surface-2); color: var(--text-secondary);
    border: 1px solid var(--border); border-radius: var(--radius-pill);
}

.radius-hint {
    display: inline-block; margin-left: .75rem;
    font-size: .82rem; color: var(--text-muted);
    padding-left: .75rem; border-left: 1px solid var(--border);
}
@media (max-width: 600px) {
    .radius-hint { display: block; margin: .35rem 0 0; padding: 0; border: none; }
}

/* ═══════════════════════════════════════════════════════════
   Cartes d'arbitres façon fiche produit (2 par ligne)
   ═══════════════════════════════════════════════════════════ */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.ref-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  display: flex; flex-direction: column;
}
.ref-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(17,24,39,.10); }

.ref-card-media { position: relative; aspect-ratio: 1 / 1; background: var(--surface); }
.ref-card-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-card-photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; font-weight: 700; color: var(--primary);
  background: var(--primary-tint);
}
.ref-card-badge {
  position: absolute; top: .6rem; left: .6rem;
  background: rgba(255,255,255,.95); color: var(--primary);
  font-size: .72rem; font-weight: 600; padding: .25rem .6rem;
  border-radius: var(--radius-pill); box-shadow: var(--shadow-sm);
}

.ref-card-body { padding: .85rem; display: flex; flex-direction: column; gap: .4rem; }
.ref-card-sports { display: flex; flex-wrap: wrap; gap: .3rem; }
.ref-chip {
  background: var(--surface); color: var(--text-secondary);
  font-size: .72rem; font-weight: 500; padding: .2rem .55rem;
  border-radius: var(--radius-pill);
}
.ref-card-name { font-weight: 700; font-size: 1rem; color: var(--text-primary); line-height: 1.2; }
.ref-card-meta { font-size: .82rem; color: var(--text-secondary); }
.ref-card-loc { display: inline-flex; align-items: center; gap: .25rem; }
.ref-card-loc svg { color: var(--primary); flex-shrink: 0; }

.ref-card-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: .3rem; padding-top: .6rem; border-top: 1px solid var(--border);
}
.ref-card-price { font-weight: 700; color: var(--primary); font-size: 1.05rem; }
.ref-card-price small { font-weight: 500; color: var(--text-muted); font-size: .78rem; }
.ref-card-rating { display: inline-flex; align-items: center; gap: .25rem; font-size: .85rem; font-weight: 600; color: var(--text-primary); }

/* Vue liste (affichage alternatif conservé) : une carte par ligne, plus compacte */
.results-grid.results-list { grid-template-columns: 1fr; }
.results-grid.results-list .ref-card { flex-direction: row; }
.results-grid.results-list .ref-card-media { width: 120px; aspect-ratio: 1 / 1; flex-shrink: 0; }
.results-grid.results-list .ref-card-body { flex: 1; }

@media (max-width: 380px) {
  .results-grid { gap: .75rem; }
  .ref-card-body { padding: .7rem; }
}

/* ═══════════════════════════════════════════════════════════
   Barre de recherche + chips + toggle + feuille de filtres
   ═══════════════════════════════════════════════════════════ */
.search-topbar { margin-bottom: 1.25rem; }

.search-inputline {
  display: flex; align-items: center; gap: .5rem;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: .35rem .35rem .35rem 1rem;
  box-shadow: var(--shadow-sm); margin-bottom: 1rem;
}
.search-inputline-field { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; }
.search-inputline-field svg { color: var(--text-muted); flex-shrink: 0; }
.search-inputline-field :deep(.location-picker),
.search-inputline-field .location-picker { flex: 1; }
.search-inputline-date {
  border: none; background: transparent; font-size: .9rem;
  color: var(--text-secondary); outline: none; max-width: 140px;
}
.search-go {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--primary); color: #fff; border: none;
  border-radius: 50%; cursor: pointer; transition: background .12s;
}
.search-go:hover { background: var(--primary-hover); }

.chip-row {
  display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row-wrap { flex-wrap: wrap; overflow: visible; }

.filter-chip {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  padding: .55rem 1rem; border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius-pill); font-size: .88rem; font-weight: 500;
  color: var(--text-secondary); cursor: pointer; transition: all .12s;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip-on,
.filter-chip-on:hover,
.filter-chip-on:focus,
.filter-chip-on:active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-chip-more { font-weight: 600; color: var(--text-primary); }

.results-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem;
}
.results-count { color: var(--text-secondary); font-size: .9rem; }
.results-count strong { color: var(--text-primary); }
.view-toggle { display: flex; gap: .25rem; background: var(--surface); border-radius: var(--radius-pill); padding: .2rem; }
.view-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 32px; border: none; background: transparent;
  border-radius: var(--radius-pill); color: var(--text-muted); cursor: pointer;
}
.view-toggle-btn.on { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

/* Feuille de filtres */
.filter-sheet-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,.4);
  display: flex; align-items: flex-end; justify-content: center; z-index: 1000;
}
.filter-sheet {
  background: #fff; width: 100%; max-width: 560px;
  border-radius: 24px 24px 0 0; max-height: 85vh; display: flex; flex-direction: column;
  animation: sheet-up .2s ease;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.filter-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.25rem .75rem;
}
.filter-sheet-head h3 { margin: 0; font-size: 1.3rem; }
.filter-sheet-close { border: none; background: var(--surface); width: 36px; height: 36px; border-radius: 50%; font-size: 1rem; cursor: pointer; color: var(--text-secondary); }
.filter-sheet-body { padding: .5rem 1.25rem 1rem; overflow-y: auto; }
.filter-group { margin-bottom: 1.5rem; }
.filter-group-label { display: block; font-weight: 700; margin-bottom: .75rem; font-size: 1rem; }
.filter-sheet-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-top: 1px solid var(--border);
}
.filter-reset { border: none; background: none; text-decoration: underline; color: var(--text-secondary); cursor: pointer; font-size: .95rem; }
.filter-apply { background: var(--primary); color: #fff; border: none; padding: .85rem 2rem; border-radius: var(--radius-pill); font-weight: 600; font-size: .95rem; cursor: pointer; }
.filter-apply:hover { background: var(--primary-hover); }

@media (min-width: 720px) {
  .filter-sheet { align-self: center; border-radius: 24px; margin: auto; max-height: 80vh; }
  .filter-sheet-overlay { align-items: center; }
}

/* ═══════════════════════════════════════════════════════════
   Correctifs : barre localisation simplifiée + Filtres toujours visible
   ═══════════════════════════════════════════════════════════ */

/* Ligne localisation : le LocationPicker s'étale proprement, date + bouton à droite */
.search-locrow {
  display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem;
}
.search-locrow-picker { flex: 1; min-width: 0; }
/* Le LocationPicker gère déjà sa propre présentation ; on le laisse respirer */
.search-locrow-picker .location-picker { width: 100%; }
.search-locrow-date {
  border: 1px solid var(--border); background: #fff; border-radius: var(--radius-md);
  padding: .6rem .7rem; font-size: .88rem; color: var(--text-secondary);
  outline: none; flex-shrink: 0;
}

/* Bouton Filtres toujours visible, à droite du compteur */
.results-header-actions { display: flex; align-items: center; gap: .6rem; }
.filter-open-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1rem; border: 1px solid var(--border-dark); background: #fff;
  border-radius: var(--radius-pill); font-size: .88rem; font-weight: 600;
  color: var(--text-primary); cursor: pointer; transition: all .12s; white-space: nowrap;
}
.filter-open-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Sur mobile, la date peut être un peu plus compacte */
@media (max-width: 420px) {
  .search-locrow-date { max-width: 120px; }
}

/* Champs heure de la barre de recherche */
.search-locrow-time {
  border: 1px solid var(--border); background: #fff; border-radius: var(--radius-md);
  padding: .6rem .5rem; font-size: .85rem; color: var(--text-secondary);
  outline: none; flex-shrink: 0; width: 92px;
}
@media (max-width: 520px) {
  .search-locrow { flex-wrap: wrap; }
  .search-locrow-picker { flex: 1 1 100%; }
  .search-locrow-date, .search-locrow-time { flex: 1; width: auto; }
}

/* Badge "matchs déjà prévus" sur la carte (affiché seulement si heure de recherche vide) */
.ref-card-busy {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .74rem; font-weight: 600; color: var(--warning);
  background: var(--warning-tint); padding: .2rem .5rem; border-radius: var(--radius-pill);
  align-self: flex-start;
}

/* Aide sous la barre de recherche (heure optionnelle) */
.search-time-hint {
  font-size: .78rem; color: var(--text-muted); margin: -.5rem 0 1rem;
  line-height: 1.4;
}
/* Placeholder visuel pour les champs heure vides */
.search-locrow-time:invalid, .search-locrow-time:not(:focus):placeholder-shown { color: var(--text-muted); }

/* Bandeau "on affiche tous les arbitres" (repli quand 0 résultat) */
.fallback-hint {
  background: var(--primary-tint); border: 1px solid var(--primary-border);
  color: var(--primary-dark, var(--primary)); border-radius: var(--radius-md);
  padding: .75rem 1rem; font-size: .88rem; margin-bottom: 1rem; line-height: 1.4;
}
