/* Recherche — /recherche (D-80, ecran 3a)
 *
 * Reprend le vocabulaire de site.css (.gat-crumbs, .gat-facet-title,
 * .gat-facet-aside, .gat-tiles, .gat-section) et ne corrige que ce que le
 * theme laissait casser :
 * - .gat-results-layout etait en « 250px 1fr » : 1fr refuse de descendre
 *   sous la largeur de son contenu, une reference sans espace poussait la
 *   page. Ici minmax(0, 1fr) partout ;
 * - sous 1180 px la colonne de filtres passait AU-DESSUS de la liste, en
 *   pleine hauteur : a 375 px le premier resultat arrivait a 1 555 px.
 *   « Quel vitrage ? » passe en pastilles dans l'en-tete, marque et
 *   carrosserie se replient, l'aide passe apres la liste.
 * Toutes les adresses de filtre sont de simples liens : rien n'exige JS.
 */

/* Les icones d'Icone::svg n'ont ni largeur ni hauteur propres. */
.gat-rech-ico { width: 17px; height: 17px; flex: none; }

/* Le gabarit commun s'en sert sans que site.css le definisse. */
.gat-page-recherche .visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.gat-rech-note { font-size: 13px; color: var(--muted); margin: var(--space-4) 0 0; }

/* — la case — */
.gat-rech-form { display: flex; gap: var(--space-2); max-width: 680px; margin-top: var(--space-6); }
.gat-rech-form input[type="search"] {
  flex: 1 1 auto; min-width: 0; min-height: 50px; padding: 10px 14px;
  font: inherit; font-size: 16px; color: var(--ink); caret-color: var(--color-accent-600);
  background: var(--color-neutral-100);
  border: 1px solid var(--line-input); border-radius: var(--radius-md);
}
.gat-rech-form input[type="search"]:hover { border-color: var(--color-neutral-700); }
.gat-rech-form input[type="search"]:focus-visible { border-color: var(--focus); outline-offset: 0; }
.gat-rech-form .btn { flex: none; min-height: 50px; padding-inline: var(--space-8); font-size: 15px; }

/* ═══════════════════════════════════════════════ page sans demande ══ */

.gat-rech-accueil { padding: calc(var(--space-8) * 2) var(--bleed) calc(var(--space-8) * 1.6); }
.gat-rech-accueil h1 { font-size: 44px; line-height: 1.06; max-width: 20ch; margin-top: var(--space-2); text-wrap: balance; }
.gat-rech-accueil .gat-lede { margin-top: var(--space-4); }
.gat-rech-exemples { font-size: 14px; color: var(--muted); margin: var(--space-4) 0 0; }
.gat-rech-exemples a { font-weight: 500; }

.gat-rech-schema { max-width: 520px; margin: 0 0 var(--space-6); }
.gat-rech-schema svg { display: block; width: 100%; height: auto; }

.gat-rech-positions {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-3);
}
.gat-rech-positions a,
.gat-rech-positions .is-vide {
  display: flex; flex-direction: column; gap: var(--space-1); height: 100%;
  padding: var(--space-6); border-radius: var(--radius-md);
  background: var(--color-neutral-100); box-shadow: 0 0 0 1px var(--line);
  text-decoration: none; color: inherit;
}
.gat-rech-positions a:hover { box-shadow: 0 0 0 1px var(--color-accent-600); color: var(--color-accent-700); }
.gat-rech-positions .gat-rech-ico { width: 22px; height: 22px; color: var(--color-accent-600); margin-bottom: var(--space-2); }
.gat-rech-positions .nom { font-family: var(--font-heading); font-weight: 500; font-size: 17px; }
.gat-rech-positions .n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gat-rech-positions .is-vide { opacity: .5; }

/* ═══════════════════════════════════════════════════════ resultats ══ */

/* Le terme cherche peut etre un mot de 80 caracteres sans espace : il se
   coupe, dans le fil d'Ariane comme dans le titre, plutot que d'elargir la page. */
.gat-page-recherche .gat-crumbs > * { min-width: 0; overflow-wrap: anywhere; }

.gat-rech-tete { padding: var(--space-4) var(--bleed) var(--space-8); }
.gat-rech-tete h1 { font-size: 34px; line-height: 1.1; margin: 0; overflow-wrap: anywhere; }
.gat-rech-tete h1 .sep { margin: 0 .3em; color: var(--muted); }
.gat-rech-compte { font-size: 15px; color: var(--muted); margin: var(--space-3) 0 0; max-width: 72ch; }

/* — « Quel vitrage ? » : pastilles — */
.gat-rech-quel { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin-top: var(--space-8); }
.gat-rech-quel-titre { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.gat-rech-puces { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.gat-rech-puces a,
.gat-rech-puces .is-vide {
  display: inline-flex; align-items: baseline; gap: var(--space-3);
  min-height: 36px; padding: 7px 14px; border-radius: 999px; font-size: 14px;
  color: var(--ink); text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.gat-rech-puces a:hover { color: var(--color-accent-700); box-shadow: inset 0 0 0 1px var(--color-accent-600); }
.gat-rech-puces a.is-actif {
  color: var(--color-accent-700); font-weight: 600;
  background: color-mix(in srgb, var(--color-accent) 16%, transparent);
  box-shadow: inset 0 0 0 1px var(--color-accent-600);
}
.gat-rech-puces .is-vide { color: var(--muted); opacity: .5; }

.gat-rech-actifs { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.gat-rech-actifs a {
  display: inline-flex; align-items: center; gap: var(--space-3);
  min-height: 36px; padding: 6px 10px 6px 14px; border-radius: 999px; font-size: 13px;
  color: var(--color-accent-700); text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--color-accent-600);
}
.gat-rech-actifs a:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.gat-rech-actifs .x { font-size: 16px; line-height: 1; }

.gat-filtre-n { font-size: 12px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }

/* — corps : filtres et aide a gauche, liste a droite — */
.gat-rech-corps {
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  grid-template-areas: "filtres liste" "aide liste";
  grid-template-rows: auto 1fr;
  column-gap: calc(var(--space-8) * 1.8); row-gap: var(--space-8);
  align-items: start;
  padding: 0 var(--bleed) calc(var(--space-8) * 2);
}
.gat-rech-corps > * { min-width: 0; }
.gat-rech-corps.is-seul { grid-template-columns: minmax(0, 1fr); grid-template-areas: "liste"; }
.gat-rech-filtres { grid-area: filtres; }
.gat-rech-liste { grid-area: liste; }
.gat-rech-aide-zone { grid-area: aide; }

/* Sur grand ecran le repli n'a pas de sens : le resume disparait, le
   contenu reste ouvert (open est pose dans le balisage). */
.gat-rech-affiner > summary { display: none; }
.gat-rech-affiner { display: grid; gap: var(--space-8); }
.gat-rech-groupe h2.gat-facet-title { font-family: var(--font-body); font-weight: 400; line-height: 1.4; letter-spacing: .1em; }

.gat-filtres { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 14px; }
.gat-filtres a {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3);
  padding: 4px var(--space-2); margin-inline: calc(var(--space-2) * -1);
  border-radius: var(--radius-sm); color: inherit; text-decoration: none;
}
.gat-filtres a:hover { color: var(--color-accent-700); background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.gat-filtres a.is-actif { color: var(--color-accent-700); font-weight: 600; background: color-mix(in srgb, var(--color-accent) 16%, transparent); }
.gat-filtres .gat-wordmark { font-size: .86em; }

.gat-rech-plus { margin-top: var(--space-2); }
.gat-rech-plus summary { cursor: pointer; font-size: 13px; color: var(--link); padding: 4px 0; }
.gat-rech-plus[open] summary { margin-bottom: var(--space-2); }

.gat-rech-aide { display: grid; gap: var(--space-2); }
.gat-rech-aide p { margin: var(--space-1) 0 var(--space-2); }
.gat-rech-aide .btn { min-height: 42px; }
.gat-rech-aide .gat-wa .gat-rech-ico { color: #3f8f74; }
.gat-rech-guide { font-size: 13px; margin-top: var(--space-1); }

/* L'avis des designations partagees vit avec les lignes (ligne-produit.css,
   .gat-homonymes) : les pages marque et carrosserie le portent aussi. */

.gat-rech-pages {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-4); margin-top: var(--space-8); font-size: 14px; color: var(--muted);
}
.gat-rech-pages .btn { min-height: 42px; }
.gat-rech-confirme { font-size: 13px; color: var(--muted); margin: var(--space-8) 0 0; }
/* Les quatre promesses (site._promesses) : sous les exemples de la recherche
   vide seulement. Avec des resultats, le pied de page les porte. */
.gat-rech-promesses { margin-top: var(--space-8); }

.gat-rech-rien { max-width: 70ch; }
.gat-rech-rien h2 { font-size: 26px; overflow-wrap: anywhere; }
.gat-rech-rien p { color: var(--muted); }
.gat-rech-issues { list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.gat-rech-issues a {
  display: flex; align-items: center; gap: var(--space-4);
  min-height: 48px; padding: var(--space-4) var(--space-6); border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--line); text-decoration: none; color: var(--ink);
  font-family: var(--font-heading); font-weight: 500;
}
.gat-rech-issues a:hover { box-shadow: 0 0 0 1px var(--color-accent-600); color: var(--color-accent-700); }
.gat-rech-issues .gat-rech-ico { color: var(--color-accent-600); }
.gat-rech-issues .gat-wa .gat-rech-ico { color: #3f8f74; }

/* ═══════════════════════════════════════════════════ petits ecrans ══ */

@media (max-width: 1180px) {
  .gat-rech-positions { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Une colonne : le repli marque / carrosserie, la liste, puis l'aide. */
  .gat-rech-corps {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "filtres" "liste" "aide";
    grid-template-rows: none;
    row-gap: var(--space-6);
  }
  .gat-rech-affiner { display: block; }
  .gat-rech-affiner > summary {
    display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px;
    border-radius: 999px; cursor: pointer; font-size: 14px; color: var(--color-accent-700);
    box-shadow: inset 0 0 0 1px var(--color-accent-600);
  }
  .gat-rech-affiner[open] > summary { margin-bottom: var(--space-6); }
  .gat-rech-affiner .gat-rech-groupe + .gat-rech-groupe { margin-top: var(--space-6); }

  /* Les filtres en pastilles qui passent a la ligne. */
  .gat-filtres { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .gat-filtres a {
    justify-content: flex-start; margin: 0; padding: 6px 12px; min-height: 36px; align-items: center;
    border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong);
  }
  .gat-filtres a.is-actif { box-shadow: inset 0 0 0 1px var(--color-accent-600); }
  .gat-rech-aide { max-width: 520px; }
}

@media (max-width: 860px) {
  .gat-rech-accueil { padding-top: calc(var(--space-8) * 1.2); }
  .gat-rech-accueil h1 { font-size: 30px; }
  .gat-rech-tete h1 { font-size: 26px; }
  .gat-rech-quel { margin-top: var(--space-6); }
  .gat-rech-positions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gat-rech-positions a, .gat-rech-positions .is-vide { padding: var(--space-4); }
  .gat-rech-positions .nom { font-size: 15px; }
  .gat-rech-form .btn { padding-inline: var(--space-4); }
  .gat-rech-puces a, .gat-rech-puces .is-vide { min-height: 34px; padding: 6px 12px; font-size: 13px; }
}

/* Sous 420 px le bouton ne garde que sa loupe : la case garde la place. */
@media (max-width: 420px) {
  .gat-rech-form .btn { font-size: 0; gap: 0; width: 50px; padding: 0; }
  .gat-rech-form .btn .gat-rech-ico { width: 20px; height: 20px; }
}
