/**
 * BienHabillé — Header CSS
 * 
 * @package BienHabille
 */

/* ============================================================
   ANNOUNCEMENT BAR
   ============================================================ */

.bh-announcement-bar {
  position: relative;
  background: var(--bh-black);
  color: var(--bh-white);
  height: 36px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.bh-announcement-bar__track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: bh-ticker 30s linear infinite;
  gap: var(--bh-space-12);
}

.bh-announcement-bar__track:hover {
  animation-play-state: paused;
}

.bh-announcement-bar__item {
  font-size: var(--bh-text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-right: var(--bh-space-12);
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.bh-announcement-bar__item:last-child {
  border-right: none;
}

.bh-announcement-bar__close {
  position: absolute;
  right: var(--bh-space-4);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--bh-white);
  cursor: pointer;
  padding: var(--bh-space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity var(--bh-transition);
  z-index: 2;
  line-height: 1;
  font-size: 18px;
}

.bh-announcement-bar__close:hover {
  opacity: 1;
}

@keyframes bh-ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   HEADER WRAPPER
   ============================================================ */

.bh-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bh-white);
  border-bottom: 1px solid var(--bh-gray-mid);
  transition: transform var(--bh-transition-slow), box-shadow var(--bh-transition);
}

.bh-header--hidden {
  transform: translateY(-100%);
}

.bh-header--scrolled {
  box-shadow: var(--bh-shadow-md);
}

/* ============================================================
   HEADER TOP ROW — Logo + Search + Icons
   ============================================================ */

.bh-header__top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--bh-space-6);
  padding: var(--bh-space-3) var(--bh-space-8);
  transition: all var(--bh-transition-slow);
}

/* Switcher genre gauche */
.bh-header__switcher {
  display: flex;
  gap: var(--bh-space-6);
  flex-shrink: 0;
}

.bh-header__genre {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.bh-header__genre-name {
  font-size: var(--bh-text-md);
  font-weight: 700;
  color: var(--bh-black);
  line-height: 1.2;
  transition: color var(--bh-transition);
}

.bh-header__genre-slogan {
  font-size: var(--bh-text-xs);
  font-weight: 400;
  color: var(--bh-gray-text);
  line-height: 1;
}

.bh-header__genre--inactive .bh-header__genre-name {
  color: var(--bh-gray-text);
  font-weight: 400;
}

/* Logo centré */
.bh-header__logo {
  text-align: center;
  text-decoration: none;
  transition: opacity var(--bh-transition-slow), max-height var(--bh-transition-slow);
  overflow: hidden;
}

.bh-header__logo-text {
  font-family: var(--bh-font);
  font-size: 28px;
  font-weight: 700;
  color: var(--bh-black);
  letter-spacing: -0.02em;
  line-height: 1;
}

/* Icônes droite */
.bh-header__actions {
  display: flex;
  align-items: center;
  gap: var(--bh-space-4);
  flex-shrink: 0;
}

.bh-header__action-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--bh-black);
  padding: var(--bh-space-2);
  transition: opacity var(--bh-transition);
  text-decoration: none;
}

.bh-header__action-btn:hover {
  opacity: 0.6;
}

.bh-header__action-btn svg {
  width: 22px;
  height: 22px;
}

/* Badge panier / compte */
.bh-header__badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--bh-red);
  color: var(--bh-white);
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ============================================================
   SEARCH BAR
   ============================================================ */

.bh-header__search {
  position: relative;
  width: 100%;
}

.bh-header__search-input {
  width: 100%;
  height: 42px;
  background: var(--bh-gray-light);
  border: 1px solid transparent;
  border-radius: var(--bh-radius-pill);
  padding: 0 var(--bh-space-5) 0 44px;
  font-family: var(--bh-font);
  font-size: var(--bh-text-sm);
  color: var(--bh-black);
  transition: border-color var(--bh-transition), background var(--bh-transition);
  outline: none;
}

.bh-header__search-input:focus {
  background: var(--bh-white);
  border-color: var(--bh-gray-mid);
}

.bh-header__search-input::placeholder {
  color: var(--bh-gray-text);
}

.bh-header__search-icon {
  position: absolute;
  left: var(--bh-space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--bh-gray-text);
  pointer-events: none;
}

.bh-header__search-icon svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   SEARCH DROPDOWN
   ============================================================ */

.bh-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bh-white);
  border: 1px solid var(--bh-gray-mid);
  border-radius: var(--bh-radius-lg);
  box-shadow: var(--bh-shadow-lg);
  padding: var(--bh-space-6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--bh-space-8);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--bh-transition), transform var(--bh-transition);
}

.bh-search-dropdown.is-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.bh-search-dropdown__close {
  position: absolute;
  top: var(--bh-space-4);
  right: var(--bh-space-4);
  background: none;
  border: 1px solid var(--bh-gray-mid);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--bh-black);
  transition: background var(--bh-transition);
}

.bh-search-dropdown__close:hover {
  background: var(--bh-gray-light);
}

.bh-search-dropdown__title {
  font-size: var(--bh-text-sm);
  font-weight: 700;
  color: var(--bh-black);
  margin-bottom: var(--bh-space-4);
}

/* Tags "Les plus recherchés" */
.bh-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bh-space-2);
}

.bh-search-tag {
  display: inline-flex;
  align-items: center;
  padding: var(--bh-space-2) var(--bh-space-4);
  border: 1px solid var(--bh-black);
  border-radius: var(--bh-radius-pill);
  font-size: var(--bh-text-sm);
  font-weight: 400;
  color: var(--bh-black);
  text-decoration: none;
  background: var(--bh-white);
  cursor: pointer;
  transition: background var(--bh-transition), color var(--bh-transition);
}

.bh-search-tag:hover {
  background: var(--bh-black);
  color: var(--bh-white);
}

/* Cards "Les inspirations" */
.bh-search-inspirations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--bh-space-3);
}

.bh-search-inspiration-card {
  border-radius: var(--bh-radius-md);
  overflow: hidden;
  aspect-ratio: 16/9;
  display: block;
  text-decoration: none;
}

.bh-search-inspiration-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--bh-transition-slow);
}

.bh-search-inspiration-card:hover img {
  transform: scale(1.04);
}

/* Suggestions résultats */
.bh-search-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: var(--bh-space-2);
}

.bh-search-result-item {
  display: flex;
  align-items: center;
  gap: var(--bh-space-4);
  padding: var(--bh-space-3);
  border-radius: var(--bh-radius-md);
  text-decoration: none;
  color: var(--bh-black);
  transition: background var(--bh-transition);
}

.bh-search-result-item:hover {
  background: var(--bh-beige-light);
}

.bh-search-result-item img {
  width: 48px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--bh-radius-sm);
  background: var(--bh-beige-mid);
  flex-shrink: 0;
}

.bh-search-result-item__title {
  font-size: var(--bh-text-sm);
  font-weight: 500;
  flex: 1;
}

.bh-search-result-item__price {
  font-size: var(--bh-text-sm);
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.bh-header__nav {
  border-top: 1px solid var(--bh-gray-mid);
}

.bh-nav__list {
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.bh-nav__list > li {
  position: relative;
}

.bh-nav__list > li > a {
  display: block;
  padding: var(--bh-space-3) var(--bh-space-5);
  font-size: var(--bh-text-sm);
  font-weight: 600;
  color: var(--bh-black);
  text-decoration: none;
  position: relative;
  transition: color var(--bh-transition);
  white-space: nowrap;
}

.bh-nav__list > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--bh-space-5);
  right: var(--bh-space-5);
  height: 2px;
  background: var(--bh-black);
  transform: scaleX(0);
  transition: transform var(--bh-transition);
}

.bh-nav__list > li:hover > a::after,
.bh-nav__list > li.is-open > a::after,
.bh-nav__list > li.current-menu-item > a::after {
  transform: scaleX(1);
}

/* Item "Last chance" en rouge */
.bh-nav__list > li.menu-item--accent > a {
  color: var(--bh-red);
}

.bh-nav__list > li.menu-item--accent > a::after {
  background: var(--bh-red);
}

/* ============================================================
   MEGA MENU
   ============================================================ */

.bh-mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 320px;
  background: var(--bh-white);
  border: 1px solid var(--bh-gray-mid);
  border-top: none;
  box-shadow: var(--bh-shadow-lg);
  padding: var(--bh-space-6);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity var(--bh-transition), transform var(--bh-transition);
}

.bh-nav__list > li.is-open .bh-mega-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.bh-mega-menu[hidden] {
  display: block !important; /* override hidden pour animation CSS */
  opacity: 0;
  pointer-events: none;
}

.bh-mega-menu__inner {
  display: flex;
  gap: var(--bh-space-8);
  align-items: flex-start;
}

/* Section liens */
.bh-mega-section {
  min-width: 160px;
}

.bh-mega-section__title {
  font-size: var(--bh-text-sm);
  font-weight: 700;
  color: var(--bh-black);
  margin-bottom: var(--bh-space-4);
  padding-bottom: var(--bh-space-2);
  border-bottom: 1px solid var(--bh-gray-mid);
}

.bh-mega-section__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--bh-space-2);
}

.bh-mega-section__links a {
  font-size: var(--bh-text-sm);
  color: var(--bh-black);
  text-decoration: none;
  transition: color var(--bh-transition);
  display: flex;
  align-items: center;
  gap: var(--bh-space-2);
}

.bh-mega-section__links a:hover {
  color: var(--bh-gray-text);
}

/* Badge dans les liens */
.bh-mega-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--bh-radius-pill);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.bh-mega-badge--default  { background: var(--bh-black);     color: var(--bh-white); }
.bh-mega-badge--new      { background: #2D7A4F;             color: var(--bh-white); }
.bh-mega-badge--thermal  { background: #6B7C5C;             color: var(--bh-white); }
.bh-mega-badge--sale     { background: var(--bh-red);       color: var(--bh-white); }

/* Section offres (rouge) */
.bh-mega-section--offers .bh-mega-section__links a {
  color: var(--bh-red);
  font-weight: 500;
}

/* Section carte visuelle */
.bh-mega-cards {
  display: flex;
  gap: var(--bh-space-4);
}

.bh-mega-card {
  position: relative;
  width: 160px;
  border-radius: var(--bh-radius-md);
  overflow: hidden;
  text-decoration: none;
  display: block;
  background: var(--bh-beige-mid);
  flex-shrink: 0;
}

.bh-mega-card__image {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  transition: transform var(--bh-transition-slow);
}

.bh-mega-card:hover .bh-mega-card__image {
  transform: scale(1.04);
}

.bh-mega-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--bh-space-4);
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: var(--bh-white);
}

.bh-mega-card__letter {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.bh-mega-card__keyword {
  font-size: var(--bh-text-xs);
  opacity: 0.8;
}

.bh-mega-card__category {
  font-size: var(--bh-text-sm);
  font-weight: 600;
}

.bh-mega-card__price {
  font-size: var(--bh-text-xs);
  opacity: 0.8;
  margin-top: 2px;
}

/* CTA bouton */
.bh-mega-cta {
  margin-top: var(--bh-space-5);
}

.bh-mega-cta a {
  display: inline-flex;
  align-items: center;
  padding: var(--bh-space-3) var(--bh-space-6);
  background: var(--bh-black);
  color: var(--bh-white);
  border-radius: var(--bh-radius-pill);
  font-size: var(--bh-text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--bh-transition);
}

.bh-mega-cta a:hover {
  opacity: 0.8;
}

/* ============================================================
   HEADER STICKY — Logo masqué
   ============================================================ */

.bh-header--scrolled .bh-header__logo {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

.bh-header--scrolled .bh-header__top {
  padding-top: var(--bh-space-2);
  padding-bottom: var(--bh-space-2);
}

/* ============================================================
   MOBILE HEADER
   ============================================================ */

@media (max-width: 1023px) {

  .bh-header__top {
    grid-template-columns: auto 1fr auto;
    padding: var(--bh-space-3) var(--bh-space-4);
    gap: var(--bh-space-3);
  }

  .bh-header__logo {
    display: none; /* Logo mobile centré séparé */
  }

  .bh-header__mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--bh-space-3) var(--bh-space-4);
    position: relative;
  }

  .bh-header__mobile-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--bh-font);
    font-size: 22px;
    font-weight: 700;
    color: var(--bh-black);
    letter-spacing: -0.02em;
    text-decoration: none;
  }

  .bh-header__burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--bh-space-2);
  }

  .bh-header__burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--bh-black);
    border-radius: 2px;
    transition: transform var(--bh-transition), opacity var(--bh-transition);
  }

  .bh-header__mobile-actions {
    display: flex;
    align-items: center;
    gap: var(--bh-space-3);
  }

  .bh-header__search-row {
    padding: 0 var(--bh-space-4) var(--bh-space-3);
  }

  .bh-header__nav {
    display: none; /* masqué sur mobile */
  }

  /* Genre mobile sous le burger */
  .bh-header__switcher {
    align-items: center;
  }

  .bh-header__genre-name {
    font-size: var(--bh-text-base);
  }
}

@media (min-width: 1024px) {
  .bh-header__mobile-top,
  .bh-header__burger,
  .bh-header__mobile-logo,
  .bh-header__search-row {
    display: none;
  }
}

/* ============================================================
   MOBILE MENU DRAWER
   ============================================================ */

.bh-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
}

.bh-mobile-menu__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity var(--bh-transition-slow);
}

.bh-mobile-menu__panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 85vw;
  max-width: 420px;
  background: var(--bh-white);
  transform: translateX(-100%);
  transition: transform var(--bh-transition-slow);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.bh-mobile-menu:not([hidden]) {
  pointer-events: all;
}

.bh-mobile-menu:not([hidden]) .bh-mobile-menu__overlay {
  opacity: 1;
}

.bh-mobile-menu:not([hidden]) .bh-mobile-menu__panel {
  transform: translateX(0);
}

/* Header du drawer */
.bh-mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--bh-space-4) var(--bh-space-5);
  border-bottom: 1px solid var(--bh-gray-mid);
}

.bh-mobile-menu__genre-tabs {
  display: flex;
  flex: 1;
  gap: 0;
}

.bh-mobile-menu__genre-tab {
  flex: 1;
  padding: var(--bh-space-3) var(--bh-space-4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-align: left;
}

.bh-mobile-menu__genre-tab--active {
  border-bottom-color: var(--bh-black);
}

.bh-mobile-menu__genre-tab-name {
  font-size: var(--bh-text-base);
  font-weight: 700;
  color: var(--bh-black);
  display: block;
}

.bh-mobile-menu__genre-tab-slogan {
  font-size: var(--bh-text-xs);
  color: var(--bh-gray-text);
  display: block;
}

.bh-mobile-menu__genre-tab--inactive .bh-mobile-menu__genre-tab-name {
  color: var(--bh-gray-text);
}

.bh-mobile-menu__close {
  background: var(--bh-black);
  color: var(--bh-white);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
  transition: opacity var(--bh-transition);
}

.bh-mobile-menu__close:hover {
  opacity: 0.7;
}

/* Nav items mobile */
.bh-mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.bh-mobile-nav__list li {
  border-bottom: 1px solid var(--bh-gray-mid);
}

.bh-mobile-nav__list > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--bh-space-5) var(--bh-space-5);
  font-size: var(--bh-text-base);
  font-weight: 600;
  color: var(--bh-black);
  text-decoration: none;
  transition: background var(--bh-transition);
}

.bh-mobile-nav__list > li > a:hover {
  background: var(--bh-beige-light);
}

.bh-mobile-nav__list > li > a svg {
  width: 16px;
  height: 16px;
  color: var(--bh-gray-text);
}

/* Last chance mobile */
.bh-mobile-nav__list > li.menu-item--accent > a {
  color: var(--bh-red);
}

/* Sous-menu mobile accordéon */
.bh-mobile-nav__sub {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bh-beige-light);
  display: none;
}

.bh-mobile-nav__sub.is-open {
  display: block;
}

.bh-mobile-nav__sub li a {
  display: block;
  padding: var(--bh-space-3) var(--bh-space-5) var(--bh-space-3) var(--bh-space-8);
  font-size: var(--bh-text-sm);
  color: var(--bh-black);
  text-decoration: none;
  border-bottom: 1px solid var(--bh-gray-mid);
  transition: background var(--bh-transition);
}

.bh-mobile-nav__sub li a:hover {
  background: var(--bh-beige-mid);
}