/* ---------------------------------------------------------------------
   Catalogue web — grille, recherche, sélection de devis.

   Cette feuille n'invente aucun token. Elle consomme ceux de pe.css, qui
   font autorité depuis la validation de la direction artistique du
   29/08/2026 : --paper, --surface, --line, --ink, --accent, --s*. Si la
   palette bouge, ce fichier suit sans être touché.

   Les états sombres ne sont pas redéfinis ici : pe.css bascule les tokens,
   et tout ce qui est écrit ci-dessous passe par eux.
   ------------------------------------------------------------------ */

/* --- grille de cartes ------------------------------------------------ */
.pe-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--s5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pe-carte {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* La zone d'image a un rapport fixe : sans lui, les vignettes de 150 à
   300 px feraient sauter la hauteur des lignes de la grille pendant le
   chargement différé. La réserver évite le décalage de mise en page. */
.pe-carte__visuel {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Jamais d'agrandissement : une vignette de 207 px reste à sa taille et
   se centre. L'étirer la rendrait floue, ce que la consigne interdit. */
.pe-carte__visuel img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.pe-carte__vide {
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  padding: var(--s4);
}

.pe-carte__corps {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4);
  flex: 1;
}

.pe-carte__titre {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  margin: 0;
  text-wrap: balance;
}

.pe-carte__titre a { color: var(--ink); text-decoration: none; }
.pe-carte__titre a:hover { text-decoration: underline; text-underline-offset: 3px; }

.pe-carte__ref {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--ink-3);
}

.pe-carte__faits {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Pied en COLONNE, pas en ligne. « Sur devis » et « Ajouter à ma demande »
   côte à côte demandent 230 px là où une carte de la grille en offre 224 :
   le bouton sortait de la carte de 7,6 px et le libellé « Sur devis » se
   coupait en deux lignes. Empiler règle les deux d'un coup, et donne au
   bouton une cible tactile pleine largeur. */
/* La liste des catalogues d'une famille éclatée en sous-catégories. Repliée par
   défaut : sept entrées sous « Mobilier » écraseraient la carte. */
.pe-carte__pdfs { font-size: 13px; }
.pe-carte__pdfs summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: var(--s1) 0; }
.pe-carte__pdfs summary:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.pe-carte__pdfs ul { margin: var(--s2) 0 0; padding: 0 0 0 var(--s4); list-style: none; display: grid; gap: var(--s2); }
.pe-carte__pdfs li { line-height: 1.35; }
.pe-carte__pdfs a { color: var(--ink); }

.pe-carte__pied {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--s2);
  margin-top: auto;
  padding-top: var(--s3);
}

.pe-carte__pied .btn { width: 100%; white-space: normal; }

.pe-carte__devis {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

/* --- recherche ------------------------------------------------------- */
.pe-recherche { position: relative; }

.pe-recherche__champ {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field-line, var(--line));
  border-radius: var(--radius);
}

.pe-recherche__etat {
  margin-top: var(--s3);
  font-size: 13px;
  color: var(--ink-3);
  min-height: 1.4em;
}

.pe-recherche__resultats {
  margin: var(--s4) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s2);
}

.pe-resultat {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pe-resultat img { width: 44px; height: 44px; object-fit: contain; background: var(--surface-2); border-radius: 2px; }
.pe-resultat__nom { flex: 1; font-size: 13.5px; line-height: 1.35; }
.pe-resultat__ref { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--ink-3); display: block; }

/* --- sélection ------------------------------------------------------- */
.pe-compteur {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent, #fff);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pe-compteur[hidden] { display: none; }

.pe-selection__table { width: 100%; border-collapse: collapse; }
.pe-selection__table th,
.pe-selection__table td { padding: var(--s3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.pe-selection__table th { font-size: 12px; letter-spacing: .04em; color: var(--ink-3); font-weight: 500; }
.pe-selection__qte { width: 84px; min-height: 40px; padding: 8px; font: inherit; text-align: right; font-variant-numeric: tabular-nums;
  border: 1px solid var(--field-line, var(--line)); border-radius: var(--radius); background: var(--surface); color: var(--ink); }

.pe-message {
  padding: var(--s4);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.55;
}
.pe-message--erreur { border-color: var(--wood); background: var(--wood-wash); color: var(--ink); }
.pe-message--succes { border-color: var(--accent-line); background: var(--accent-wash); }

/* Le chargement différé ne doit pas faire clignoter la grille. */
.pe-carte__visuel img[loading="lazy"] { background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
