/**
 * BienHabillé — Header complet
 * Barre annonce, header desktop, header mobile, sticky.
 */

/* ═══════════════════════════════════════════════════════════════════
   ANNOUNCEMENT BAR
   ═══════════════════════════════════════════════════════════════════ */
.bh-announcement-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--bh-topbar-height, 36px);
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  position: relative;
  z-index: 1005;
  overflow: hidden;
  transition: min-height 0.25s ease, padding 0.25s ease, opacity 0.25s ease;
}

.bh-announcement-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  max-width: var(--bh-container-max, 1320px);
  margin: 0 auto;
  padding: 0 var(--bh-container-padding, 1.25rem);
  min-height: inherit;
}

/* Texte défilant (doublon dans le HTML pour boucle continue) */
.bh-announcement-bar__marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.bh-announcement-bar__marquee-track {
  display: inline-flex;
  width: max-content;
  gap: 4rem;
  animation: bh-announcement-marquee 28s linear infinite;
  white-space: nowrap;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .bh-announcement-bar__marquee-track {
    animation: none;
    justify-content: center;
    width: 100%;
  }
}

@keyframes bh-announcement-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Au scroll (header sticky) : plus de « trou » sous le header — la barre sort du flux */
.bh-announcement-bar.bh-announcement-bar--collapsed-flow {
  min-height: 0 !important;
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden !important;
  border: 0 !important;
}

.bh-announcement-bar__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-left: 0.5rem;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.9;
  transition: background 0.2s, opacity 0.2s;
}

.bh-announcement-bar__close:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER DESKTOP (≥1024px)
   ═══════════════════════════════════════════════════════════════════ */
/* Avant scroll : fond gris clair */
.bh-header.bh-header--desktop {
  display: none;
  background: #f5f5f5;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  min-height: 70px;
  z-index: 9999;
}

@media (min-width: 1024px) {
  .bh-header.bh-header--desktop {
    display: block;
  }
}

/* Après scroll : fond blanc, sticky */
.bh-header.bh-header--desktop.bh-header--sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom-color: var(--bh-border-color, #e5e5e5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bh-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: var(--bh-container-max, 1320px);
  margin: 0 auto;
  padding: 0.75rem var(--bh-container-padding, 1.25rem);
  min-height: 70px;
}

.bh-header__left {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 0 1 auto;
}

.bh-header__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--bh-text-primary, #1a1a1a);
  font-weight: 700;
  font-size: 1.5rem;
  transition: color 0.2s ease;
}

.bh-header__logo:hover {
  color: var(--bh-color-primary-hover, #000);
}

.bh-header__logo-img {
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.bh-header__logo-text {
  font-family: var(--bh-font-heading, inherit);
}

.bh-header__nav {
  display: flex;
  align-items: center;
}

.bh-header__nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bh-header__nav-list .bh-nav-item,
.bh-header__nav-list > li {
  position: relative;
}

.bh-header__nav-list .bh-nav-link,
.bh-header__nav-list > li > a {
  display: flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--bh-text-primary, #1a1a1a);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.bh-header__nav-list .bh-nav-link:hover,
.bh-header__nav-list > li > a:hover,
.bh-header__nav-list > li.current-menu-item > a {
  color: var(--bh-color-primary, #1a1a1a);
  border-bottom-color: var(--bh-color-primary, #1a1a1a);
}

.bh-header__center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 40%;
  min-width: 200px;
}

/* Barre recherche pill-shaped, fond blanc, bordure fine */
.bh-header__search {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 400px;
  height: 44px;
  padding: 0 1rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bh-header__search:focus-within {
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.bh-header__search-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-right: 0.5rem;
  color: var(--bh-text-muted, #999);
}

.bh-header__search-icon .bh-icon {
  width: 20px;
  height: 20px;
}

.bh-header__search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--bh-text-primary, #1a1a1a);
}

.bh-header__search-input:focus {
  outline: none;
}

.bh-header__search-input::placeholder {
  color: var(--bh-text-muted, #999);
}

.bh-header__search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  padding: 0.5rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 10000;
}

.bh-header__search {
  position: relative;
}

.bh-header__right {
  flex: 0 0 auto;
}

.bh-header__icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bh-header__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--bh-text-primary, #1a1a1a);
  text-decoration: none;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}

.bh-header__icon:hover {
  color: var(--bh-color-primary, #1a1a1a);
  background: var(--bh-bg-secondary, #f5f5f5);
}

.bh-header__icon--cart {
  position: relative;
}

.bh-header__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.125rem;
  text-align: center;
  color: #fff;
  background: var(--bh-color-accent, #e01020);
  border-radius: 999px;
}

.bh-header__badge--notification {
  width: 8px;
  height: 8px;
  min-width: 8px;
  padding: 0;
  font-size: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER MOBILE (<1024px)
   ═══════════════════════════════════════════════════════════════════ */
.bh-header-mobile {
  display: block;
  background: var(--bh-bg-primary, #fff);
  border-bottom: 1px solid var(--bh-border-color, #e5e5e5);
  z-index: 9999;
}

@media (min-width: 1024px) {
  .bh-header-mobile {
    display: none;
  }
}

/* Avant scroll : icône recherche masquée (barre de recherche visible en dessous) */
.bh-header-mobile__icon--search {
  display: none;
}

/* Après scroll (sticky) : barre recherche masquée, icône recherche visible */
.bh-header-mobile.bh-header-mobile--sticky .bh-header-mobile__icon--search {
  display: flex;
}

.bh-header-mobile.bh-header-mobile--sticky .bh-header-mobile__row--top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bh-bg-primary, #fff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 10000;
}

/* Placeholder pour éviter le saut quand sticky (row--top fixed, row--search hidden) */
.bh-header-mobile.bh-header-mobile--sticky::before {
  content: '';
  display: block;
  height: 56px;
}

.bh-header-mobile__icon--search {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.bh-header-mobile__icon--search .bh-icon,
.bh-header-mobile__icon--search svg {
  width: 22px;
  height: 22px;
}

.bh-header-mobile__icon--search:hover {
  opacity: 0.8;
}

.bh-header-mobile__badge--notification {
  top: 6px;
  right: 6px;
  background: var(--bh-color-accent, #e01020);
}

.bh-header-mobile__row {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
}

.bh-header-mobile__row--top {
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
}

.bh-header-mobile__row--search {
  padding-top: 0;
  padding-bottom: 0.75rem;
}

.bh-header-mobile__hamburger {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--bh-text-primary, #1a1a1a);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.bh-header-mobile__hamburger:hover {
  background: var(--bh-bg-secondary, #f5f5f5);
}

.bh-header-mobile__hamburger .bh-icon {
  width: 24px;
  height: 24px;
}

.bh-header-mobile__logo {
  flex: 1;
  display: flex;
  justify-content: center;
}

.bh-header-mobile__logo a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--bh-text-primary, #1a1a1a);
  font-weight: 700;
}

.bh-header-mobile__logo-img {
  max-height: 36px;
  width: auto;
  height: auto;
}

.bh-header-mobile__icons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.bh-header-mobile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--bh-text-primary, #1a1a1a);
  text-decoration: none;
  position: relative;
}

.bh-header-mobile__icon--cart .bh-header-mobile__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.125rem;
  text-align: center;
  color: #fff;
  background: var(--bh-color-accent, #e01020);
  border-radius: 999px;
}

.bh-header-mobile__search {
  width: 100%;
}

.bh-header-mobile__search form {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 0 1rem;
  background: #f5f5f5;
  border-radius: 999px;
}

.bh-header-mobile__search-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-right: 0.5rem;
  color: var(--bh-text-muted, #999);
}

.bh-header-mobile__search-icon .bh-icon,
.bh-header-mobile__search-icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.bh-header-mobile__search-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 1rem;
}

.bh-header-mobile__search-input:focus {
  outline: none;
}

/* ═══════════════════════════════════════════════════════════════════
   OFF-CANVAS MOBILE
   ═══════════════════════════════════════════════════════════════════ */
.bh-off-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: min(85vw, 400px);
  max-width: 400px;
  height: 100vh;
  background: #fff;
  z-index: 10001;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.bh-off-canvas[aria-hidden="false"] {
  transform: translateX(0);
}

.bh-off-canvas__inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.bh-off-canvas__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--bh-border-color, #e5e5e5);
}

.bh-off-canvas__tabs {
  display: flex;
  gap: 0;
}

.bh-off-canvas__tab {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--bh-text-secondary, #666);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.bh-off-canvas__tab--active {
  color: var(--bh-text-primary, #1a1a1a);
  border-bottom-color: var(--bh-color-primary, #1a1a1a);
}

.bh-off-canvas__close {
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--bh-text-primary, #1a1a1a);
}

.bh-off-canvas__search {
  padding: 1rem;
  border-bottom: 1px solid var(--bh-border-color, #e5e5e5);
}

.bh-off-canvas__search form {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 0 1rem;
  background: #f5f5f5;
  border-radius: 999px;
}

.bh-off-canvas__search-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-right: 0.5rem;
  color: var(--bh-text-muted, #999);
}

.bh-off-canvas__search-icon .bh-icon,
.bh-off-canvas__search-icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.bh-off-canvas__search input {
  flex: 1;
  min-width: 0;
  padding: 0 0.5rem;
  background: transparent;
  border: none;
  font-size: 1rem;
}

.bh-off-canvas__nav {
  flex: 1;
  padding: 1rem 0;
}

.bh-off-canvas__menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bh-off-canvas__menu .bh-drawer-nav-item {
  border-bottom: 1px solid var(--bh-border-color-light, #f0f0f0);
}

/* Sous-menus (accordion) : masqués par défaut */
.bh-off-canvas__menu .bh-drawer-sub {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #f8f8f8;
}
.bh-off-canvas__menu .bh-drawer-item--open > .bh-drawer-sub {
  display: block;
}
.bh-off-canvas__menu .bh-drawer-sub .bh-drawer-nav-link {
  padding-left: 1.5rem;
  font-size: 0.9375rem;
}
.bh-off-canvas__menu .bh-drawer-sub .bh-drawer-sub .bh-drawer-nav-link {
  padding-left: 2.25rem;
  font-size: 0.875rem;
}

.bh-off-canvas__menu .bh-drawer-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  color: var(--bh-text-primary, #1a1a1a);
  text-decoration: none;
  font-weight: 500;
}
.bh-off-canvas__menu .bh-drawer-arrow {
  flex-shrink: 0;
  margin-left: 0.5rem;
  opacity: 0.7;
  font-size: 0.875em;
}

.bh-off-canvas__footer {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--bh-border-color, #e5e5e5);
}

.bh-off-canvas__util {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--bh-text-primary, #1a1a1a);
  text-decoration: none;
  font-size: 0.875rem;
}

.bh-off-canvas__util .bh-icon {
  width: 20px;
  height: 20px;
}

/* Overlay */
.bh-overlay[data-bh-overlay] {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.bh-overlay.bh-overlay--visible {
  opacity: 1;
  visibility: visible;
}

.bh-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
