/*
 * PRATINIUM — custom-header-v26.css  (priorité 1100)
 * Objectif : aligner le header EXACTEMENT comme la capture d'écran :
 *
 *   [ Logo + textes ]   [ Acheter ]  [ Voter ]  [ Investir ]   [ 🔍 Rechercher ]
 *
 * - Boutons : style pill arrondi, taille réduite (~42px hauteur)
 * - "Acheter" et "Voter" : fond gris clair, bord arrondi
 * - "Investir" : fond bleu PRATINIUM
 * - Recherche : champ pill à droite
 * - Valable sur TOUTES les pages (pas seulement l'accueil)
 */

/* ════════════════════════════════════════════════════════════════════════
   RESET — Annuler les surcharges des versions précédentes sur le header
   ════════════════════════════════════════════════════════════════════════ */
.pf-header-centerline,
.pf-header-ctas,
.pf-header-ctas .pf-btn {
  all: revert;
}

/* ════════════════════════════════════════════════════════════════════════
   STRUCTURE DU HEADER — flex horizontal, une seule ligne
   ════════════════════════════════════════════════════════════════════════ */
#header .header-top,
#header .header-top .container,
header .header-top,
header .header-top .container {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 16px !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 28px !important;
  min-height: 72px !important;
  box-sizing: border-box !important;
  background: #fff !important;
}

/* ── Logo : gauche, fixe ── */
#header #_desktop_logo,
#header .logo,
#header .header-top .logo,
header #_desktop_logo,
header .logo {
  flex: 0 0 auto !important;
  order: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
}

#header #_desktop_logo img,
#header .logo img,
header .logo img,
#header a.logo img {
  display: block !important;
  height: 90px !important;
  width: auto !important;
  max-width: none !important;
}

/* ── Bloc central (CTAs) : pousse vers le centre avec margin auto ── */
.pf-header-centerline {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  order: 1 !important;
  margin: 0 !important;
  max-width: none !important;
  overflow: visible !important;
}

/* ── CTAs dans le bloc central ── */
.pf-header-centerline .pf-header-ctas,
.pf-header-ctas {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
}

/* ── Style commun des boutons CTA header ── */
.pf-header-ctas .pf-btn,
.pf-header-centerline .pf-header-ctas .pf-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 22px !important;
  border-radius: 999px !important;      /* pill */
  font-size: .88rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  cursor: pointer !important;
  border: 1.5px solid transparent !important;
  transition: opacity .15s, transform .1s !important;
  box-sizing: border-box !important;
  min-width: 96px !important;
}

/* Acheter / Voter : fond gris clair, texte sombre */
.pf-header-ctas .pf-btn--ghost,
.pf-header-ctas .pf-btn--secondary,
.pf-header-centerline .pf-header-ctas .pf-btn--ghost,
.pf-header-centerline .pf-header-ctas .pf-btn--secondary {
  background: #f1f3f5 !important;
  color: #1a1a2e !important;
  border-color: #e2e5e8 !important;
}
.pf-header-ctas .pf-btn--ghost:hover,
.pf-header-ctas .pf-btn--secondary:hover {
  background: #e4e7ea !important;
  color: #1a1a2e !important;
}

/* Investir : bleu PRATINIUM */
.pf-header-ctas .pf-btn--primary,
.pf-header-centerline .pf-header-ctas .pf-btn--primary {
  background: #185FA5 !important;
  color: #fff !important;
  border-color: #185FA5 !important;
}
.pf-header-ctas .pf-btn--primary:hover {
  background: #1569b8 !important;
  color: #fff !important;
}

/* ── Recherche : droite, width fixe ── */
.pf-header-centerline #search_widget,
.pf-header-centerline #_desktop_search,
.pf-header-centerline .search-widget,
#header .header-top #search_widget,
#header .header-top #_desktop_search,
#header .header-top .search-widget {
  flex: 0 0 auto !important;
  width: 240px !important;
  max-width: 240px !important;
  min-width: 0 !important;
  order: 2 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.pf-header-centerline .search-widget form,
.pf-header-centerline #search_widget form,
#header .search-widget form,
#header #search_widget form {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.pf-header-centerline .search-widget input[type="text"],
.pf-header-centerline #search_widget input[type="text"],
#header .search-widget input[type="text"],
#header #search_widget input[type="text"] {
  width: 100% !important;
  height: 42px !important;
  border-radius: 999px !important;
  border: 1.5px solid #e2e5e8 !important;
  padding: 0 16px 0 40px !important;
  font-size: .88rem !important;
  background: #f8f9fa !important;
  box-sizing: border-box !important;
  outline: none !important;
}
.pf-header-centerline .search-widget input[type="text"]:focus,
#header .search-widget input[type="text"]:focus {
  border-color: #185FA5 !important;
  background: #fff !important;
}

/* ── Masquer la barre de nav supérieure ("Contactez-nous", devise, panier mini) sur l'accueil ── */
body#index .header-nav,
body.page-index .header-nav {
  display: none !important;
}

/* ── Pas de doublon CTAs dans le hero quand ils sont dans le header ── */
body.pf-ctas-in-header .pf-hero .pf-hero__ctas {
  display: none !important;
}


/* ════════════════════════════════════════════════════════════════════════
   TABLETTE (768–1024px)
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  #header .header-top,
  #header .header-top .container,
  header .header-top,
  header .header-top .container {
    padding: 0 18px !important;
    gap: 12px !important;
    min-height: 64px !important;
  }

  .pf-header-ctas .pf-btn,
  .pf-header-centerline .pf-header-ctas .pf-btn {
    min-width: 80px !important;
    padding: 0 16px !important;
    font-size: .82rem !important;
  }

  .pf-header-centerline #search_widget,
  .pf-header-centerline #_desktop_search,
  .pf-header-centerline .search-widget,
  #header .header-top #search_widget,
  #header .header-top .search-widget {
    width: 180px !important;
    max-width: 180px !important;
  }
}


/* ════════════════════════════════════════════════════════════════════════
   MOBILE (< 768px)
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  #header .header-top,
  #header .header-top .container,
  header .header-top,
  header .header-top .container {
    flex-wrap: wrap !important;
    padding: 10px 16px !important;
    min-height: auto !important;
    gap: 8px !important;
  }

  /* Logo : toute la première ligne */
  #header #_desktop_logo,
  #header .logo,
  header #_desktop_logo,
  header .logo {
    flex: 0 0 auto !important;
    order: 0 !important;
  }

  #header #_desktop_logo img,
  header .logo img {
    height: 40px !important;
  }

  /* Bloc central : 2ème ligne, pleine largeur */
  .pf-header-centerline {
    flex: 1 1 100% !important;
    order: 2 !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  /* CTAs : 3 boutons sur une ligne */
  .pf-header-ctas,
  .pf-header-centerline .pf-header-ctas {
    width: 100% !important;
    gap: 6px !important;
  }

  .pf-header-ctas .pf-btn,
  .pf-header-centerline .pf-header-ctas .pf-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 0 8px !important;
    font-size: .78rem !important;
    height: 38px !important;
  }

  /* Recherche : pleine largeur */
  .pf-header-centerline #search_widget,
  .pf-header-centerline #_desktop_search,
  .pf-header-centerline .search-widget,
  #header .header-top #search_widget,
  #header .header-top .search-widget {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   V34 — Correction définitive toutes pages : même ligne que l'accueil
   Logo / Acheter / Voter / Investir / Rechercher dans .pf-header-centerline
   ════════════════════════════════════════════════════════════════════════ */
#header .pf-header-top-global,
#header .header-top {
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
}

#header .pf-header-top-global > .container,
#header .header-top > .container {
  width: 100% !important;
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding: 0 28px !important;
  min-height: 118px !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

#header .pf-header-row-global,
#header .header-top > .container > .row,
#header .header-top .container .row {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 26px !important;
  float: none !important;
}

#header #_desktop_logo,
#header .pf-header-logo-global,
#header .header-top .logo,
#header .header-top a.logo {
  flex: 0 0 320px !important;
  width: 320px !important;
  max-width: 320px !important;
  min-width: 280px !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

#header #_desktop_logo h1 { margin: 0 !important; line-height: 0 !important; }
#header #_desktop_logo img,
#header .pf-header-logo-global img,
#header .header-top .logo img,
#header .header-top a.logo img {
  height: 90px !important;
  width: auto !important;
  max-width: 300px !important;
  display: block !important;
}

#header .pf-header-centerline {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  float: none !important;
  order: 2 !important;
}

#header .pf-header-centerline .pf-header-ctas {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

#header .pf-header-centerline .pf-btn {
  height: 42px !important;
  min-height: 42px !important;
  min-width: 104px !important;
  padding: 0 22px !important;
  border-radius: 999px !important;
  font-size: .88rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

#header .pf-header-centerline #search_widget,
#header .pf-header-centerline #_desktop_search,
#header .pf-header-centerline .search-widget {
  display: block !important;
  flex: 0 1 280px !important;
  width: 280px !important;
  max-width: 280px !important;
  min-width: 220px !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

#header .pf-header-centerline .search-widget form,
#header .pf-header-centerline #search_widget form,
#header .pf-header-centerline #_desktop_search form { width: 100% !important; margin: 0 !important; }

#header .pf-header-centerline input[type="text"],
#header .pf-header-centerline input[type="search"] {
  height: 42px !important;
  border-radius: 999px !important;
}

/* Le hook displayTop reste chargé pour compatibilité, mais ne doit plus créer une 2e ligne visuelle. */
#header .pf-header-classic-top-hook {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

/* Devise / panier restent dans .header-nav sur les pages internes. Accueil : header pur comme la capture. */
body#index #header .header-nav,
body.page-index #header .header-nav { display: none !important; }

@media (max-width: 1024px) {
  #header .pf-header-top-global > .container,
  #header .header-top > .container { min-height: 110px !important; padding: 0 18px !important; }
  #header #_desktop_logo,
  #header .pf-header-logo-global { flex-basis: 280px !important; width: 280px !important; min-width: 240px !important; }
  #header #_desktop_logo img,
  #header .pf-header-logo-global img { height: 75px !important; max-width: 260px !important; }
  #header .pf-header-centerline { gap: 8px !important; }
  #header .pf-header-centerline .pf-btn { min-width: 86px !important; padding: 0 15px !important; font-size: .82rem !important; }
  #header .pf-header-centerline #search_widget,
  #header .pf-header-centerline #_desktop_search,
  #header .pf-header-centerline .search-widget { flex-basis: 210px !important; width: 210px !important; min-width: 170px !important; }
}

@media (max-width: 767px) {
  #header .pf-header-top-global > .container,
  #header .header-top > .container { min-height: auto !important; padding: 10px 14px !important; }
  #header .pf-header-row-global,
  #header .header-top .container .row { flex-wrap: wrap !important; gap: 8px !important; }
  #header #_desktop_logo,
  #header .pf-header-logo-global { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important; justify-content: flex-start !important; }
  #header #_desktop_logo img,
  #header .pf-header-logo-global img { height: 60px !important; max-width: 220px !important; }
  #header .pf-header-centerline { flex: 1 1 100% !important; width: 100% !important; flex-direction: column !important; align-items: stretch !important; gap: 8px !important; }
  #header .pf-header-centerline .pf-header-ctas { width: 100% !important; gap: 6px !important; }
  #header .pf-header-centerline .pf-btn { flex: 1 1 0 !important; min-width: 0 !important; padding: 0 8px !important; height: 38px !important; min-height: 38px !important; font-size: .78rem !important; }
  #header .pf-header-centerline #search_widget,
  #header .pf-header-centerline #_desktop_search,
  #header .pf-header-centerline .search-widget { flex: 1 1 100% !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important; }
}

/* V35 — verrouillage post-JS : même structure après réaffectation dynamique des modules */
body.pf-header-stable-v35 #header .pf-header-row-global {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
}
body.pf-header-stable-v35 #header .pf-header-logo-global { order: 1 !important; }
body.pf-header-stable-v35 #header .pf-header-centerline { order: 2 !important; margin-left: auto !important; }
body.pf-header-stable-v35 #header .pf-header-centerline #search_widget,
body.pf-header-stable-v35 #header .pf-header-centerline #_desktop_search,
body.pf-header-stable-v35 #header .pf-header-centerline .search-widget {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}