/* ==========================================================================
   FlashFit — styles communs à toutes les pages
   Système de design : couleurs, typographie, boutons, cartes, formulaires.
   Mise en page éditoriale : pleine largeur, sections franches, peu d'ornement.

   Ordre de chargement dans chaque page :
   commun.css → navbar.css → footer.css → style.css de la page
   ========================================================================== */

:root {
  /* Couleurs */
  --ink:          #0A1628;
  --ink-soft:     #1A1A1A;
  --body:         #475569;
  --muted:        #64748B;
  --faint:        #94A3B8;

  --blue:         #1D4ED8;
  --blue-bright:  #3B82F6;
  --blue-light:   #60A5FA;
  --blue-wash:    #EFF4FF;

  --surface:      #FFFFFF;
  --canvas:       #F5F5F5;
  --line:         #E5E7EB;
  --line-strong:  #D6DBE4;

  /* Rythme */
  --gutter:       clamp(16px, 4vw, 48px);
  --max:          1360px;
  --max-text:     760px;
  --section-y:    clamp(56px, 6vw, 96px);

  --ease:         cubic-bezier(.22, .61, .36, 1);
  --site-header-height: 98px;
}

@media (min-width: 768px) and (max-width: 1023px) { :root { --site-header-height: 92px; } }
@media (max-width: 767px) { :root { --site-header-height: 86px; } }
@media (max-width: 379px) { :root { --site-header-height: 72px; } }

/* Échelle globale sur ordinateur uniquement (le responsive reste inchangé) : 0.85 × 1.1 × 1.1 ≈ 1.03 */
@media (min-width: 1024px) { html { zoom: 1.03; } }

/* --- Socle --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { background: #fff; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  padding-top: var(--site-header-height);
  background: var(--surface);
  color: var(--body);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: 'Sora', sans-serif; }

img { max-width: 100%; height: auto; }

/* Un élément masqué (attribut hidden) le reste, même si sa classe lui donne
   un display (flex, grid…) */
[hidden] { display: none !important; }

/* Espace réservé sous l'en-tête fixe = bandeau + barre + 1px de bordure.
   Le !important l'emporte sur la hauteur mesurée par navbar.js.
   ⚠ Si vous changez --ff-topbar-h ou --ff-nav-h dans
   assets/navbar/navbar.css, ajustez aussi ces valeurs. */
@media (min-width: 1024px) {
  body { padding-top: 98px !important; margin-top: 0 !important; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  body { padding-top: 92px !important; margin-top: 0 !important; }
}
@media (max-width: 767px) {
  body { padding-top: 86px !important; margin-top: 0 !important; }
}
@media (max-width: 379px) {
  body { padding-top: 72px !important; }
}

#site-header {
  position: fixed; top: 0; left: 0;
  width: 100%; z-index: 9999;
  background: #fff;
}

/* --- Transitions entre pages ----------------------------------------------
   Transition native du navigateur (View Transitions) : l'ancienne page reste
   affichée jusqu'à ce que la nouvelle soit prête, puis fondu enchaîné. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 200ms; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* --- Structure ---------------------------------------------------------- */
.ff-wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.ff-wrap--text { max-width: calc(var(--max-text) + var(--gutter) * 2); }

.ff-section            { padding-block: var(--section-y); background: var(--surface); }
.ff-section--alt       { background: var(--canvas); }
.ff-section--tight     { padding-block: clamp(40px, 4.5vw, 64px); }
.ff-section--flush-top { padding-top: 0; }

/* --- Typographie -------------------------------------------------------- */
.ff-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.ff-h1 {
  font-family: 'Sora', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.17;
  letter-spacing: -.025em;
  color: var(--ink-soft);
  margin: 0;
}

.ff-h2 {
  font-family: 'Sora', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--ink-soft);
  margin: 0;
}

.ff-h3 {
  font-family: 'Sora', system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--ink-soft);
  margin: 0;
}

.ff-lede {
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 62ch;
  margin: 14px 0 0;
}

.ff-head         { margin-bottom: 40px; }
.ff-head--center { text-align: center; }
.ff-head--center .ff-lede { margin-inline: auto; }

/* --- Boutons ------------------------------------------------------------ */
.ff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--blue);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 30px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.ff-btn:hover { background: #1740AF; box-shadow: 0 10px 26px -8px rgba(29,78,216,.5); }
.ff-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.ff-btn--ghost { background: transparent; color: var(--ink-soft); border-color: var(--line-strong); }
.ff-btn--ghost:hover { background: var(--ink-soft); color: #fff; border-color: var(--ink-soft); box-shadow: none; }

.ff-btn--light { background: #fff; color: var(--ink); }
.ff-btn--light:hover { background: #fff; color: var(--blue); box-shadow: 0 10px 30px -10px rgba(0,0,0,.45); }

.ff-btn--block { width: 100%; }

/* Lien texte souligné, façon éditorial */
.ff-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1.5px solid var(--ink-soft);
  transition: color .18s var(--ease), border-color .18s var(--ease), gap .18s var(--ease);
}
.ff-link:hover { color: var(--blue); border-color: var(--blue); gap: 12px; }
.ff-link--light { color: #fff; border-color: rgba(255,255,255,.7); }
.ff-link--light:hover { color: #fff; border-color: #fff; }

:where(a, button):focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Lien d'évitement « Aller au contenu » : visible uniquement au clavier */
.ff-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: #fff;
  color: #0A1628;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}
.ff-skip:focus { left: 0; }

/* --- Bandeau image pleine largeur --------------------------------------- */
.ff-band {
  position: relative;
  min-height: clamp(300px, 34vw, 430px);
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--ink) center / cover no-repeat;
  isolation: isolate;
}
.ff-band::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(8,16,28,.52), rgba(8,16,28,.74));
}

/* Photo du bandeau d'appel à l'action, commune à plusieurs pages */
.ff-band--cta {
  background-image: url('https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?q=80&w=2400&auto=format&fit=crop');
}

.ff-band__inner { padding-block: clamp(52px, 6vw, 84px); max-width: 720px; }

.ff-band__kicker {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.78);
  margin: 0 0 16px;
}

.ff-band h1, .ff-band h2 {
  font-family: 'Sora', system-ui, sans-serif;
  font-size: clamp(23px, 2.9vw, 36px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -.022em;
  color: #fff;
  margin: 0 0 14px;
}

.ff-band p {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,.76);
  max-width: 54ch;
  margin: 0 auto 30px;
}
.ff-band p:last-child { margin-bottom: 0; }

.ff-band__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* --- En-tête de page (fond clair) --------------------------------------- */
.ff-pagehead {
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(40px, 5vw, 72px);
  text-align: center;
}
.ff-pagehead .ff-lede { margin-inline: auto; }

/* --- Fil d'Ariane -------------------------------------------------------- */
.ff-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted);
  margin-bottom: 18px;
}
.ff-crumbs a { color: var(--body); text-decoration: underline; text-underline-offset: 2px; }
.ff-crumbs a:hover { color: var(--blue); }
.ff-crumbs span::before { content: '/'; margin-right: 8px; color: var(--faint); }

/* --- Carte générique ----------------------------------------------------- */
.ff-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px 24px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.ff-card:hover { border-color: var(--line-strong); box-shadow: 0 14px 34px -20px rgba(10,22,40,.4); }

/* --- Carte produit ------------------------------------------------------- */
.ff-pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.ff-pcard:hover { border-color: var(--line-strong); box-shadow: 0 14px 34px -18px rgba(10,22,40,.4); transform: translateY(-3px); }

.ff-pcard__media {
  position: relative;
  aspect-ratio: 1;
  background: #FAFAFA;
  display: grid; place-items: center;
  overflow: hidden;
}
.ff-pcard__media img { width: 100%; height: 100%; object-fit: contain; }
.ff-pcard__flags {
  position: absolute; top: 8px; left: 8px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  z-index: 2;
}
.ff-pcard__flag {
  font-size: 9px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 3px;
  color: #fff; background: var(--blue);
}

.ff-pcard__body { padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.ff-pcard__cat  { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ff-pcard__name { font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.35; }
.ff-pcard__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; font-size: 13px; }
.ff-pcard__price .now { color: var(--ink-soft); font-weight: 600; }
.ff-pcard__price .was { color: var(--muted); text-decoration: line-through; font-size: 11.5px; }

/* 2e photo affichée au survol (option swap de ffCatalogue.card) */
.ff-pcard__alt {
  position: absolute; inset: 0;
  background: #FAFAFA;
  opacity: 0;
  transition: opacity .35s var(--ease);
}
@media (hover: hover) { .ff-pcard:hover .ff-pcard__alt { opacity: 1; } }

/* Bouton d'achat rapide sous la carte (ffCatalogue.buyButton) */
.ff-pcard__cta {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 42px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--ink-soft);
  border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.ff-pcard__cta:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.ff-pcard__cta.is-done { background: #15803D; border-color: #15803D; color: #fff; }

/* --- Pastille de filtre (boutique, accueil) ------------------------------ */
.ff-chip {
  display: inline-flex; align-items: center;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.ff-chip:hover { border-color: var(--ink-soft); }
.ff-chip.is-active,
.ff-chip[aria-pressed="true"] { background: var(--ink-soft); border-color: var(--ink-soft); color: #fff; }

/* --- Avis client (accueil, page Avis — ffCatalogue.reviewCard) ----------- */
.ff-review {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px 24px 22px;
}
.ff-review__stars { color: var(--blue-bright); font-size: 14px; letter-spacing: 2.5px; }
.ff-review__stars .off { color: var(--line-strong); }
.ff-review__title { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; color: var(--ink-soft); margin: 0; }
.ff-review blockquote { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--ink-soft); flex: 1; white-space: pre-line; }
.ff-review__by {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.ff-review cite { font-style: normal; }
.ff-review cite strong { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ff-review cite span { color: var(--muted); }
.ff-review__by a { color: var(--blue); text-underline-offset: 2px; }

/* --- Emplacement d'image (produit sans photo) ------------------------------
   Remplacé automatiquement dès qu'une image est renseignée dans l'admin.
   Le conteneur parent doit être en position: relative. */
.ff-ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: repeating-linear-gradient(135deg, var(--canvas) 0 12px, #EFEFEF 12px 24px);
  color: var(--muted);
  font-size: 12px; font-weight: 500;
}
.ff-ph svg {
  width: 30px; height: 30px;
  stroke: currentColor; fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* --- Squelette de chargement --------------------------------------------- */
.ff-sk {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.ff-sk__img  { aspect-ratio: 1; background: var(--line); animation: ff-sk 1.2s infinite; }
.ff-sk__body { padding: 12px; display: grid; gap: 8px; }
.ff-sk__line { height: 9px; border-radius: 5px; background: var(--line); animation: ff-sk 1.2s infinite; }
.ff-sk__line--s { width: 55%; }
@keyframes ff-sk { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* --- Grille de produits -------------------------------------------------- */
.ff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 768px)  { .ff-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1200px) { .ff-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.ff-grid__msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 14px;
}

/* --- Contenu provisoire « À COMPLÉTER » ----------------------------------
   Repère visuel pour tout texte encore à rédiger : à supprimer une fois
   le contenu définitif en place. */
.ff-todo {
  background: #FEF9C3;
  border: 1px dashed #A16207;
  border-radius: 6px;
  padding: 10px 14px;
  color: #713F12;
  font-size: 13px;
}
span.ff-todo { display: inline-block; padding: 1px 8px; font-size: inherit; }

/* Texte réservé aux lecteurs d'écran */
.ff-sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Champs de formulaire ------------------------------------------------ */
.ff-field { display: flex; flex-direction: column; gap: 7px; }

.ff-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .01em;
}

.ff-input, .ff-select, .ff-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.ff-input::placeholder, .ff-textarea::placeholder { color: var(--faint); }
.ff-input:focus, .ff-select:focus, .ff-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
.ff-textarea { resize: vertical; min-height: 130px; line-height: 1.6; }

.ff-select {
  appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 14px center;
}

/* --- Accordéon ----------------------------------------------------------- */
.ff-acc { border-top: 1px solid var(--line); }
.ff-acc__item { border-bottom: 1px solid var(--line); }

.ff-acc__q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: none; border: 0;
  padding: 20px 4px;
  font: inherit;
  font-size: 14.5px; font-weight: 500;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: color .18s var(--ease);
}
.ff-acc__q:hover { color: var(--blue); }

.ff-acc__q svg {
  flex-shrink: 0;
  width: 17px; height: 17px;
  stroke: var(--faint); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .3s var(--ease), stroke .18s var(--ease);
}

.ff-acc__item[data-open] .ff-acc__q { color: var(--blue); }
.ff-acc__item[data-open] .ff-acc__q svg { transform: rotate(180deg); stroke: var(--blue); }

.ff-acc__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .32s var(--ease);
}
.ff-acc__item[data-open] .ff-acc__a { grid-template-rows: 1fr; }
.ff-acc__a > div { overflow: hidden; }
.ff-acc__a p {
  margin: 0;
  padding: 0 44px 24px 4px;
  max-width: 68ch;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--body);
}

/* --- Corps de texte long (CGV, articles, mentions) ----------------------- */
.ff-prose { font-size: 14.5px; line-height: 1.8; color: var(--body); }
.ff-prose h2 {
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 20px; font-weight: 700;
  letter-spacing: -.015em;
  color: var(--ink-soft);
  margin: 44px 0 14px;
}
.ff-prose h3 {
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--ink-soft);
  margin: 30px 0 10px;
}
.ff-prose h2:first-child, .ff-prose h3:first-child { margin-top: 0; }
.ff-prose p  { margin: 0 0 16px; }
.ff-prose ul, .ff-prose ol { margin: 0 0 18px; padding-left: 22px; }
.ff-prose li { margin-bottom: 8px; }
.ff-prose a  { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.ff-prose strong { color: var(--ink-soft); font-weight: 600; }

/* --- Note / encadré ------------------------------------------------------ */
.ff-note {
  background: var(--blue-wash);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--body);
}

/* --- Apparition au scroll ------------------------------------------------
   Uniquement si JavaScript est actif (classe .js posée par commun.js) :
   sans JavaScript, le contenu reste visible. */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .is-in  { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --- Impression ---------------------------------------------------------- */
@media print {
  .ff-topbar { display: none; }
  #flashfit-nav { display: none; }
  footer { display: none; }
}
