/* ============================================================
   Fabrique - Design System (style.css)
   Direction : "Énergie claire" - light vif éditorial.
   Fond clair, typo display, accents couleur par univers,
   dégradés mesh, ombres colorées, micro-interactions.
   ============================================================ */

:root {
  /* Marque */

  /* Accents catégories : SOURCE UNIQUE des couleurs (hex + rgb).
     Une catégorie = un token, choisi dans data/products.js. Changer un hex
     ici se répercute partout (cartes, nav, ombres, badges). Hues volontairement
     distincts : vert / bleu / violet / orange / cuivre / ardoise. */

  /* accent courant (overridé par [data-accent]) */

  /* Neutres */
  --ink: #11201B;            /* titres */
  --text: #38453F;           /* corps */
  --muted: #687a72;          /* secondaire */
  --line: #E2EAE5;           /* bordures */
  --bg: #FAFCF9;             /* fond page */
  --bg-alt: #EFF5F0;         /* fond section alternée */
  --surface: #FFFFFF;        /* cartes */

  /* Sémantique */
  --amazon: #FF9E0F;
  --amazon-dark: #F07E05;
  --success: #1FA368;
  --warning: #C98A2B;
  --error: #C9503A;

  /* Dégradés signature */
  --grad-amazon: linear-gradient(180deg, #FFB23F 0%, #FF9E0F 55%, #F07E05 100%);

  /* Mesures */
  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 26px;
  --shadow-sm: 0 1px 2px rgba(17, 32, 27, .05), 0 3px 10px rgba(17, 32, 27, .045);
  --shadow: 0 8px 28px rgba(17, 32, 27, .09);
  --shadow-lg: 0 24px 60px rgba(17, 32, 27, .14);
  --shadow-acc: 0 18px 40px rgba(var(--acc-rgb), .18);
  --container: 1160px;
  --space: 16px;

  /* ───────────────────────────────────────────────────────────────
     ÉCHELLES FLUIDES (source unique - réutilisable sur tous les sites)
     clamp(min mobile, pente en vw, max desktop).
     Les MAX = valeurs desktop actuelles -> le desktop ne bouge pas,
     tout rétrécit proprement vers le mobile sans media-query.
     ─────────────────────────────────────────────────────────────── */

  /* Typo */
  --fs-2xs:  clamp(0.70rem, 0.66rem + 0.18vw, 0.78rem);
  --fs-xs:   clamp(0.78rem, 0.73rem + 0.22vw, 0.88rem);
  --fs-sm:   clamp(0.86rem, 0.80rem + 0.25vw, 0.95rem);
  --fs-base: clamp(0.95rem, 0.90rem + 0.25vw, 1.0625rem);
  --fs-md:   clamp(1.02rem, 0.95rem + 0.32vw, 1.22rem);
  --fs-lg:   clamp(1.10rem, 0.98rem + 0.55vw, 1.45rem);
  --fs-xl:   clamp(1.30rem, 1.05rem + 1.10vw, 1.90rem);
  --fs-2xl:  clamp(1.55rem, 1.15rem + 1.90vw, 2.40rem);
  --fs-3xl:  clamp(1.95rem, 1.30rem + 3.10vw, 3.60rem);

  /* Espacement */
  --space-2xs: clamp(0.25rem, 0.23rem + 0.10vw, 0.35rem);
  --space-xs:  clamp(0.40rem, 0.35rem + 0.20vw, 0.55rem);
  --space-sm:  clamp(0.60rem, 0.50rem + 0.40vw, 0.85rem);
  --space-md:  clamp(0.85rem, 0.70rem + 0.60vw, 1.15rem);
  --space-lg:  clamp(1.10rem, 0.85rem + 1.00vw, 1.60rem);
  --space-xl:  clamp(1.50rem, 1.10rem + 1.60vw, 2.40rem);
  --space-2xl: clamp(2.00rem, 1.45rem + 2.20vw, 3.25rem);
  --space-3xl: clamp(2.40rem, 1.55rem + 3.40vw, 4.25rem);  /* ~ padding section 68px */

}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: var(--fs-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; font-family: var(--font-display); }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); margin-bottom: .5em; }
h3 { font-size: var(--fs-md); font-weight: 600; }
p { margin-bottom: 1em; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

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

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 22px; }

/* ---- Utilitaires de mise en page (réutilisables - remplacent le style="" en dur) ---- */
.u-center { text-align: center; }
.u-measure { max-width: 820px; margin-inline: auto; }
.u-lead { color: var(--muted); max-width: 46ch; margin: 0 auto 26px; }
.u-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.u-cta-row--center { justify-content: center; }
.u-mt-sm { margin-top: 10px; }

.section { padding: var(--space-3xl) 0; }
.section--alt { background: var(--bg-alt); }
.section--tight { padding: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem) 0; }

/* Texte en dégradé (mots accent) */
.grad-text, .accent {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--brand);
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px;
  background: var(--grad-mint);
}
.section-head .eyebrow::before { display: none; }

.section-head { text-align: center; max-width: 660px; margin: 0 auto clamp(1.4rem, 0.9rem + 2.1vw, 2.625rem); }
.section-head .eyebrow { margin-bottom: var(--space-sm); }
.section-head p { color: var(--muted); margin-top: var(--space-2xs); font-size: var(--fs-md); }
.section-head__cta { margin-top: var(--space-md); }

.note {
  font-size: .9rem;
  color: var(--muted);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

/* ---------------- Boutons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: .95rem;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, filter .16s ease;
  text-align: center;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--lg { padding: 16px 30px; font-size: 1.02rem; }
.btn--sm { padding: 9px 16px; font-size: .85rem; }
.btn--xs { padding: 6px 12px; font-size: .78rem; }
.btn--block { display: flex; width: 100%; }

.btn--primary { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 18px rgba(21, 127, 102, .26); }
.btn--primary:hover { color: #fff; box-shadow: 0 12px 28px rgba(21, 127, 102, .34); filter: brightness(1.05); }

.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); box-shadow: var(--shadow-sm); }

.btn--amazon {
  background: var(--grad-amazon); color: #1a1407;
  box-shadow: 0 6px 18px rgba(240, 126, 5, .28);
}
.btn--amazon::after {
  content: "\2197"; font-size: .9em; font-weight: 800; opacity: .8;
  transition: transform .16s ease;
}
.btn--amazon:hover { color: #1a1407; box-shadow: 0 12px 30px rgba(240, 126, 5, .4); filter: brightness(1.04); }
.btn--amazon:hover::after { transform: translate(2px, -2px); }
.btn--block.btn--amazon { justify-content: center; }

.aff-note { display: block; font-size: .72rem; color: var(--muted); margin-top: 6px; }

/* ---------------- Header ---------------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 252, 249, .82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; height: 68px; gap: 20px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.36rem; color: var(--ink); letter-spacing: -.04em; font-family: var(--font-display); flex: none; }
.logo:hover { color: var(--ink); }
.logo__dot { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
/* Nav = colonne centrale extensible : ZONE 1 (catégories, à gauche) | ZONE 2 (autres, à droite). */
.nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav__link { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: .9rem; white-space: nowrap; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.nav__link:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nav__link--active { color: var(--brand-dark); background: var(--brand-soft); }
/* Le séparateur pousse la 2e zone (Classements/Outils/Le mag) vers la droite -> 2 zones nettes. */
.nav__sep { width: 1px; height: 22px; background: var(--line); margin: 0 14px 0 auto; flex: none; }

/* Pastille de couleur par rayon (reprend l'accent de chaque catégorie) */
.nav__link[data-accent="forest"] { --nav-dot: var(--acc-forest); --nav-dot-rgb: var(--acc-forest-rgb); }
.nav__link[data-accent="azure"]  { --nav-dot: var(--acc-azure);  --nav-dot-rgb: var(--acc-azure-rgb); }
.nav__link[data-accent="violet"] { --nav-dot: var(--acc-violet); --nav-dot-rgb: var(--acc-violet-rgb); }
.nav__link[data-accent="amber"]  { --nav-dot: var(--acc-amber);  --nav-dot-rgb: var(--acc-amber-rgb); }
.nav__link[data-accent="copper"] { --nav-dot: var(--acc-copper); --nav-dot-rgb: var(--acc-copper-rgb); }
.nav__link[data-accent="slate"]  { --nav-dot: var(--acc-slate);  --nav-dot-rgb: var(--acc-slate-rgb); }
.nav__link--rayon::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--nav-dot); flex: none; transition: box-shadow .15s ease, transform .15s ease; }
.nav__link--rayon:hover { color: var(--nav-dot); background: rgba(var(--nav-dot-rgb), .1); }
.nav__link--rayon:hover::before { box-shadow: 0 0 0 4px rgba(var(--nav-dot-rgb), .2); transform: scale(1.05); }
.nav__link--rayon.nav__link--active { color: var(--nav-dot); background: rgba(var(--nav-dot-rgb), .12); }
.nav__link--rayon.nav__link--active::before { box-shadow: 0 0 0 4px rgba(var(--nav-dot-rgb), .2); }

/* Liens utilitaires : "Guides d'achat" appuyé */
.nav__link--guide { color: var(--brand-dark); font-weight: 700; }
.nav__link--guide:hover { background: var(--brand-soft); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; font-size: 1.3rem; cursor: pointer; color: var(--ink); }
/* Scrim du menu mobile (créé par main.js) : assombrit la page -> le menu ressort. */
.nav-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(11, 28, 22, .5);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s ease; }
.nav-scrim.is-on { opacity: 1; visibility: visible; }
@media (min-width: 1101px) { .nav-scrim { display: none; } }
body.menu-open { overflow: hidden; }   /* on fige le défilement quand le menu est ouvert */

/* ---------------- Recherche site ---------------- */
.header__actions { display: flex; align-items: center; gap: 8px; }
.search-btn { display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--line); border-radius: 999px; width: 42px; height: 42px; cursor: pointer; color: var(--ink); transition: background .15s ease, border-color .15s ease, color .15s ease; }
.search-btn:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); }
.search-btn svg { width: 19px; height: 19px; }

.search-panel { border-top: 1px solid var(--line); background: rgba(250, 252, 249, .96); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); }
.search-panel[hidden] { display: none; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.search-box__ico { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-input { flex: 1; min-width: 0; border: none; background: none; font: inherit; font-size: 1.1rem; color: var(--ink); padding: 6px 0; }
.search-input::placeholder { color: var(--muted); }
.search-input:focus { outline: none; }
.search-close { background: none; border: none; font-size: 1.7rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 6px; flex: none; }
.search-close:hover { color: var(--ink); }
.search-results { max-height: min(62vh, 470px); overflow-y: auto; padding: 8px 0 16px; }
.search-result { display: flex; flex-direction: column; gap: 2px; padding: 11px 13px; border-radius: var(--radius-sm); color: var(--ink); }
.search-result:hover, .search-result.is-active { background: var(--brand-soft); color: var(--brand-dark); }
.search-result__top { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; }
.search-result__title { font-weight: 700; font-size: 1rem; }
.search-result__type { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); flex: none; white-space: nowrap; }
.search-result__desc { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result mark { background: transparent; color: var(--brand); font-weight: 800; }
.search-empty { padding: 18px 13px; color: var(--muted); font-size: .95rem; }
.search-hint { padding: 6px 13px 2px; color: var(--muted); font-size: .8rem; }
.search-hint kbd { font-family: var(--font); background: var(--bg-alt); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .82em; }

/* ---------------- Breadcrumbs ---------------- */
.breadcrumbs { font-size: .85rem; color: var(--muted); padding: 16px 0 0; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs__sep { margin: 0 8px; opacity: .5; }

/* ---------------- Footer ---------------- */
.footer { background: var(--ink); color: #c5d2cb; margin-top: 72px; padding: 56px 0 28px; position: relative; }
.footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad-mint); }
.footer a { color: #c5d2cb; transition: color .15s ease; }
.footer a:hover { color: #fff; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 34px; }
.footer__brand { color: #fff; font-weight: 700; font-size: 1.32rem; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; font-family: var(--font-display); }
.footer__desc { font-size: .9rem; color: #93a69c; max-width: 30ch; }
.footer__brand-mark { color: var(--brand-mint); }
.footer__link-strong { color: var(--brand-mint); font-weight: 700; }
.footer__heading { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.footer__links { list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: .9rem; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 36px; padding-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.footer__copy { font-size: .85rem; color: #93a69c; }
.footer__affiliate { font-size: .78rem; color: #80938a; max-width: 75ch; line-height: 1.55; }

/* ---------------- Progress bar ---------------- */
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--grad-mint); z-index: 100; transition: width .1s linear; }

/* ---------------- Tableaux ---------------- */
.table-wrap { overflow-x: auto; margin-bottom: 1.4em; }
.styled-table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.styled-table th, .styled-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.styled-table th[scope="row"] { font-weight: 700; color: var(--ink); width: 42%; background: var(--bg-alt); }
.styled-table tr:last-child th, .styled-table tr:last-child td { border-bottom: none; }

/* ---------------- Reveal au scroll ---------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.16,.8,.3,1), transform .7s cubic-bezier(.16,.8,.3,1); will-change: opacity, transform; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .btn:active { transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- Responsive ---------------- */
/* Resserrage de la barre sur écrans intermédiaires avant la bascule burger */
@media (max-width: 1200px) {
  .nav__link { padding: 7px 8px; font-size: .84rem; gap: 6px; }
  .nav__link--rayon::before { width: 7px; height: 7px; }
  .nav__sep { margin: 0 10px 0 auto; }
}
/* Bascule en menu burger : la barre à 9 entrées tient mal sous ~1100px */
@media (max-width: 1100px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  /* ---- MENU MOBILE : panneau qui "tombe" du header (coins arrondis, ombre, scrim) ---- */
  .nav--open {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    position: fixed; top: 67px; left: 0; right: 0; z-index: 70;
    padding: 14px 14px 18px; background: var(--surface);
    border: 1px solid var(--line); border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 26px 50px -10px rgba(11, 28, 22, .42);
    max-height: calc(100dvh - 67px); overflow-y: auto;
    animation: navDrop .2s ease;
  }
  .nav--open .nav__link { font-size: .92rem; border-radius: var(--radius-sm); }
  /* Catégories : tuiles 2 colonnes (carte blanche + point de couleur) : items clairement cliquables. */
  .nav--open .nav__link--rayon {
    padding: 13px 13px; gap: 10px; color: var(--ink); font-weight: 600;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  }
  .nav--open .nav__link--rayon::before { width: 9px; height: 9px; box-shadow: 0 0 0 4px rgba(var(--nav-dot-rgb), .14); }
  .nav--open .nav__link--rayon:active { border-color: var(--nav-dot); background: rgba(var(--nav-dot-rgb), .07); }
  /* Titre de groupe "À explorer" en remplacement du fin séparateur. */
  .nav--open .nav__sep {
    grid-column: 1 / -1; display: flex; align-items: center; width: auto; height: auto; background: none;
    margin: 12px 2px 1px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
  }
  .nav--open .nav__sep::after { content: "À explorer"; }
  /* Liens utilitaires : rangées pleine largeur avec chevron (affordance "on va quelque part"). */
  .nav--open .nav__link:not(.nav__link--rayon) {
    grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
    padding: 14px 15px; font-weight: 700; color: var(--ink);
    background: var(--bg-alt); border-radius: var(--radius-sm);
  }
  .nav--open .nav__link:not(.nav__link--rayon)::after { content: "\203A"; color: var(--muted); font-size: 1.35rem; line-height: 1; }
  .nav--open .nav__link:not(.nav__link--rayon):active { color: var(--brand-dark); }
  .nav--open .nav__link--guide { background: var(--brand-soft); color: var(--brand-dark); }
  .nav--open .nav__link--guide::after { color: var(--brand); }
}
@keyframes navDrop { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 26px; }
}
/* Mobile : en-têtes de section compacts (titre sur 1 ligne, sous-titre discret)
   pour que le contenu (coups de cœur…) remonte et soit visible. */
@media (max-width: 600px) {
  .section-head { margin-bottom: var(--space-md); }
  .section-head h2 { font-size: clamp(1.05rem, 0.85rem + 0.9vw, 1.45rem); }
  .section-head p { font-size: var(--fs-xs); margin-top: var(--space-2xs); }
  .section-head .eyebrow { margin-bottom: var(--space-2xs); }
  /* Mobile uniquement : en-tête "coups de cœur" (date + titre + sous-titre)
     aligné à gauche. Le desktop reste centré. */
  .section-head--left { text-align: left; max-width: none; margin-left: 0; margin-right: 0; }
  .section-head--left .eyebrow { margin-left: 0; }
  /* Mobile : sections resserrées (moins de vide entre coups de cœur, catégories…). */
  .section { padding: var(--space-xl) 0; }
  .hero + .section { padding-top: var(--space-md); }
}
/* Mobile : footer ultra-compact, listes de liens sur 2 colonnes. */
@media (max-width: 600px) {
  .footer { margin-top: 40px; padding: 26px 0 18px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 16px 18px; }
  /* Bloc marque sur toute la largeur, description longue masquée pour gagner de la place. */
  .footer__grid > div:first-child { grid-column: 1 / -1; }
  .footer__brand { font-size: 1.1rem; margin-bottom: 6px; }
  .footer__grid > div:first-child .footer__desc:first-of-type { display: none; }
  .footer__desc { font-size: .82rem; margin-top: 2px; }
  .footer__heading { margin-bottom: 7px; font-size: .72rem; }
  .footer__links { gap: 6px; font-size: .84rem; }
  .footer__bottom { margin-top: 20px; padding-top: 16px; gap: 8px; }
  .footer__affiliate { font-size: .72rem; line-height: 1.45; }
}

