/* =========================================================
   CF Salubrité : composants utilitaires (Phase 0.5)
   Utilisés par le HTML injecté via hooks (Phase 1+) et
   réutilisables sur toutes les pages.
   ========================================================= */

/* ---- Bande d'annonce (livraison gratuite 300 $+) ---- */
.cfs-topbar {
  background: var(--cfs-navy);
  color: #D8E7F2;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.cfs-topbar b { color: #fff; font-weight: 700; }
.cfs-topbar svg { color: var(--cfs-orange); flex-shrink: 0; }

/* ---- Trust strip : badges certifications ---- */
.cfs-trust-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: var(--cfs-space-3) var(--cfs-space-4);
}
.cfs-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cfs-navy);
  background: var(--cfs-ground);
  border: 1px solid var(--cfs-line);
  border-radius: var(--cfs-radius-pill);
  padding: 6px 14px;
  white-space: nowrap;
}
.cfs-badge .cfs-check { color: var(--cfs-green); }

/* Variante sur fond sombre (hero, bandes marine) */
.cfs-on-dark .cfs-badge {
  color: #DCEAF4;
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .16);
}

/* ---- Badge d'état (stock, session, nouveauté) ---- */
.cfs-badge-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 4px 9px;
}
.cfs-badge-state.is-ok { color: #3D6B12; background: #EDF7DF; }
.cfs-badge-state.is-info { color: var(--cfs-blue); background: var(--cfs-blue-soft); }
.cfs-badge-state.is-warn { color: #8A4B00; background: #FDEEDD; }

/* ---- Stat block (chiffre + label) ---- */
.cfs-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--cfs-ground);
  border: 1px solid var(--cfs-line);
  border-radius: var(--cfs-radius);
  box-shadow: var(--cfs-shadow-lg);
  overflow: hidden;
}
.cfs-stat {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  padding: var(--cfs-space-5) var(--cfs-space-4);
  text-align: center;
  border-left: 1px solid var(--cfs-line);
}
.cfs-stat:first-child { border-left: none; }
.cfs-stat b {
  font-size: 30px;
  font-weight: 800;
  color: var(--cfs-blue);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.cfs-stat span {
  font-size: 14px;
  color: var(--cfs-muted);
  line-height: 1.35;
}
@media (max-width: 782px) {
  .cfs-stats { grid-template-columns: 1fr 1fr; }
  .cfs-stat { padding: 14px 10px; border-left: 1px solid var(--cfs-line); }
  .cfs-stat:nth-child(odd) { border-left: none; }
  .cfs-stat:nth-child(n+3) { border-top: 1px solid var(--cfs-line); }
  .cfs-stat b { font-size: 21px; }
  .cfs-stat span { font-size: 12.5px; }
}

/* ---- Carte témoignage ---- */
.cfs-testimonial {
  background: var(--cfs-ground);
  border: 1px solid var(--cfs-line);
  border-radius: var(--cfs-radius);
  box-shadow: var(--cfs-shadow-sm);
  padding: var(--cfs-space-5);
  display: flex;
  flex-direction: column;
  gap: var(--cfs-space-3);
}
.cfs-testimonial blockquote {
  margin: 0;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--cfs-ink);
}
.cfs-testimonial .cfs-who {
  font-size: 14px;
  color: var(--cfs-muted);
}

/* ---- Pilule téléphone ---- */
.cfs-phone-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--cfs-navy);
  text-decoration: none;
  border: 1.5px solid var(--cfs-line);
  border-radius: var(--cfs-radius-pill);
  padding: 9px 16px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: border-color .12s ease, color .12s ease;
}
.cfs-phone-pill:hover { border-color: var(--cfs-blue); color: var(--cfs-blue); }
.cfs-phone-pill svg { color: var(--cfs-blue); }
.cfs-on-dark .cfs-phone-pill { border-color: rgba(255, 255, 255, .4); color: #fff; }
.cfs-on-dark .cfs-phone-pill:hover { border-color: #fff; }
.cfs-on-dark .cfs-phone-pill svg { color: var(--cfs-orange); }

/* ---- Sticky bar mobile (téléphone + soumission) ---- */
.cfs-mobile-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: var(--cfs-ground);
  border-top: 1px solid var(--cfs-line);
  box-shadow: 0 -4px 20px rgba(5, 49, 78, .12);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  gap: 10px;
}
/* Les libellés passent sur deux lignes plutôt que de sortir de l'écran :
   ils sont traduits, et leur largeur dépend de la langue et de la police. */
.cfs-mobile-bar .cfs-btn {
  flex: 1 1 0;
  min-width: 0;
  font-size: 14px;
  line-height: 1.15;
  text-align: center;
  padding: 6px 8px;
  min-height: 42px;
  gap: 6px;
}
.cfs-mobile-bar .cfs-btn svg { flex: none; }
/* Un seul style partout : celui des pages services (phase 4), l'appel
   est l'action dominante (orange), la soumission en bouton secondaire. */
.cfs-mobile-bar .cfs-btn-call {
  flex-grow: 1.2;
  background: var(--cfs-orange);
  color: #fff;
  box-shadow: 0 2px 8px rgba(244, 124, 38, .35);
}
.cfs-mobile-bar .cfs-btn-primary {
  background: transparent;
  color: var(--cfs-navy) !important;
  box-shadow: inset 0 0 0 1.5px var(--cfs-line);
}
@media (max-width: 782px) {
  .cfs-mobile-bar { display: flex; }
  /* dégage le bas de page pour ne rien masquer */
  .l-footer { padding-bottom: 64px; }
}

/* =========================================================
   Composants partagés accueil / pages services (Phase 4)
   Règles extraites telles quelles de front-page.css : la portée
   passe de .cfs-front à .l-main pour que les pages services
   héritent du même langage visuel, à spécificité identique.
   Les styles propres à l'accueil restent dans front-page.css,
   chargé après ce fichier.
   ========================================================= */

/* ---- Rythme vertical des sections custom ---- */
.l-main .cfs-section { padding-top: var(--cfs-section-y); padding-bottom: var(--cfs-section-y); }

/* ---- Blocs communs de section ---- */
.l-main .cfs-eyebrow {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--cfs-blue);
  margin-bottom: 12px;
}
.l-main .cfs-on-dark .cfs-eyebrow { color: #7FC4EF; }
.l-main .cfs-intro { color: var(--cfs-muted); max-width: 70ch; }
.l-main .cfs-intro p { margin-bottom: .8em; }
.l-main .cfs-intro p:last-child { margin-bottom: 0; }
.l-main .cfs-intro a { font-weight: 600; }
.l-main .cfs-section-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 40px;
}
.l-main .cfs-section-foot.is-center { justify-content: center; }
.l-main .cfs-hint { color: var(--cfs-muted); font-size: 14.5px; }
.l-main .cfs-card-desc {
  margin: 0;
  font-size: 15px;
  color: var(--cfs-muted);
  flex: 1;
}
.l-main .cfs-meta { display: flex; flex-wrap: wrap; gap: 8px; }

/* Titre de section (H2) */
.l-main .cfs-section h2 {
  color: var(--cfs-navy);
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 12px;
}

/* ---- Hero marine pleine largeur ---- */
.cfs-hero {
  position: relative;
  background:
    radial-gradient(1000px 560px at 88% -12%, rgba(38, 139, 210, .32), transparent 62%),
    radial-gradient(780px 460px at -8% 112%, rgba(0, 100, 168, .38), transparent 60%),
    linear-gradient(160deg, #052E49 0%, #073E63 58%, #084A77 100%);
  color: #fff;
  overflow: hidden;
  padding-top: 88px;
  padding-bottom: 132px;
}
.cfs-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    transparent 40%,
    rgba(255, 255, 255, .035) 45%,
    rgba(255, 255, 255, .075) 50%,
    rgba(255, 255, 255, .035) 55%,
    transparent 60%);
  pointer-events: none;
}
.cfs-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.6px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(100deg, transparent 52%, #000 88%);
  mask-image: linear-gradient(100deg, transparent 52%, #000 88%);
  pointer-events: none;
}
.cfs-hero-content { position: relative; z-index: 1; max-width: 680px; }
.cfs-hero .cfs-eyebrow { margin-bottom: 8px; }
.l-main .cfs-hero h1 {
  color: #fff;
  padding-top: 0; /* Impreza met 1.5rem sur les headings non premiers */
  font-size: clamp(34px, 4.6vw, 52px);
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.12;
  margin: 0 0 16px;
  text-wrap: balance;
}
.l-main .cfs-hero-sub {
  color: #C9DCEA;
  font-size: 18.5px;
  font-weight: 500;
  line-height: 1.55;
  max-width: 58ch;
  margin: 0 0 30px;
  text-wrap: balance;
}
.cfs-hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; }
.cfs-hero-reassure { margin: 14px 0 0; font-size: 14px; color: #9DBED4; }
.cfs-hero .cfs-trust-strip { justify-content: flex-start; padding: 0; margin-top: 36px; }

/* ---- Bande de chiffres chevauchant le bas du hero ---- */
.cfs-stats-section { padding: 0; }
.cfs-stats-section .l-section-h { padding-top: 0; padding-bottom: 0; }
.cfs-stats-section .cfs-stats {
  position: relative;
  z-index: 2;
  margin-top: -64px;
}
@media (max-width: 782px) {
  .cfs-stats-section .cfs-stats { margin-top: -48px; }
  .cfs-hero { padding-top: 56px; padding-bottom: 96px; }
}

/* ---- Cartes à tuile d'icône (secteurs, bénéfices) ---- */
.cfs-sector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 44px;
}
.cfs-sector-card {
  background: var(--cfs-ground);
  border: 1px solid var(--cfs-line);
  border-radius: var(--cfs-radius);
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--cfs-shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cfs-sector-card:hover { transform: translateY(-3px); box-shadow: var(--cfs-shadow-md); }
.cfs-sector-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--cfs-blue-soft);
  color: var(--cfs-blue);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}
.l-main .cfs-sector-card h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--cfs-navy);
  margin: 0;
}
.l-main .cfs-sector-card p {
  margin: 0;
  font-size: 15px;
  color: var(--cfs-muted);
  flex: 1;
}
.cfs-sector-card .cfs-arrow-link { margin-top: 6px; }
@media (max-width: 980px) {
  .cfs-sector-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .cfs-sector-grid { grid-template-columns: 1fr; }
}

/* ---- Témoignage pleine largeur sur fond marine ---- */
.cfs-quote { background: var(--cfs-navy); color: #fff; text-align: center; }
.cfs-quote blockquote {
  margin: 0 auto 18px;
  max-width: 780px;
  font-size: clamp(20px, 2.6vw, 27px);
  font-weight: 600;
  line-height: 1.45;
  border: none;
  padding: 0;
}
.cfs-quote-mark { color: var(--cfs-orange); font-size: 52px; line-height: 0; display: block; margin-bottom: 26px; font-weight: 800; }
.cfs-quote-who { color: #9DBED4; font-size: 15px; margin: 0; }

/* ---- CTA final marine ---- */
.cfs-final-cta {
  background: linear-gradient(140deg, var(--cfs-navy) 0%, #0A4E7D 100%);
  color: #fff;
  text-align: center;
}
.l-main .cfs-final-cta h2 {
  color: #fff;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  margin-bottom: 14px;
}
.cfs-final-cta p { color: #C9DCEA; max-width: 54ch; margin: 0 auto 30px; }
.cfs-final-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }

/* ---- Trame de points réutilisable (même motif que le hero) ---- */
.cfs-dots { position: relative; overflow: hidden; }
.cfs-dots::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.6px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(100deg, transparent 52%, #000 88%);
  mask-image: linear-gradient(100deg, transparent 52%, #000 88%);
  pointer-events: none;
}
.cfs-dots > .l-section-h { position: relative; z-index: 1; }
