* { box-sizing: border-box; margin: 0; padding: 0; }
/* Charte COMC (FICHE_FOI_CHARTE_COMC.md) : Jost = titres (facon Futura),
   Zilla Slab = accents/baseline (facon American Typewriter). */
body { font-family: "Jost", -apple-system, "Segoe UI", Roboto, sans-serif; background: #f5f6f8; color: #1f2937; line-height: 1.5; }
a { color: var(--c-primaire); }
main { max-width: 1200px; margin: 28px auto; padding: 0 28px; }
h1, h2, h3, h4 { font-family: "Jost", -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 600; }
h2 { margin-bottom: 16px; font-size: 24px; }
.baseline, .footer-col p { font-family: "Zilla Slab", Georgia, serif; }

/* ============================== HEADER ============================== */
.site-header { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 28px; display: flex; align-items: center; gap: 22px; height: 64px; position: sticky; top: 0; z-index: 50; }
.comc-logo { text-decoration: none; display: flex; align-items: center; }
.comc-logo .comc-logo-word { font-size: 22px; font-weight: 800; letter-spacing: 1px; color: var(--c-primaire); }
.comc-logo img { height: 36px; }

.rayons { display: flex; align-items: stretch; gap: 2px; height: 100%; }
.rayon { position: relative; display: flex; align-items: center; }
.rayon-label { padding: 0 14px; height: 100%; display: flex; align-items: center; font-size: 14px; font-weight: 600; color: #374151; cursor: default; border-bottom: 2px solid transparent; }
.rayon:hover .rayon-label { color: var(--c-accent); border-bottom-color: var(--c-accent); }
.rayon-menu { position: absolute; top: 100%; left: 0; min-width: 240px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 8px; display: none; flex-direction: column; z-index: 60; }
.rayon:hover .rayon-menu { display: flex; }
.rayon-menu a { padding: 7px 10px; font-size: 13px; color: #374151; border-radius: 6px; text-decoration: none; white-space: nowrap; }
.rayon-menu a:hover { background: #f3f4f6; }
.rayon-menu .count { color: #9ca3af; font-size: 12px; }

.header-search { margin-left: auto; display: flex; }
.header-search input { padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px 0 0 6px; min-width: 220px; font-size: 14px; }
.header-search button { border: 1px solid #d1d5db; border-left: none; background: #f9fafb; border-radius: 0 6px 6px 0; padding: 0 12px; cursor: pointer; font-size: 15px; }

.header-actions { display: flex; align-items: center; gap: 14px; }
.cart-link { position: relative; text-decoration: none; display: inline-flex; }
.cart-ico { font-size: 20px; }
.cart-badge { position: absolute; top: -8px; right: -10px; background: var(--c-accent); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; padding: 0 4px; }
.header-link { color: #374151; text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.header-link:hover { color: var(--c-accent); }

/* ============================== BOUTONS ============================== */
.btn { display: inline-block; padding: 9px 18px; background: var(--c-primaire); color: #fff; border: none; border-radius: 6px; cursor: pointer; text-decoration: none; font-size: 14px; }
.btn:hover { filter: brightness(0.9); }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-accent { background: var(--c-accent); color: #fff; }
.btn-accent:hover { filter: brightness(0.92); }

/* ====================== LAYOUT CATALOGUE (sidebar + grille) ====================== */
.catalogue-layout { display: block; }

.filtres { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; position: sticky; top: 88px; }
.filtres-titre { font-size: 16px; margin-bottom: 14px; }
.filtre-bloc { margin-bottom: 16px; border-top: 1px solid #f0f0f0; padding-top: 14px; }
.filtre-bloc:first-of-type { border-top: none; padding-top: 0; }
.filtre-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; font-weight: 700; margin-bottom: 9px; }
.filtre-search { display: flex; gap: 6px; }
.filtre-search input { flex: 1; min-width: 0; padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }
.reset-link { display: inline-block; margin-top: 9px; font-size: 12px; color: var(--c-accent); text-decoration: none; }
.reset-link:hover { text-decoration: underline; }


.filtre-rayons, .filtre-rayons ul { list-style: none; }
.filtre-rayons > li > a { display: block; font-size: 13px; font-weight: 600; color: #374151; text-decoration: none; padding: 3px 0; }
.rayon-groupe { margin-top: 8px; }
.rayon-nom { display: block; font-size: 13px; font-weight: 700; color: #111827; margin: 10px 0 4px; }
.filtre-rayons ul ul li a { display: block; font-size: 13px; padding: 3px 0 3px 8px; color: #4b5563; text-decoration: none; }
.filtre-rayons a:hover { color: var(--c-accent); }
.filtre-rayons a.active { color: var(--c-accent); font-weight: 700; }
.filtre-rayons .count { color: #9ca3af; font-size: 11px; }

.catalogue-main { min-width: 0; }
.catalogue-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.catalogue-head h2 { font-size: 26px; letter-spacing: -0.01em; }
.total-produits { color: #6b7280; font-size: 14px; font-weight: 500; }
.filtre-actif { font-size: 13px; color: #6b7280; margin-bottom: 16px; }
.filtre-actif a { color: var(--c-accent); }

/* ============================== GRILLE PRODUITS ============================== */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { background: #fff; border: 1px solid #eaedf1; border-radius: 14px; padding: 14px 14px 16px; box-shadow: 0 1px 2px rgba(16,24,40,0.04); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(16,24,40,0.10); border-color: #dbe3ec; }
.card a { color: inherit; text-decoration: none; display: block; }
.thumb { width: 100%; height: 230px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg,#fbfbfc,#f4f5f7); border-radius: 10px; overflow: hidden; }
.thumb img { max-width: 88%; max-height: 88%; object-fit: contain; mix-blend-mode: multiply; }
.thumb-vide { background: repeating-linear-gradient(45deg, #f7f7f9, #f7f7f9 10px, #f1f1f4 10px, #f1f1f4 20px); }
.thumb-vide::after { content: "Visuel à venir"; color: #9ca3af; font-size: 13px; }
.card-tag { display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; font-weight: 700; margin: 14px 0 6px; background: #f1f3f6; padding: 3px 9px; border-radius: 20px; }
.card-title { font-size: 15px; font-weight: 600; margin: 2px 0 4px; line-height: 1.35; color: #1f2937; }
.card-meta { font-size: 12px; color: #8a93a0; }
.card-prix { margin-top: 8px; }
.prix-login { font-size: 12px; color: #9ca3af; font-style: italic; }
.prix-link { font-size: 13px; color: var(--c-accent); font-weight: 600; }
.vide { grid-column: 1 / -1; padding: 40px; text-align: center; color: #6b7280; }

/* ============================== PAGINATION ============================== */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 32px 0 8px; }
.pg { padding: 7px 12px; border: 1px solid #d1d5db; border-radius: 6px; text-decoration: none; color: #374151; font-size: 14px; background: #fff; }
.pg:hover { border-color: var(--c-primaire); }
.pg.active { background: var(--c-primaire); color: #fff; border-color: var(--c-primaire); }
.pg-ellipsis { padding: 0 4px; color: #9ca3af; }
.pagination-info { text-align: center; font-size: 13px; color: #6b7280; margin-bottom: 24px; }

/* ============================== PANIER (état vide) ============================== */
.panier-vide { text-align: center; background: #fff; border-radius: 10px; padding: 48px 24px; max-width: 520px; margin: 24px auto; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.panier-vide-ico { font-size: 48px; }
.panier-vide-titre { font-size: 20px; font-weight: 700; margin: 12px 0 6px; }
.panier-vide-txt { color: #6b7280; margin-bottom: 20px; }
.panier-resume { margin-top: 28px; border-top: 1px solid #eee; padding-top: 18px; text-align: left; }
.resume-ligne { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.resume-note { font-size: 12px; color: #9ca3af; margin-top: 10px; }

/* ============================== FOOTER ============================== */
.site-footer { background: var(--c-secondaire); color: #cbd5e1; margin-top: 48px; }
.footer-cols { max-width: 1200px; margin: 0 auto; padding: 40px 28px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-logo { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 7px; font-size: 13px; }
.footer-col a { color: #cbd5e1; text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-col p { font-size: 13px; line-height: 1.6; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); text-align: center; padding: 16px; font-size: 12px; color: #94a3b8; }

/* ============================== FICHE PRODUIT (inchangé) ============================== */
.banner { padding: 12px 16px; background: #e8f0fe; border-left: 4px solid var(--c-primaire); border-radius: 6px; margin-bottom: 22px; font-size: 14px; }
.fiche { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.fiche-img { flex: 0 0 420px; max-width: 100%; background: #fff; border-radius: 8px; padding: 16px; text-align: center; }
.fiche-img img { max-width: 100%; max-height: 460px; object-fit: contain; }
.fiche-form { flex: 1; min-width: 300px; background: #fff; padding: 24px; border-radius: 8px; }
.fiche-form .desc { font-size: 14px; color: #555; margin-bottom: 18px; }
.fiche-form label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 5px; color: #333; }
.fiche-form select, .fiche-form input[type=number] { width: 100%; padding: 9px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }

.tiers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tier { padding: 5px 10px; border: 1px solid var(--c-primaire); background: #fff; color: var(--c-primaire); border-radius: 14px; font-size: 12px; cursor: pointer; }
.tier:hover { background: var(--c-primaire); color: #fff; }

.prix-box { margin-top: 22px; padding: 18px; border-radius: 8px; background: #f0f7f0; border: 1px solid #cfe6cf; min-height: 70px; }
.prix-hint { color: #888; font-size: 14px; }
.prix-vente { font-size: 30px; font-weight: 700; color: #14532d; }
.prix-meta { font-size: 13px; color: #555; margin-top: 4px; }
.prix-renvoi { font-size: 15px; font-weight: 600; color: #92400e; }

/* --- Galerie produit (miniatures images[]) --- */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.thumbs .thumb-img { width: 60px; height: 60px; object-fit: contain; background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 3px; cursor: pointer; }
.thumbs .thumb-img.active { border-color: var(--c-primaire); border-width: 2px; }

/* ======================== FILTRES BAR ======================== */
.filtres-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; background: #fff; border: 1px solid #eaedf1; border-radius: 14px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(16,24,40,0.04); }
.filtre-pill { position: relative; }
.pill-btn { padding: 7px 14px; border: 1.5px solid #d1d5db; border-radius: 20px; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; color: #374151; }
.pill-btn:hover, .pill-active { border-color: var(--c-primaire); color: var(--c-primaire); }
.pill-val { font-weight: 400; }
.pill-dropdown { position: absolute; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 14px; z-index: 100; min-width: 280px; }
.swatch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.swatch-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 8px; cursor: pointer; text-decoration: none; color: #374151; border: 2px solid transparent; }
.swatch-item:hover { background: #f9fafb; }
.swatch-active { border-color: var(--c-primaire); }
.swatch-circle { width: 32px; height: 32px; border-radius: 50%; display: block; }
.swatch-nom { font-size: 12px; font-weight: 600; }
.swatch-n { font-size: 11px; color: #9ca3af; }
.pill-reset { display: block; margin-top: 10px; font-size: 12px; color: #6b7280; text-align: center; }
.pill-reset-all { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }
.pill-search { padding: 7px 14px; border: 1.5px solid #d1d5db; border-radius: 20px; font-size: 13px; min-width: 180px; outline: none; }
.pill-search:focus { border-color: var(--c-primaire); }
.cat-dropdown { min-width: 320px; max-height: 400px; overflow-y: auto; }
.cat-tout { display: block; padding: 6px 8px; border-radius: 6px; font-size: 13px; color: #374151; text-decoration: none; margin-bottom: 6px; }
.cat-tout:hover, .cat-active { background: #f0f7ff; color: var(--c-primaire); font-weight: 600; }
.cat-groupe { margin-bottom: 8px; }
.cat-famille-nom { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; color: #9ca3af; letter-spacing: 0.08em; padding: 4px 8px 2px; }
.cat-sf { display: block; padding: 5px 8px 5px 16px; font-size: 13px; color: #374151; text-decoration: none; border-radius: 5px; }
.cat-sf:hover { background: #f9fafb; }
.cat-sf.cat-active { background: #f0f7ff; color: var(--c-primaire); font-weight: 600; }
.cat-n { color: #9ca3af; font-size: 11px; }
.filtres-total { margin-left: auto; font-size: 13px; color: #6b7280; }

/* ======================== ENTONNOIR PRIX ======================== */
.entonnoir-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill-qty { width: 80px; padding: 7px 10px; border: 1.5px solid #d1d5db; border-radius: 20px; font-size: 13px; font-weight: 600; color: #374151; text-align: center; outline: none; }
.pill-qty:focus { border-color: var(--c-primaire); }
.pill-qty::-webkit-inner-spin-button, .pill-qty::-webkit-outer-spin-button { opacity: 1; }
.pill-option { display: block; width: 100%; text-align: left; padding: 7px 12px; background: none; border: none; border-radius: 6px; font-size: 13px; color: #374151; cursor: pointer; white-space: nowrap; }
.pill-option:hover { background: #f3f4f6; }
.pill-option-active { color: var(--c-primaire); font-weight: 700; background: #f0f7ff; }
.pill-option-reset { color: #9ca3af; font-size: 12px; border-top: 1px solid #f0f0f0; margin-top: 4px; padding-top: 8px; }
.entonnoir-go { background: var(--c-primaire); color: #fff; border-color: var(--c-primaire); }
.entonnoir-go:hover { filter: brightness(0.9); }
.entonnoir-login-note { font-size: 12px; color: #9ca3af; font-style: italic; white-space: nowrap; }

/* ======================== PRIX SUR LES CARTES (mode entonnoir) ======================== */
.card-prix-pu { display: block; font-size: 18px; font-weight: 700; color: #14532d; margin-top: 6px; }
.card-prix-total { display: block; font-size: 12px; color: #6b7280; margin-top: 1px; }
.card-prix-tech { display: block; font-size: 11px; color: #9ca3af; margin-top: 2px; font-style: italic; }
.card-prix-devis { display: block; font-size: 13px; font-weight: 600; color: #92400e; margin-top: 6px; }
/* Bouton ajout rapide panier depuis la carte entonnoir */
.card-addcart-form { margin-top: 8px; }
.card-addcart-btn { width: 100%; font-size: 13px; padding: 7px 12px; }

/* ============================== RESPONSIVE ============================== */
@media (max-width: 920px) {
  .catalogue-layout { grid-template-columns: 1fr; }
  .filtres { position: static; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .rayons { display: none; }
  .footer-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .header-search input { min-width: 120px; }
}
