/* ============================================================
   Ma Belle Table Basse — en-tête
   ============================================================ */
.mbtb-hdr {
  display: block;
  font-family: var(--mbtb-body, "Source Sans Pro", system-ui, sans-serif);
  color: var(--mbtb-fg, #1c1c1c);
  background: var(--mbtb-bg, #faf6f0);
  position: relative;
  z-index: 40;
}
.mbtb-hdr--sticky { position: sticky; top: 0; }

/* ---------- bandeau d'annonces ---------- */
.mbtb-hdr__ann {
  position: relative;
  background: #1c1c1c;
  color: #faf6f0;
  height: 40px;
  overflow: hidden;
}
.mbtb-hdr__ann-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding-inline: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-align: center;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.mbtb-hdr__ann-item.is-on { opacity: 1; transform: none; }
.mbtb-hdr__ann-item.is-out { opacity: 0; transform: translateY(-100%); }
.mbtb-hdr__ann-item a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- barre principale ---------- */
.mbtb-hdr__bar {
  border-bottom: 1px solid rgba(28, 28, 28, 0.1);
  background: var(--mbtb-bg, #faf6f0);
}
/* logo toujours au centre absolu de la barre, mobile compris :
   les largeurs du burger et des icônes n'ont aucune influence */
.mbtb-hdr__inner {
  position: relative;
  width: 100%;
  max-width: var(--mbtb-page, 1400px);
  margin-inline: auto;
  padding: 0 var(--mbtb-gutter, 32px);
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.mbtb-hdr__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  max-width: min(60%, 260px);
}
.mbtb-hdr__logo img { max-height: 40px; }
@media (min-width: 1000px) {
  .mbtb-hdr__inner { min-height: 96px; gap: 1.5rem; }
  .mbtb-hdr__logo { max-width: none; }
  .mbtb-hdr__logo img { max-height: 52px; }
}

/* ---------- logo ---------- */
.mbtb-hdr__logo { display: flex; align-items: center; justify-content: center; text-decoration: none; justify-self: center; }
@media (min-width: 1000px) { .mbtb-hdr__logo { justify-self: auto; } }
.mbtb-hdr__logo img { display: block; width: auto; object-fit: contain; }
.mbtb-hdr__logo-text {
  font-family: var(--mbtb-heading, "Libre Baskerville", serif);
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: -0.01em;
  color: var(--mbtb-fg, #1c1c1c);
}

/* ---------- burger ---------- */
.mbtb-hdr__burger {
  display: inline-grid; gap: 5px; padding: 6px 2px; border: 0; background: none; cursor: pointer;
}
.mbtb-hdr__burger span { display: block; width: 24px; height: 1.5px; background: currentColor; transition: transform 0.3s ease; }
@media (min-width: 1000px) { .mbtb-hdr__burger { display: none; } }

/* ---------- navigation ---------- */
.mbtb-hdr__nav { display: none; }
@media (min-width: 1000px) {
  .mbtb-hdr__nav--main { display: block; justify-self: start; }
  .mbtb-hdr__nav--second { display: block; }
}
.mbtb-hdr__list { display: flex; gap: clamp(16px, 2vw, 34px); list-style: none; margin: 0; padding: 0; }
.mbtb-hdr__item { position: relative; }

.mbtb-hdr__link {
  display: block;
  padding: 1.9rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--mbtb-fg, #1c1c1c);
}
/* texte qui glisse vers le haut au survol */
.mbtb-hdr__link-in {
  display: block;
  position: relative;
  overflow: hidden;
  height: 1.35em;
  line-height: 1.35em;
}
.mbtb-hdr__link-in [data-t] {
  display: block;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.mbtb-hdr__link-in [data-t]:last-child { position: absolute; top: 100%; left: 0; }
.mbtb-hdr__item:hover .mbtb-hdr__link-in [data-t],
.mbtb-hdr__item:focus-within .mbtb-hdr__link-in [data-t] { transform: translateY(-100%); }

/* ---------- déroulant ---------- */
.mbtb-hdr__drop {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 232px;
  padding-top: 2px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.3s;
  z-index: 5;
}
.mbtb-hdr__item:hover > .mbtb-hdr__drop,
.mbtb-hdr__item:focus-within > .mbtb-hdr__drop,
.mbtb-hdr__item.is-open > .mbtb-hdr__drop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s;
}
.mbtb-hdr__drop-box {
  background: #ffffff;
  border: 1px solid rgba(28, 28, 28, 0.08);
  box-shadow: 0 18px 46px -18px rgba(28, 28, 28, 0.28);
  padding: 1.25rem 1.5rem;
}
.mbtb-hdr__drop-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.mbtb-hdr__drop-box li {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.mbtb-hdr__item:hover .mbtb-hdr__drop-box li,
.mbtb-hdr__item:focus-within .mbtb-hdr__drop-box li,
.mbtb-hdr__item.is-open .mbtb-hdr__drop-box li {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.06s * var(--i, 0) + 0.04s);
}
.mbtb-hdr__drop-box a {
  position: relative;
  display: inline-block;
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--mbtb-fg, #1c1c1c);
  white-space: nowrap;
}
.mbtb-hdr__drop-box a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.mbtb-hdr__drop-box a:hover::after { transform: scaleX(1); transform-origin: left center; }

/* ---------- outils ---------- */
.mbtb-hdr__end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 2vw, 30px);
  justify-self: end;
}
.mbtb-hdr__tools { display: flex; align-items: center; gap: clamp(10px, 1.4vw, 20px); }
.mbtb-hdr__tool { position: relative; display: grid; place-items: center; color: inherit; text-decoration: none; }
.mbtb-hdr__tool svg { width: 22px; height: 22px; transition: transform 0.3s ease; }
.mbtb-hdr__tool:hover svg { transform: scale(1.08); }
.mbtb-hdr__tool--account { display: none; }
@media (min-width: 750px) { .mbtb-hdr__tool--account { display: grid; } }
.mbtb-hdr__count {
  position: absolute;
  top: -6px; right: -9px;
  min-width: 17px; height: 17px;
  padding-inline: 4px;
  border-radius: 999px;
  background: var(--mbtb-fg, #1c1c1c);
  color: #faf6f0;
  font-size: 0.625rem;
  line-height: 17px;
  text-align: center;
}

/* ---------- tiroir mobile ---------- */
.mbtb-drawer { position: fixed; inset: 0; z-index: 90; }
.mbtb-drawer[hidden] { display: none; }
.mbtb-drawer__veil {
  position: absolute; inset: 0;
  background: rgba(28, 28, 28, 0.45);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.mbtb-drawer.is-open .mbtb-drawer__veil { opacity: 1; }
.mbtb-drawer__panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(88vw, 380px);
  background: var(--mbtb-bg, #faf6f0);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.mbtb-drawer.is-open .mbtb-drawer__panel { transform: none; }
.mbtb-drawer__top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(28, 28, 28, 0.1);
  font-family: var(--mbtb-heading, "Libre Baskerville", serif);
  font-size: 1.125rem;
}
.mbtb-drawer__close { border: 0; background: none; cursor: pointer; color: inherit; display: grid; place-items: center; }
.mbtb-drawer__close svg { width: 22px; height: 22px; }
.mbtb-drawer__nav { overflow-y: auto; padding: 0.5rem 0 2rem; }
.mbtb-drawer__nav ul { list-style: none; margin: 0; padding: 0; }
.mbtb-drawer__nav > ul > li { border-bottom: 1px solid rgba(28, 28, 28, 0.08); }
.mbtb-drawer__nav summary,
.mbtb-drawer__link {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 1.5rem;
  font-family: var(--mbtb-heading, "Libre Baskerville", serif);
  font-size: 1.0625rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  list-style: none;
}
.mbtb-drawer__nav summary::-webkit-details-marker { display: none; }
.mbtb-drawer__nav summary svg { width: 18px; height: 18px; flex: none; transition: transform 0.3s ease; }
.mbtb-drawer__nav details[open] summary svg { transform: rotate(90deg); }
.mbtb-drawer__sub { padding: 0 0 0.75rem; }
.mbtb-drawer__sub a {
  display: block;
  padding: 0.6rem 1.5rem 0.6rem 2.25rem;
  font-size: 0.9375rem;
  text-decoration: none;
  color: inherit;
  opacity: 0.85;
}
.mbtb-drawer__sub a:hover { opacity: 1; }
body.mbtb-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .mbtb-hdr__drop, .mbtb-hdr__drop-box li, .mbtb-hdr__link-in [data-t],
  .mbtb-drawer__panel, .mbtb-drawer__veil { transition: none !important; }
}

/* ---------- menu secondaire ---------- */
.mbtb-hdr__link--sm {
  padding: 1.9rem 0;
  font-size: 0.875rem;
  font-weight: 400;
  opacity: 0.85;
}
.mbtb-hdr__nav--second .mbtb-hdr__list { gap: clamp(14px, 1.6vw, 26px); }
.mbtb-hdr__nav--second .mbtb-hdr__item:hover .mbtb-hdr__link--sm { opacity: 1; }

/* séparateur discret entre le menu secondaire et les icônes */
@media (min-width: 1000px) {
  .mbtb-hdr__nav--second + .mbtb-hdr__tools {
    padding-left: clamp(14px, 2vw, 30px);
    border-left: 1px solid rgba(28, 28, 28, 0.12);
  }
}

/* menu secondaire dans le tiroir mobile */
.mbtb-drawer__second {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(28, 28, 28, 0.1);
}
.mbtb-drawer__second a {
  display: block;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  text-decoration: none;
  color: inherit;
  opacity: 0.8;
}
.mbtb-drawer__second a:hover { opacity: 1; }

/* ---------- protection du centre : les menus ne passent jamais sous le logo ---------- */
@media (min-width: 1000px) {
  .mbtb-hdr__nav--main,
  .mbtb-hdr__end {
    max-width: calc(50% - 90px);
  }
  .mbtb-hdr__nav--main .mbtb-hdr__list,
  .mbtb-hdr__nav--second .mbtb-hdr__list {
    flex-wrap: wrap;
    row-gap: 0;
  }
  /* réserve la hauteur du logo dans la barre */
  .mbtb-hdr__bar { min-height: 96px; }
}
