/*!
 * top-banner.css — Styles du bandeau haut de page (slot unique)
 * v1.0.0 — à héberger à côté de top-banner-engine.js
 *
 * Tout le layout dépendant du bandeau lit UNE seule variable : --top-banner-h
 * (posée par le moteur, 0px si aucun bandeau). Aucun offset codé en dur.
 */

:root {
  --top-banner-h: 0px;
}

/* ---- Le bandeau ---- */

.tb-banner {
  min-height: 44px;
  text-align: center;
  color: #000;
}

.tb-banner__wrapper {
  max-width: 992px;
  margin: 0 auto;
  padding: 10px 40px 10px 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  font-size: 16px;
  font-weight: 400;
  text-align: center;
}

.tb-banner__icon {
  width: 30px;
  margin: 0 10px;
  vertical-align: middle;
}

/* Lien CTA — contraste WCAG AA (≥ 4.5:1 sur fond crème) */
.tb-banner__cta {
  font-size: 16px;
  color: #6B4C0A;
  font-weight: 700;
  text-decoration: underline;
  margin-left: 10px;
}

.tb-banner__close {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}

/* ---- Responsive : quel texte est visible ---- */

.tb-desktop-only { display: none; }
.tb-mobile-only { display: inline-block; text-align: left; }

@media (min-width: 768px) {
  .tb-desktop-only { display: inline-block; }
  .tb-mobile-only { display: none; }
}

/* ---- Layout du header : tout se cale sur --top-banner-h ---- */

.HeaderNavigationBar__nav {
  margin-top: var(--top-banner-h, 0px);
}

@media (max-width: 767px) {
  /* Layout compact mobile : texte à gauche / CTA à droite, hauteur maîtrisée */
  body.top-banner-mobile-visible .tb-banner__wrapper {
    min-height: 72px;
    padding: 10px 42px 10px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    align-items: center;
    text-align: left;
    font-size: 15px;
    line-height: 1.35;
  }

  body.top-banner-mobile-visible .tb-banner__icon { display: none; }

  body.top-banner-mobile-visible .tb-mobile-only {
    display: block;
    text-align: left;
  }

  body.top-banner-mobile-visible .tb-banner__cta.tb-mobile-only {
    white-space: nowrap;
    margin-left: 0;
    font-size: 14px;
    line-height: 1.2;
  }

  body.top-banner-mobile-visible .tb-banner__close { right: 14px; }

  /* La barre sticky (filtres PLP) se cale sous le header + bandeau */
  body.top-banner-mobile-visible .HeaderNavigationBar__switch {
    top: var(--top-banner-h, 0px);
  }
}
