/* =============================================================================
   En-tete Marcel Blanc (inc/site-header.php)
   Logo · recherche (avec suggestions) · menu compte · langue · panier.
   Classes .mb-hdr* uniquement : aucune regle de l'ancien en-tete
   (main.scss / mobile.scss) ne s'y applique.
   ========================================================================== */

/* --- Neutralise les restes de l'ancien en-tete ---------------------------- */
body.mb-hdr-on #page::before { content: none !important; display: none !important; }
body.mb-hdr-on .mobile-categories-toggle { display: none !important; }
/* L'ancien en-tete reservait 45px en haut de page (body { margin-top: 45px }) */
body.mb-hdr-on { margin-top: 0 !important; }

.mb-hdr {
  background: #fff;
  border-bottom: 1px solid #DDE3E9;
  margin: 0 0 28px;                 /* respiration entre l'en-tete et la page */
  font-family: "Plus Jakarta Sans", "Source Sans Pro", system-ui, sans-serif;
  color: #121A21;
  position: relative;
  z-index: 50;
}

.mb-hdr__bar::before,
.mb-hdr__bar::after { content: none !important; display: none !important; } /* clearfix de .col-full : ajoutait un ecart de 22 px a gauche et a droite */
.mb-hdr__bar {
  display: flex;
  align-items: center;
  gap: 12px 22px;
  padding-top: 20px !important;
  padding-bottom: 20px !important;
  box-sizing: border-box;
}

/* --- Logo ------------------------------------------------------------------ */
/* Logo centre verticalement : le lien et l'image n'ont aucune marge, et la
   colonne est une boite flex centree (sinon l'image s'aligne sur la ligne de
   base du texte et remonte de quelques pixels). */
.mb-hdr__brand { flex: 0 0 auto; min-width: 0; line-height: 0; display: flex; align-items: center; align-self: center; }
.mb-hdr__brand a { display: flex; align-items: center; margin: 0 !important; padding: 0 !important; line-height: 0; }
.mb-hdr__brand img {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: middle;
  height: 36px !important;
  width: auto !important;
  max-width: 100%;
  border-radius: 0 !important;      /* la charte arrondit toutes les images */
}
.mb-hdr__sitename {
  font-weight: 800; font-size: 20px; letter-spacing: .08em;
  color: #D40032 !important; text-decoration: none !important; line-height: 1.2;
}

/* --- Recherche ------------------------------------------------------------- */
.mb-hdr__search {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  position: relative;
}
.mb-hdr__field {
  display: flex;
  height: 48px;
  border: 1.5px solid #CBD3DA;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mb-hdr__field:hover { border-color: #9AA6B0; }
.mb-hdr__field:focus-within {
  border-color: #D40032;
  box-shadow: 0 0 0 3px rgba(212, 0, 50, .12);
}
.mb-hdr .mb-hdr__search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 500;
  color: #121A21 !important;
  -webkit-appearance: none;
  appearance: none;
}
.mb-hdr .mb-hdr__search-input::placeholder { color: #7A858F; opacity: 1; font-weight: 400; }
.mb-hdr .mb-hdr__search-input::-webkit-search-cancel-button { cursor: pointer; }
.mb-hdr .mb-hdr__search-btn {
  flex: 0 0 56px;
  width: 56px;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #D40032 !important;
  color: #fff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mb-hdr .mb-hdr__search-btn:hover { background: #B00029 !important; }
.mb-hdr__search-btn .mb-hdr__icon { width: 21px; height: 21px; }

/* Suggestions : plus larges que le champ (le panneau deborde a droite, par
   dessus le menu compte) pour que les noms de produit restent lisibles. */
.mb-hdr__suggest {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 100%;
  width: min(680px, calc(100vw - 32px));
  z-index: 70;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #DDE3E9;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(18, 26, 33, .16);
}
.mb-hdr__suggest[hidden] { display: none; }
.mb-sg__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #121A21 !important;
  text-decoration: none !important;
  cursor: pointer;
}
.mb-sg__item:hover,
.mb-sg__item.is-active { background: #F2F4F6; }
.mb-sg__img {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid #EEF1F4;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  margin: 0 !important;
}
.mb-sg__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mb-sg__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  /* deux lignes au plus */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.mb-sg__sku { font-size: 12.5px; color: #66717B; }
.mb-sg mark,
.mb-sg__name mark,
.mb-sg__sku mark { background: none; color: #D40032; font-weight: 700; padding: 0; }
.mb-sg__price { flex: 0 0 auto; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.mb-sg__all {
  display: block;
  margin-top: 4px;
  padding: 11px 10px;
  border-top: 1px solid #EEF1F4;
  border-radius: 0 0 8px 8px;
  color: #D40032 !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
}
.mb-sg__all:hover,
.mb-sg__all.is-active { background: #FDF0F3; }
.mb-sg__empty { padding: 12px 10px; font-size: 14px; color: #5A646E; }

/* --- Outils : compte, langue, panier, menu --------------------------------- */
.mb-hdr__tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Menu compte (un seul bouton, liens dans un menu deroulant) */
.mb-hdr__acc { position: relative; }
.mb-hdr .mb-hdr__acc-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 12px 0 8px;
  border-radius: 10px;
  cursor: pointer;
  list-style: none;
  color: #121A21;
  white-space: nowrap;
}
.mb-hdr .mb-hdr__acc-btn:hover,
.mb-hdr__acc[open] .mb-hdr__acc-btn { background: #F2F4F6; }
.mb-hdr__acc-btn::-webkit-details-marker { display: none; }
.mb-hdr__acc-btn::marker { content: ""; }
.mb-hdr__acc-btn:focus-visible { outline: 2px solid #D40032; outline-offset: 2px; }
.mb-hdr__acc-text { display: flex; flex-direction: column; line-height: 1.2; }
.mb-hdr__acc-top { font-size: 12px; color: #66717B; font-weight: 500; }
.mb-hdr__acc-label { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; }
.mb-hdr__chev { transition: transform .15s ease; }
.mb-hdr__acc[open] .mb-hdr__chev { transform: rotate(180deg); }

.mb-hdr__acc-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  padding: 6px;
  background: #fff;
  border: 1px solid #DDE3E9;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(18, 26, 33, .16);
  display: flex;
  flex-direction: column;
  z-index: 70;
}
.mb-hdr__acc-panel a {
  padding: 11px 12px;
  border-radius: 8px;
  color: #121A21 !important;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none !important;
}
.mb-hdr__acc-panel a:hover { background: #F2F4F6; }
.mb-hdr__acc-panel a.is-cta {
  margin-top: 4px;
  background: #D40032;
  color: #fff !important;
  text-align: center;
}
.mb-hdr__acc-panel a.is-cta:hover { background: #B00029; }

/* Boutons-icones (panier, menu categories) */
.mb-hdr .mb-hdr__iconbtn {
  position: relative;
  width: 48px;
  height: 48px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #121A21 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: none !important;
}
.mb-hdr .mb-hdr__iconbtn:hover { background: #F2F4F6 !important; }
.mb-hdr__icon { width: 24px; height: 24px; display: block; flex: 0 0 auto; }

.mb-hdr__cart-count {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 100px;
  background: #D40032;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}
.mb-hdr__cart-count.is-empty { display: none; }

/* Langue (menu secondaire, TranslatePress) */
.mb-hdr__lang { padding: 0 4px; }
.mb-hdr__lang ul.mb-hdr__secondary {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  gap: 8px;
  align-items: center;
}
.mb-hdr__lang li { margin: 0 !important; padding: 0 !important; }
.mb-hdr__lang li::before { display: none !important; }
.mb-hdr__lang a {
  color: #5A646E !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
  text-transform: uppercase;
}
.mb-hdr__lang a:hover { color: #D40032 !important; }
.mb-hdr__lang img { border-radius: 0 !important; }

.mb-hdr__burger { display: none !important; }


/* --- Tablette / mobile ----------------------------------------------------- */
@media (max-width: 1024px) {
  .mb-hdr { margin-bottom: 20px; }
  .mb-hdr__bar { flex-wrap: wrap; padding: 12px 16px !important; gap: 10px 8px; }
  .mb-hdr__brand { flex: 1 1 auto; }
  .mb-hdr__brand img { height: 30px !important; }
  .mb-hdr__suggest { width: auto; right: 0; }
  .mb-hdr__tools { gap: 2px; }
  .mb-hdr__burger { display: inline-flex !important; }
  .mb-hdr__search { order: 10; flex: 1 1 100%; }
  .mb-hdr__acc-text { display: none; }
  .mb-hdr .mb-hdr__acc-btn { width: 48px; padding: 0; justify-content: center; }
}

@media (max-width: 600px) {
  /* Le logo cede la place aux icones plutot que de les repousser a la ligne */
  .mb-hdr__brand { flex: 1 1 0; min-width: 0; }
  .mb-hdr__brand img { height: auto !important; max-height: 30px; max-width: 100% !important; }
  .mb-hdr__tools { flex-wrap: nowrap; gap: 0; }
  .mb-hdr .mb-hdr__iconbtn,
  .mb-hdr .mb-hdr__acc-btn { width: 42px; height: 44px; }
  .mb-hdr__field { height: 46px; }
  .mb-hdr .mb-hdr__search-input { font-size: 16px !important; padding: 0 14px !important; } /* evite le zoom iOS */
  .mb-hdr__acc-panel { right: -84px; }
  .mb-sg__price { display: none; }
}
