:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5c6878;
  --border: #e1e5eb;
  --accent: #0e7c66;
  --accent-ink: #ffffff;
  --accent-soft: #e3f3ef;
  --radius: 10px;
  --amazon: #b45309;
  --ali: #c2410c;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; margin-top: 2rem; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main { padding: 2rem 0 4rem; min-height: 60vh; }
.small { font-size: .85rem; color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 65ch; }

/* En-tête */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: .75rem; padding-bottom: .75rem; }
.brand { display: flex; flex-direction: column; text-decoration: none; }
.brand img { height: 31px; width: auto; }
.tagline { font-size: .8rem; color: var(--muted); }
nav { display: flex; gap: .25rem; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--text); padding: .45rem .75rem; border-radius: 6px; font-weight: 500; }
nav a:hover { background: var(--bg); }
nav a.active { background: var(--accent-soft); color: var(--accent); }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 1.5rem 0; color: var(--muted); }
.footer-inner p { margin: .25rem 0; }

/* Boutons */
.btn { display: inline-block; padding: .65rem 1.1rem; border-radius: 8px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-size: 1rem; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn[aria-disabled='true'] { opacity: .5; pointer-events: none; }

/* Cartes de kits */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.card img { aspect-ratio: 16/10; object-fit: contain; background: #fff; padding: .5rem; }
.card-body { padding: 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.1rem; }
.card-body p { margin: 0; color: var(--muted); font-size: .95rem; }
.card-foot { margin-top: auto; padding-top: .5rem; display: flex; justify-content: space-between; align-items: center; }
.price { font-weight: 700; font-size: 1.1rem; }

.badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.badge { font-size: .75rem; padding: .15rem .5rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.badge.niv-Facile { background: #e7f6ec; color: #17673a; border-color: #bfe6cc; }
.badge.niv-Intermédiaire { background: #fff4e0; color: #8a5300; border-color: #f3d8a8; }
.badge.niv-Difficile { background: #fde8e8; color: #9b1c1c; border-color: #f5c2c2; }

/* Accueil */
.hero { display: grid; gap: 2rem; grid-template-columns: 1.1fr 1fr; align-items: center; margin-bottom: 3rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.pillars { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 2.5rem 0; }
.pillar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.pillar h3 { margin: 0 0 .35rem; }
.pillar p { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }

/* Fiche kit */
.kit-top { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; align-items: start; }
.kit-top img { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.buybox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-top: 1.25rem; }
.buybox .price { font-size: 1.6rem; }
.buy-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0 .5rem; }
@media (max-width: 760px) { .kit-top { grid-template-columns: 1fr; } }

.cols { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.panel h2 { margin-top: 0; font-size: 1.15rem; }
.panel ul { margin: 0; padding-left: 1.2rem; }

/* Liste de matériel (fiches kits + page Matériel) */
.items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.item { display: flex; gap: 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.panel .item { padding: .6rem 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.panel .item:last-child { border-bottom: 0; }
.item-main { flex: 1 1 280px; min-width: 0; }
.item-name { font-weight: 600; }
.item-qte { color: var(--accent); font-weight: 700; margin-right: .35rem; }
.item-desc { color: var(--muted); font-size: .9rem; }
.item-links { display: flex; gap: .4rem; flex-wrap: wrap; }
.shop { font-size: .82rem; font-weight: 600; padding: .3rem .65rem; border-radius: 6px; text-decoration: none; border: 1px solid var(--border); background: var(--surface); }
.shop.amazon { color: var(--amazon); }
.shop.aliexpress { color: var(--ali); }
.shop.none { color: var(--muted); font-weight: 400; }

/* Filtres */
.filters { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.filters input, .filters select { font: inherit; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.filters input { flex: 1 1 260px; }
.count { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }
.used-by { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; }

.note { background: var(--accent-soft); border-radius: 8px; padding: .9rem 1rem; color: #0b5345; }

/* Guides */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2rem; }
.guide-list { list-style: none; padding: 0; display: grid; gap: .75rem; }
.guide-list a { display: block; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: inherit; }
.guide-list a:hover { border-color: var(--accent); }
.guide-list strong { display: block; color: var(--text); }
.guide-list span { color: var(--muted); font-size: .95rem; }

/* Recherche de la page Matériel */
.item[hidden] { display: none; }

/* Installation du micrologiciel */
.firmware { margin-top: 1.5rem; }
.variante { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .75rem 0; }
.variante select { font: inherit; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }

/* Tableaux des guides */
.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0; background: var(--surface); }
.prose th, .prose td { border: 1px solid var(--border); padding: .5rem .75rem; text-align: left; }
.prose th { background: var(--bg); }
.page-vide { padding: 4rem 0; text-align: center; }

/* Images des guides */
.prose img { display: block; max-width: 100%; height: auto; margin: 1rem 0; border-radius: 8px; border: 1px solid var(--border); background: #fff; }

/* Miniatures : guides et matériel */
.guide-list a { display: flex; gap: 1rem; align-items: center; }
.guide-texte { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.vignette { flex: none; width: 112px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); }
.vignette.vide { display: block; }
.item { flex-wrap: nowrap; }
.item-main { flex: 1 1 auto; }
.vignette-materiel { flex: none; width: 56px; height: 56px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--border); }
.vignette-materiel.vide { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; border-color: transparent; }
@media (max-width: 560px) {
  .vignette { width: 72px; height: 56px; }
  .item { flex-wrap: wrap; }
  .vignette-materiel { width: 44px; height: 44px; }
}

/* Livraison sur la fiche d'un kit */
.livraison { width: 100%; border-collapse: collapse; margin: .75rem 0; font-size: .92rem; }
.livraison caption { text-align: left; font-weight: 600; margin-bottom: .3rem; }
.livraison th, .livraison td { padding: .3rem 0; border-bottom: 1px solid var(--border); text-align: left; font-weight: 400; }
.livraison td { text-align: right; font-weight: 600; }

/* Onglets « Montage et utilisation » d'un kit */
.onglets { padding: 0; overflow: hidden; }
.onglets-liste { display: none; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); padding: .5rem .75rem 0; background: var(--bg); }
.onglets.actif .onglets-liste { display: flex; }
.onglets-liste [role=tab] { font: inherit; font-weight: 600; white-space: nowrap; padding: .6rem 1rem; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; color: var(--muted); cursor: pointer; }
.onglets-liste [role=tab][aria-selected=true] { background: var(--surface); color: var(--accent); border-color: var(--border); margin-bottom: -1px; }
.onglet-contenu { padding: 1.25rem; max-width: none; }
.onglet-contenu > :first-child { margin-top: 0; }
.onglets.actif .titre-section { display: none; }
.onglet-contenu img { max-width: min(100%, 720px); }
