/* La fiche technique complète : une feuille qui monte du bas sur téléphone, un panneau à droite sur ordinateur.
   Le plateau reste visible à gauche sur ordinateur : on lit la fiche à côté du poêle. */
.fiche-tech {
  padding: 0; border: 0; color: var(--encre); background: transparent;
  margin: 0 0 0 auto; width: min(620px, 100vw); max-width: none; height: 100dvh; max-height: none; overflow: visible;
}
.fiche-tech::backdrop { background: rgba(18, 22, 30, .45); }
.ft-feuille {
  display: flex; flex-direction: column; height: 100%;
  background: var(--neige);
  box-shadow: 0 0 0 1px rgba(18, 22, 30, .06), -30px 0 80px -30px rgba(18, 22, 30, .5);
}
.ft-haut {
  flex: none; display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem var(--marge) .9rem; padding-top: calc(1rem + env(safe-area-inset-top));
  border-bottom: 1px solid var(--trait-doux);
}
.ft-titre { flex: 1; min-width: 0; }
.ft-type { margin: 0; font-size: .9375rem; color: var(--encre-2); }
.ft-type b { color: var(--encre); font-weight: 600; }
.ft-nom { margin-top: .2rem; font-family: var(--f-titre); font-size: clamp(1.7rem, 1.35rem + 1.2vw, 2.3rem); line-height: 1.04; letter-spacing: -.02em; }
.ft-nom .mot { white-space: nowrap; }
.ft-fermer {
  flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 48px; padding: 0 1rem;
  border: 0; border-radius: 999px; background: var(--encre); color: var(--papier);
  font: 600 .9375rem var(--f-texte); cursor: pointer; touch-action: manipulation; transition: transform 160ms var(--ease-out);
}
.ft-fermer:active { transform: scale(.97); }
.ft-fermer .ic { width: 1.1em; height: 1.1em; }

.ft-corps {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 var(--marge) 2rem; display: grid; align-content: start; gap: 1.6rem;
}

/* la galerie : une case par photo, on glisse au pouce, les flèches pour la souris */
.ft-galerie { margin: 0 calc(-1 * var(--marge)); }
.ft-photos {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; background: #fff;
}
.ft-photos::-webkit-scrollbar { display: none; }
.ft-photo {
  flex: 0 0 100%; aspect-ratio: 4 / 3; scroll-snap-align: start;
  background-color: var(--givre); background-repeat: no-repeat;
}
.ft-photo.est-produit { background-color: #fff; }
.ft-photo img { width: 100%; height: 100%; object-fit: contain; }
.ft-galerie-pied {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem var(--marge) 0;
}
.ft-pos { font-size: .9375rem; color: var(--encre-2); font-variant-numeric: tabular-nums; }

.ft-desc { margin: 0; max-width: 62ch; font-size: 1.0625rem; line-height: 1.6; }

/* chaque groupe de caractéristiques : un titre, puis libellé à gauche, valeur à droite */
.ft-bloc h3 { font-family: var(--f-titre); font-size: 1.3rem; line-height: 1.15; letter-spacing: -.01em; padding-bottom: .55rem; border-bottom: 1.5px solid var(--encre); }
.ft-lignes { margin: 0; }
.ft-lignes div { display: flex; align-items: baseline; justify-content: space-between; gap: 1.25rem; padding: .62rem 0; border-bottom: 1px solid var(--trait-doux); }
.ft-lignes dt { font-size: .9375rem; color: var(--encre-2); }
.ft-lignes dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }

.ft-habillages ul { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .45rem; }
.ft-aide { margin: .6rem 0 0; font-size: .9375rem; color: var(--encre-2); }
.ft-hab {
  width: 100%; display: grid; gap: .2rem; text-align: left; padding: .75rem .9rem; min-height: 48px;
  border: 1px solid var(--trait-doux); border-radius: 6px; background: rgba(255, 255, 255, .7); color: var(--encre);
  font: inherit; cursor: pointer; touch-action: manipulation;
  transition: border-color 200ms ease, transform 160ms var(--ease-out);
}
div.ft-hab { cursor: default; }
button.ft-hab:active { transform: scale(.985); }
@media (hover: hover) and (pointer: fine) { button.ft-hab:hover { border-color: var(--encre-2); } }
.ft-hab-nom { font-weight: 600; }
.ft-hab-detail { font-size: .875rem; color: var(--encre-2); line-height: 1.45; }

.ft-source { margin: 0; font-size: .875rem; color: var(--encre-2); }

.ft-pied {
  flex: none; padding: .75rem var(--marge) calc(.75rem + env(safe-area-inset-bottom));
  background: var(--neige); border-top: 1px solid var(--trait-doux);
}
.ft-pied .btn { width: 100%; }

/* le bouton du plateau qui l'ouvre */
.lien-fiche {
  justify-self: center; display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 .5rem;
  border: 0; background: transparent; color: var(--encre); cursor: pointer; touch-action: manipulation;
  font: 600 .9375rem var(--f-texte); text-decoration: underline; text-decoration-color: var(--trait); text-underline-offset: .25em;
}
.lien-fiche .ic { width: 1rem; height: 1rem; transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .lien-fiche:hover { text-decoration-color: currentColor; } .lien-fiche:hover .ic { transform: translateX(3px); } }

@media (prefers-reduced-motion: no-preference) {
  .fiche-tech[open] .ft-feuille { animation: ft-entre 300ms var(--ease-out); }
  .fiche-tech[open]::backdrop { animation: voile-entre 220ms ease-out; }
  .fiche-tech.ferme .ft-feuille { animation: ft-sort 190ms ease-in forwards; }
  .fiche-tech.ferme::backdrop { animation: voile-sort 190ms ease-in forwards; }
  @keyframes ft-entre { from { transform: translateX(100%); } }
  @keyframes ft-sort { to { transform: translateX(100%); } }
  @keyframes voile-entre { from { opacity: 0; } }
  @keyframes voile-sort { to { opacity: 0; } }
}

@media (max-width: 639px) {
  .fiche-tech { width: 100vw; }
  .ft-feuille { box-shadow: none; }
  @media (prefers-reduced-motion: no-preference) {
    .fiche-tech[open] .ft-feuille { animation: ft-monte 340ms cubic-bezier(.32, .72, 0, 1); }
    .fiche-tech.ferme .ft-feuille { animation: ft-descend 200ms ease-in forwards; }
    @keyframes ft-monte { from { transform: translateY(100%); } }
    @keyframes ft-descend { to { transform: translateY(100%); } }
  }
}
