/* ============================================================
   Feuille A4 brandée - moteur de rendu partagé (FicheSheet)
   Rendu STRICTEMENT identique entre l'aperçu écran et le PDF
   (le PDF est une capture html2canvas de ces mêmes feuilles).
   Extrait de la plateforme « Fiches techniques », mis en module.

   Tout est encapsulé sous .fiche-sheet-doc : les jetons de couleur
   sont locaux, donc le rendu ne dépend d'aucun thème d'app hôte.
   Seul --accent peut être surchargé (couleur de l'entreprise).
   ============================================================ */
.fiche-sheet-doc {
  --ink:       #1c1f2b;
  --ink-2:     #565a72;
  --ink-3:     #8b8fa6;
  --line:      #e6e7f1;
  --line-2:    #eef0f7;
  --field:     #f5f6fc;
  --accent:      #70A25B;
  --accent-ink:  #4d7a3b;
  /* Statique (pas de color-mix : html2canvas 1.4.1 ne sait pas parser
     color()/color-mix). Recalculé en JS si une couleur d'entreprise est fournie. */
  --accent-soft: #eef4eb;
  --shadow-sheet: 0 1px 3px rgba(28,30,46,.10), 0 12px 30px rgba(28,30,46,.10);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.fiche-sheet-doc .doc-pages {
  width: 794px;
  margin: 0;
  will-change: transform;
}
.fiche-sheet-doc .sheet {
  position: relative;
  width: 794px;
  height: 1123px;              /* A4 96dpi */
  background: #fff;
  color: var(--ink);
  border-radius: 3px;
  box-shadow: var(--shadow-sheet);
  padding: 38px 52px 30px;
  margin: 0 auto 26px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.fiche-sheet-doc .sheet:last-child { margin-bottom: 0; }
.fiche-sheet-doc .sheet-body { flex: 1 1 auto; min-height: 0; }

/* Barre accent en tête de feuille */
.fiche-sheet-doc .sheet::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: var(--accent); border-radius: 3px 3px 0 0;
}

/* ---------- En-tête entreprise ---------- */
.fiche-sheet-doc .sheet-head { flex: 0 0 auto; margin-bottom: 16px; }
.fiche-sheet-doc .sheet-head .sh-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.fiche-sheet-doc .sheet-head .sh-logo img { height: 62px; width: auto; display: block; }
.fiche-sheet-doc .sheet-head .sh-logo .sh-mono {
  display: flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 800; font-size: 1.1rem;
}
.fiche-sheet-doc .sheet-head .sh-ent { text-align: right; min-width: 0; padding-top: 2px; }
.fiche-sheet-doc .sheet-head .sh-rs { font-size: .92rem; font-weight: 700; color: var(--ink); }
.fiche-sheet-doc .sheet-head .sh-adr { font-size: .62rem; color: var(--ink-2); margin-top: 2px; }
.fiche-sheet-doc .sheet-head .sh-chiprow { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.fiche-sheet-doc .sheet-head .sh-chip {
  flex: 0 0 auto; background: var(--accent); color: #fff;
  font-size: .6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 12px 12px 0 12px;
}
.fiche-sheet-doc .sheet-head .sh-rule { flex: 1; height: 1px; background: var(--line); }

/* ---------- Pied entreprise ---------- */
.fiche-sheet-doc .sheet-foot {
  flex: 0 0 auto;
  display: grid; grid-template-columns: auto 1.25fr 1.15fr auto; align-items: center;
  gap: 4px 14px; margin-top: 14px; padding-top: 9px;
  border-top: 1.5px solid var(--accent);
}
/* Le « a » de la marque, en couleur, juste avant les coordonnées : une
   signature, pas un logo - d'où la petite taille. Sans emblème (une autre
   entreprise du groupe), la colonne disparaît d'elle-même. */
.fiche-sheet-doc .sheet-foot .sf-mark { display: flex; align-items: center; }
.fiche-sheet-doc .sheet-foot .sf-mark img { display: block; height: 26px; width: auto; }
.fiche-sheet-doc .sheet-foot .sf-l { display: flex; flex-direction: column; font-size: .58rem; color: var(--ink-2); line-height: 1.5; }
.fiche-sheet-doc .sheet-foot .sf-l b { font-size: .66rem; color: var(--ink); font-weight: 900; margin-bottom: 1px; }
.fiche-sheet-doc .sheet-foot .sf-c { display: flex; flex-direction: column; gap: 3px; font-size: .55rem; color: var(--ink-2); line-height: 1.45; }
.fiche-sheet-doc .sheet-foot .sf-site { font-weight: 800; color: var(--ink); }
.fiche-sheet-doc .sheet-foot .sf-site .tld { color: var(--accent); }
.fiche-sheet-doc .sheet-foot .sf-mentions { color: var(--ink-2); }
.fiche-sheet-doc .sheet-foot .sf-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.fiche-sheet-doc .sheet-foot .sf-page { font-size: .6rem; font-weight: 700; color: var(--ink); }
.fiche-sheet-doc .sheet-foot .sf-page b { font-weight: 800; }

/* ---------- Contenu fiche : bloc héro ---------- */
.fiche-sheet-doc .sheet-body .p-hero { display: flex; gap: 18px; align-items: flex-start; }
.fiche-sheet-doc .sheet-body .p-hero-main { flex: 1 1 auto; min-width: 0; }
.fiche-sheet-doc .sheet-body .p-hero h1 { font-size: 1.5rem; line-height: 1.15; font-weight: 900; letter-spacing: -.01em; color: var(--ink); margin: 0; }
.fiche-sheet-doc .sheet-body .p-sub { font-size: .82rem; color: var(--ink-3); margin-top: 5px; }
/* Encart photo : carré, la MOITIÉ de la largeur utile (690 / 2), calé en JS
   par fitHeroPhotos - la valeur ci-dessous n'est que le point de départ. */
.fiche-sheet-doc .sheet-body .p-photo {
  flex: 0 0 auto; align-self: flex-start;
  width: 345px; height: 345px;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; box-sizing: border-box;
}
.fiche-sheet-doc .sheet-body .p-photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* Couverture de livre : hauteur = contenu (JS), largeur suivant le ratio portrait. */
.fiche-sheet-doc .sheet-body .p-hero .p-cover {
  flex: 0 0 auto; align-self: flex-start; width: auto; height: auto;
  aspect-ratio: auto; border: none; padding: 0; background: transparent;
  align-items: flex-start; justify-content: flex-start;
}
.fiche-sheet-doc .sheet-body .p-hero .p-cover img {
  height: 100%; width: auto; max-width: 190px; object-fit: contain;
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
.fiche-sheet-doc .sheet-body .p-bib-author { font-weight: 600; color: var(--ink-2); margin-top: 3px; }

/* Carte d'identification */
.fiche-sheet-doc .sheet-body .p-idcard {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px;
  margin-top: 16px; padding: 12px 14px;
  background: var(--field); border-radius: 0;
}
.fiche-sheet-doc .sheet-body .p-idcard.cols2 { grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fiche-sheet-doc .sheet-body .p-idcard .idc-k { font-size: .6rem; font-weight: 700; letter-spacing: .02em; color: var(--ink-3); }
.fiche-sheet-doc .sheet-body .p-idcard .idc-v { font-size: .86rem; font-weight: 700; color: var(--ink); margin-top: 3px; word-break: break-word; }

/* ---------- Encart annexe : marque + gamme ---------- */
.fiche-sheet-doc .sheet-body .p-annex { margin-top: 22px; display: grid; grid-template-columns: 1fr; gap: 12px; }
.fiche-sheet-doc .sheet-body .p-annex.split { grid-template-columns: 1fr 1fr; align-items: stretch; }
.fiche-sheet-doc .sheet-body .p-annex .p-annex-k {
  font-size: .55rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 7px;
}
.fiche-sheet-doc .sheet-body .p-annex p { font-size: .72rem; line-height: 1.5; color: var(--ink-2); margin-top: 6px; }
.fiche-sheet-doc .sheet-body .p-brand, .fiche-sheet-doc .sheet-body .p-gamme {
  border-radius: 10px; padding: 13px 15px;
}
.fiche-sheet-doc .sheet-body .p-brand { background: var(--field); border: none; }
.fiche-sheet-doc .sheet-body .p-gamme { background: #fff; border: 1px solid var(--line); }
.fiche-sheet-doc .sheet-body .p-brand-head { display: flex; align-items: center; gap: 11px; }
.fiche-sheet-doc .sheet-body .p-brand-logo {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 9px;
  background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; padding: 6px; box-sizing: border-box;
}
.fiche-sheet-doc .sheet-body .p-brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fiche-sheet-doc .sheet-body .p-brand-name { font-size: .98rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.fiche-sheet-doc .sheet-body .p-brand-name span { display: block; font-size: .62rem; font-weight: 600; color: var(--ink-3); margin-top: 2px; }
.fiche-sheet-doc .sheet-body .p-gamme-name { font-size: .98rem; font-weight: 800; color: var(--ink); }
.fiche-sheet-doc .sheet-body .p-gamme-name span { font-size: .62rem; font-weight: 600; color: var(--ink-3); margin-left: 6px; }
.fiche-sheet-doc .sheet-body .p-gamme-dom { font-size: .66rem; font-weight: 600; color: var(--accent-ink); margin-top: 2px; }
.fiche-sheet-doc .sheet-body .p-gamme-carac { margin: 8px 0 0; padding-left: 15px; }
.fiche-sheet-doc .sheet-body .p-gamme-carac li { font-size: .7rem; color: var(--ink-2); line-height: 1.5; }
.fiche-sheet-doc .sheet-body .p-gammes { margin-top: 11px; }
.fiche-sheet-doc .sheet-body .p-gammes-lbl { font-size: .55rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.fiche-sheet-doc .sheet-body .p-gchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.fiche-sheet-doc .sheet-body .p-gchip {
  font-size: .66rem; font-weight: 600; color: var(--ink-2);
  background: #fff; border: none;
  border-radius: 999px; padding: 3px 10px;
}
.fiche-sheet-doc .sheet-body .p-gchip.on { background: var(--accent); color: #fff; }

/* Titre de section */
.fiche-sheet-doc .sheet-body h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink); margin: 22px 0 9px;
}
.fiche-sheet-doc .sheet-body h2 .h2-ic { flex: 0 0 auto; width: 15px; height: 15px; display: inline-flex; color: var(--ink); }
.fiche-sheet-doc .sheet-body h2 .h2-ic svg { width: 100%; height: 100%; display: block; }
.fiche-sheet-doc .sheet-body h2 .h2-rule { flex: 1; height: 1px; background: var(--line); margin-left: 3px; }

/* Tableau caractéristiques */
.fiche-sheet-doc .sheet-body .p-tbl {
  width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .82rem;
}
.fiche-sheet-doc .sheet-body .p-tbl.odd { background: var(--field); }
.fiche-sheet-doc .sheet-body .p-tbl td { padding: 7px 12px; vertical-align: top; }
.fiche-sheet-doc .sheet-body .p-tbl col.c1 { width: 38%; }
.fiche-sheet-doc .sheet-body .p-tbl td:first-child { color: var(--ink-2); font-weight: 500; }

.fiche-sheet-doc .sheet-body .p-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.fiche-sheet-doc .sheet-body .p-chip {
  font-size: .72rem; font-weight: 600;
  background: var(--accent-soft); border: none; color: var(--accent-ink);
  border-radius: 999px; padding: 4px 11px;
}

.fiche-sheet-doc .sheet-body .p-desc { font-size: .84rem; line-height: 1.62; color: var(--ink); margin: 0; }

.fiche-sheet-doc .sheet-body .p-usage {
  display: flex; gap: 10px; align-items: baseline;
  font-size: .84rem; line-height: 1.5; padding: 3px 0;
}
.fiche-sheet-doc .sheet-body .p-usage .b {
  flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink); transform: translateY(-2px);
}

/* Présentation : chapô résumé mis en avant */
.fiche-sheet-doc .sheet-body .p-lede { font-size: 1rem; line-height: 1.6; color: var(--ink); font-weight: 500; margin: 0; }
.fiche-sheet-doc .sheet-body .p-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 4px; }
.fiche-sheet-doc .sheet-body .p-meta .m { font-size: .74rem; color: var(--ink-2); }
.fiche-sheet-doc .sheet-body .p-meta .m b { color: var(--ink); font-weight: 700; }

/* ============================================================
   Affiche magasin - un document de RAYON, destiné à être IMPRIMÉ et posé
   en magasin. Il se lit à deux mètres : un bandeau de couleur qui accroche
   l'œil, un visuel qui occupe la moitié de la page, un nom en très gros, et
   deux ou trois arguments dans un bloc lisible. Aucun prix.
   ============================================================ */
.fiche-sheet-affiche .sheet { padding: 0; overflow: hidden; }

.fiche-sheet-affiche .af {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column;
}
/* Les trois bandes de l'affiche, empilées simplement. */
.fiche-sheet-affiche .af-bandeau,
.fiche-sheet-affiche .af-corps,
.fiche-sheet-affiche .af-pied { position: relative; }

/* ---- Bandeau de tête : aplat de la couleur d'accent ---- */
.fiche-sheet-affiche .af-bandeau {
  flex: 0 0 auto;
  min-height: 96px;
  padding: 0 44px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.fiche-sheet-affiche .af-marque {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 12px; padding: 10px 18px;
  max-width: 300px; min-height: 56px;
  font-size: 1.15rem; font-weight: 800; color: #1a1f16; letter-spacing: -.01em;
}
.fiche-sheet-affiche .af-marque img { max-height: 44px; max-width: 250px; object-fit: contain; display: block; }
.fiche-sheet-affiche .af-gamme {
  font-size: 1rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: #fff; border: 2px solid rgba(255,255,255,.75); border-radius: 999px;
  padding: 9px 22px; white-space: nowrap;
}

/* ---- Corps ---- */
.fiche-sheet-affiche .af-corps {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  padding: 34px 44px 0;
}

.fiche-sheet-affiche .af-visuel {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 30px;
}
/* Le visuel tient dans sa zone SANS JAMAIS être agrandi au-delà de sa taille
   réelle : une vignette de 190 px gonflée trois fois donne une bouillie de
   pixels, et c'est pire encore une fois détourée, le contour lissé devenant
   un halo. Un produit petit à l'écran, c'est le signal qu'il faut une photo
   plus grande - pas un défaut à masquer. */
.fiche-sheet-affiche .af-visuel img { max-width: 92%; max-height: 100%; object-fit: contain; }
.fiche-sheet-affiche .af-visuel.af-vide { min-height: 200px; }
.fiche-sheet-affiche .af-visuel.af-vide img { display: none; }

.fiche-sheet-affiche .af-titre { flex: 0 0 auto; }
.fiche-sheet-affiche .af-nom {
  font-size: 3.2rem; line-height: 1.02; font-weight: 900; letter-spacing: -.035em;
  color: #14180f; margin: 0;
  /* Un nom à rallonge ne doit pas manger la page : on borne à trois lignes. */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.fiche-sheet-affiche .af-cat {
  margin-top: 12px; padding-top: 12px;
  border-top: 4px solid var(--accent);
  display: inline-block;
  font-size: .95rem; font-weight: 600; color: #5c6552;
}

/* ---- Arguments : un bloc, pas une liste perdue dans le blanc ---- */
.fiche-sheet-affiche .af-args {
  flex: 0 0 auto;
  margin: 26px 0 30px; padding: 22px 26px; list-style: none;
  background: var(--accent-soft); border-radius: 16px;
  display: flex; flex-direction: column; gap: 13px;
}
.fiche-sheet-affiche .af-args li {
  position: relative; padding-left: 36px;
  font-size: 1.12rem; line-height: 1.32; font-weight: 650; color: #1d2318;
}
.fiche-sheet-affiche .af-args li::before {
  content: ''; position: absolute; left: 0; top: .12em;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent);
}
.fiche-sheet-affiche .af-args li::after {
  content: ''; position: absolute; left: 7px; top: .42em;
  width: 8px; height: 4px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg);
}

/* ---- Pied : bande sombre de la couleur d'accent ---- */
.fiche-sheet-affiche .af-pied {
  flex: 0 0 auto;
  padding: 18px 44px;
  /* Le même vert qu'en tête : la feuille est tenue entre deux bandeaux
     identiques, et non entre deux verts qui se ressemblent sans se répondre. */
  background: var(--accent);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  font-size: .86rem; color: rgba(255,255,255,.88);
}
/* ---- Code-barres : sur blanc, obligatoirement ----
   Un lecteur optique cherche du noir sur du blanc. Posé à même le vert, le
   code ne se scannerait pas - la pastille n'est pas une coquetterie. */
.fiche-sheet-affiche .af-cb {
  display: inline-flex; align-items: center;
  background: #fff; border-radius: 6px; padding: 6px 9px;
}
.fiche-sheet-affiche .af-cb svg { display: block; height: 46px; width: auto; }
.fiche-sheet-affiche .af-codes { font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.fiche-sheet-affiche .af-ent { font-weight: 800; color: #fff; }
/* Le logo de l'enseigne sur pastille blanche : les logos sont dessinés pour du
   blanc, ils disparaissent sur un aplat sombre. */
.fiche-sheet-affiche .af-ent-logo {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 9px; padding: 7px 13px;
  font-size: .86rem; font-weight: 800; color: #1a1f16;
}
.fiche-sheet-affiche .af-ent-logo img { height: 30px; max-width: 190px; object-fit: contain; display: block; }
/* Quand on dispose de la version blanche du logo, la pastille n'a plus de
   raison d'être : le logo se pose à même l'aplat, et le pied respire. */
.fiche-sheet-affiche .af-ent-logo.af-ent-blanc { background: none; padding: 0; }
.fiche-sheet-affiche .af-ent-logo.af-ent-blanc img { height: 38px; max-width: 210px; }
/* Logo de gamme : même traitement que la marque, sur le bandeau de couleur. */
.fiche-sheet-affiche .af-gamme-logo {
  background: #fff; border-color: #fff; padding: 8px 16px;
  display: inline-flex; align-items: center;
}
.fiche-sheet-affiche .af-gamme-logo img { height: 30px; max-width: 170px; object-fit: contain; display: block; }


/* ============================================================
   Les deux affiches - ce qui les sépare

   MAGASIN : imprimée, posée dans un rayon, lue de loin et en passant. Le nom
   du produit porte tout ; le pied donne au vendeur la référence et le
   code-barres.
   EMAIL : regardée sur un écran, souvent un téléphone, dans un fil de
   messages. On la lit vraiment : les arguments comptent plus que la taille du
   titre, et le pied renvoie au site plutôt qu'à une référence d'entrepôt.
   ============================================================ */

/* ---- Affiche magasin : tout pour la distance ---- */
.fiche-sheet-affiche .af-magasin .af-nom { font-size: 3.4rem; line-height: .96; }
.fiche-sheet-affiche .af-magasin .af-args { font-size: 1.06rem; }
.fiche-sheet-affiche .af-magasin .af-pied { padding: 14px 44px; }

/* ---- Affiche email : tout pour la lecture ---- */
.fiche-sheet-affiche .af-email .af-bandeau { min-height: 84px; }
.fiche-sheet-affiche .af-email .af-nom {
  font-size: 2.5rem; line-height: 1.04;
  -webkit-line-clamp: 4;
}
.fiche-sheet-affiche .af-email .af-visuel { flex: 1 1 auto; max-height: 44%; }
.fiche-sheet-affiche .af-email .af-args { gap: 16px; }
/* On aère, sans reprendre le retrait qui laisse la place à la puce. */
.fiche-sheet-affiche .af-email .af-args li { font-size: 1.14rem; line-height: 1.42; }
.fiche-sheet-affiche .af-email .af-site {
  font-weight: 800; color: #fff; letter-spacing: .02em;
}
.fiche-sheet-affiche .af-email .af-site .tld { color: rgba(255,255,255,.72); }

/* ---- Aperçu : deux feuilles côte à côte, chacune nommée ----
   L'étiquette vit HORS de la feuille : la capture ne prend que .sheet, elle
   ne se retrouvera donc jamais sur le document exporté. */
.fiche-sheet-affiche .doc-pages .sheet[data-variante] { position: relative; }
