/* ===== SYLVARIS — Panneau de filtres ===== */

.filters-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  position: sticky;
  /* --h-entete est mesurée puis publiée par main.js : la hauteur du bandeau
     collé dépend de la police du titre et du palier d'affichage, un nombre
     écrit ici serait faux au premier changement. La valeur de :root ne sert
     que le temps du premier rendu, avant que le script ne passe. */
  top: calc(var(--h-entete) + var(--space-sm));
}

.filters-panel__title {
  font-size: var(--fz-md);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filters-panel__title span { font-family: var(--font-display); }

.filters-reset-btn {
  font-size: var(--fz-xs);
  color: var(--text-muted);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--tr-fast);
}
.filters-reset-btn:hover { color: var(--accent); }

/* ---- Groupes ---- */
.filter-group {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}
.filter-group:last-child { border: none; margin-bottom: 0; padding-bottom: 0; }

.filter-group__label {
  font-size: var(--fz-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  display: block;
}

/* ---- Recherche texte ---- */
.search-input-wrap {
  position: relative;
  min-width: 0;   /* peut se réduire quand il est posé dans une barre en flex */
}
.search-input-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
  pointer-events: none;
}
/* width:100% — sans quoi le champ garde sa largeur naturelle, celle d'une
   vingtaine de caractères, et déborde de son conteneur dès que celui-ci est
   plus étroit. Un input ne se réduit pas de lui-même : c'est un élément en
   ligne, sa taille vient de son contenu, pas de la place disponible. */
.search-input-wrap .form-control {
  width: 100%;
  padding-left: 36px;
}

/* ---- Chips de sélection ---- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
.chip-group--months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.chip-group--months .chip {
  justify-content: center;
  padding: 4px 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--fz-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr-fast);
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--clr-sage-pale);
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Chips couleur floraison (avec texte) */
.chip--color {
  padding: 4px 10px;
  gap: 6px;
}
.chip__color-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.15);
  flex-shrink: 0;
}

/* Chips couleur floraison pastilles uniquement */
.chip-group--colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip--color-pastille {
  padding: 3px;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  background: transparent;
  transition: border-color var(--tr-fast), transform var(--tr-fast);
  position: relative;
}
.chip--color-pastille:hover {
  border-color: var(--accent);
  transform: scale(1.15);
}
/* Sélection multiple : plusieurs pastilles restent allumées côte à côte. Le
   seul cerclage vert ne se distinguait pas du survol — l'anneau extérieur
   marque la sélection, et il survit au passage de la souris ailleurs. Pas
   d'agrandissement ici : ajouté au survol, il ferait déborder les pastilles
   sur leurs voisines, l'écart n'étant que de 6 px. */
.chip--color-pastille.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.1);
  display: block;
}
/* "Sans floraison" : pastille barrée */
.color-swatch--no-flower {
  border-color: var(--border);
}
.color-swatch--no-flower-inner {
  background: #F0F0F0;
  position: relative;
  overflow: hidden;
}
.color-swatch--no-flower-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom right,
    transparent 45%,
    #D0D0D0 45%,
    #D0D0D0 55%,
    transparent 55%
  );
}

/* Chips exposition */
.chip--exposition svg { width: 14px; height: 14px; }

/* ---- Visualisation strate ---- */
.strate-visual {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .3s ease, opacity .25s ease, margin-top .3s ease;
  margin-top: 0;
}
.strate-visual.visible {
  max-height: 160px;
  opacity: 1;
  margin-top: 12px;
}
.strate-visual-inner {
  background: var(--clr-sage-pale);
  border-radius: var(--radius-md);
  padding: 10px 10px 8px;
  border: 1px solid var(--border);
}
.height-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 86px;
  position: relative;
  margin-bottom: 5px;
}
.height-chart::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.hbar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: var(--border);
  position: relative;
  transition: background .2s;
}
.hbar.highlighted { background: var(--accent); }
/* Survol d'une barre non retenue : elle s'éclaircit le temps que la ligne du
   bas la décrive, sans se faire passer pour sélectionnée. */
.hbar:not(.highlighted):hover { background: var(--clr-sage-light); }
.height-chart:hover .hbar { cursor: help; }
.height-chart-labels {
  display: flex;
  gap: 3px;
}
.hbar-label {
  flex: 1;
  text-align: center;
  font-size: 8px;
  color: var(--text-muted);
  line-height: 1.2;
  transition: color .2s;
}
.hbar-label.highlighted { color: var(--accent); font-weight: 700; }
.strate-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}
.strate-info-name  { font-size: 11px; font-weight: 700; color: var(--accent); }
.strate-info-range {
  font-size: 10px;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* ---- Visualisation rusticité : un ruban de températures ----
   Même cadre et même repli que le schéma des strates, mais lu à l'horizontale :
   une hauteur se représente en hauteur, une température le long d'une échelle.
   Les segments gardent leur couleur en permanence — c'est le dégradé du froid
   au chaud qui porte le sens — mais restent éteints tant qu'ils ne sont pas
   choisis, sans quoi rien ne distinguerait la sélection. */
.rustic-visual {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  transition: max-height .3s ease, opacity .25s ease, margin-top .3s ease;
}
.rustic-visual.visible {
  max-height: 160px;
  opacity: 1;
  margin-top: 12px;
}
.temp-ruban {
  display: flex;
  gap: 2px;
  height: 26px;
  margin-bottom: 5px;
}
.temp-seg {
  flex: 1;
  position: relative;
  background: var(--seg);
  /* Éteint : la teinte est presque effacée mais la place reste tenue */
  filter: saturate(.12) opacity(.5);
  transition: filter .25s ease, transform .25s ease;
}
.temp-seg:first-child { border-radius: 5px 0 0 5px; }
.temp-seg:last-child  { border-radius: 0 5px 5px 0; }
.temp-seg.highlighted {
  filter: none;
  transform: scaleY(1.18);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  z-index: 1;
}
/* Survol d'un segment non retenu : il se ravive à mi-chemin, assez pour dire
   « c'est celui-ci que la ligne du bas décrit » sans se faire passer pour
   sélectionné. :not() plutôt qu'un ordre de déclaration, pour que la règle
   reste juste où qu'on la déplace dans le fichier. */
.temp-seg:not(.highlighted):hover { filter: saturate(.55) opacity(.85); }
.temp-ruban:hover .temp-seg { cursor: help; }

.temp-labels { display: flex; gap: 2px; }
.temp-label {
  flex: 1;
  text-align: center;
  font-size: 8px;
  color: var(--text-muted);
  line-height: 1.2;
  transition: color .2s;
}
.temp-label.highlighted { color: var(--text-primary); font-weight: 700; }

/* ---- Pied de liste : « Voir plus » ---- */
.liste-suite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}
.suite-compte {
  font-size: var(--fz-xs);
  color: var(--text-muted);
  letter-spacing: .04em;
}
.suite-btn { min-width: 220px; }
.suite-btn__reste { font-weight: 400; opacity: .75; }
.suite-btn:disabled { opacity: .6; cursor: progress; }
/* Fin de liste : discret, mais dire que c'est fini évite de croire que le
   chargement s'est interrompu. */
.suite-fin {
  font-size: var(--fz-xs);
  font-style: italic;
  color: var(--text-muted);
}

/* ---- Slider hauteur ---- */
.range-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.range-group label {
  font-size: var(--fz-xs);
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}
.range-group input[type=range] {
  width: 100%;
  accent-color: var(--accent);
}

/* ---- Barre de résultats ---- */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}
/* Posé dans le groupe de droite, juste avant le bouton d'ajout : largeur fixe
   plutôt qu'élastique, sinon il repousserait les boutons hors de la barre. */
.results-bar__recherche {
  width: 240px;
  flex-shrink: 0;
}
.results-bar__recherche .form-control {
  font-size: var(--fz-sm);
  padding-left: 34px;
}
@media (max-width: 700px) {
  /* Sur écran étroit, la barre se replie : le champ prend une ligne entière
     plutôt que de se réduire à un timbre-poste entre deux boutons. */
  .results-bar__recherche { width: 100%; }
}

.results-count {
  font-size: var(--fz-sm);
  color: var(--text-secondary);
}
.results-count strong { color: var(--text-primary); }

/* Bouton filtre mobile */
.filters-toggle-btn {
  display: none;
  align-items: center;
  gap: var(--space-xs);
}
/* Raccourci d'ajout, en tête de liste : « Ajouter un végétal » sur l'accueil,
   « Ajouter un livre » sur la bibliothèque */
.btn-ajout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
}
.btn-ajout svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  flex-shrink: 0;
}
/* Sur écran étroit, la barre est déjà chargée : on ne garde que le « + » */
@media (max-width: 420px) {
  .btn-ajout span { display: none; }
}
@media (max-width: 900px) {
  .filters-toggle-btn { display: flex; }
  .filters-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: var(--z-drawer);
    width: 320px;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform var(--tr-slow);
    max-height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
  }
  .filters-panel.open { transform: translateX(0); }
}

/* Les puces de filtres actifs (.active-filters / .active-filter-chip) ont été
   retirées le 05/09/2026 : Didier les trouvait inesthétiques, et un filtre se
   retire déjà en recliquant sur sa puce dans le panneau. Le balisage et le
   script sont partis avec — voir search.js. Rien ne les référence plus. */
