/**
 * Planète Jeunesse v2 - Header Component
 * En-tête du site avec logo et navigation
 */

/* =====================================================
   SITE HEADER
   ===================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background-color: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border-light);
  transition: box-shadow var(--transition-normal);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-md);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-6);
}

@media (max-width: 991px) {
  .site-header__inner {
    gap: var(--space-3);
  }
}

@media (max-width: 767px) {
  .site-header__inner {
    height: var(--header-height-mobile);
    padding: 0 var(--space-2);
  }
}

/* =====================================================
   LOGO
   ===================================================== */

.site-logo {
  flex-shrink: 0;
}

.site-logo__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.site-logo__image {
  height: 50px;
  width: auto;
}

@media (max-width: 767px) {
  /* Sur tres petits ecrans le logo doit pouvoir se reduire, sinon il pousse
     le bouton hamburger hors du viewport et cree un debordement horizontal. */
  .site-logo {
    flex-shrink: 1;
    min-width: 0;
  }

  .site-logo__link {
    min-width: 0;
  }

  .site-logo__image {
    height: auto;
    max-height: 40px;
    max-width: 100%;
    min-width: 0;
  }
}

.site-logo__text {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  display: none;
}

@media (min-width: 576px) {
  .site-logo__text {
    display: block;
  }
}

/* =====================================================
   HEADER ACTIONS (recherche, etc.)
   ===================================================== */

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* =====================================================
   MOBILE MENU TOGGLE
   ===================================================== */

.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  z-index: calc(var(--z-fixed) + 1);
  transition: background-color var(--transition-fast);
  flex-shrink: 0;
}

.menu-toggle:hover {
  background-color: var(--color-bg-secondary);
}

.menu-toggle:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.menu-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text-primary);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.68, -0.6, 0.32, 1.6),
              opacity 0.25s ease,
              top 0.35s cubic-bezier(0.68, -0.6, 0.32, 1.6),
              background-color 0.25s ease;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.menu-toggle__bar:nth-child(1) {
  top: 14px;
}

.menu-toggle__bar:nth-child(2) {
  top: 21px;
}

.menu-toggle__bar:nth-child(3) {
  top: 28px;
}

/* État actif - couleur blanche pour contraste avec menu sombre */
.menu-toggle.is-active .menu-toggle__bar {
  background-color: #ffffff;
}

/* Animation hamburger vers X avec effet bounce */
.menu-toggle.is-active .menu-toggle__bar:nth-child(1) {
  top: 21px;
  transform: translateX(-50%) rotate(45deg) scaleX(1.1);
}

.menu-toggle.is-active .menu-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: translateX(-50%) scaleX(0);
}

.menu-toggle.is-active .menu-toggle__bar:nth-child(3) {
  top: 21px;
  transform: translateX(-50%) rotate(-45deg) scaleX(1.1);
}

@media (max-width: 991px) {
  .menu-toggle {
    display: flex;
  }
}

/* =====================================================
   HERO BANNER (optionnel pour page d'accueil)
   ===================================================== */

.hero-banner {
  position: relative;
  background-color: var(--color-bg-dark);
  background-image: var(--hero-bg-url);
  background-size: cover;
  background-position: top;
  color: var(--color-text-inverse);
  padding: var(--space-20) 0;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.6) 100%
  );
}

.hero-banner__content {
  position: relative;
  z-index: 1;
  max-width: 750px;
  animation: fadeInUp 0.6s ease-out;
  background: rgba(0, 0, 0, 0.25);
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hero-banner__title {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
  margin-bottom: var(--space-4);
  line-height: 1.1;
  color: #ffffff;
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
}

.hero-banner__subtitle {
  font-size: var(--font-size-xl);
  color: #ffffff;
  margin-bottom: var(--space-8);
  line-height: var(--line-height-relaxed);
  max-width: 600px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.hero-banner .btn {
  position: relative;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, var(--color-primary) 0%, #c62828 50%, var(--color-primary-dark) 100%);
  background-size: 200% 200%;
  border: none;
  border-radius: 50px;
  box-shadow:
    0 4px 15px rgba(162, 25, 27, 0.4),
    0 0 0 0 rgba(255, 255, 255, 0.4);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1;
}

/* Effet brillance au survol */
.hero-banner .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
  z-index: -1;
}

.hero-banner .btn:hover {
  transform: translateY(-4px) scale(1.02);
  background-position: 100% 0;
  box-shadow:
    0 8px 30px rgba(162, 25, 27, 0.5),
    0 0 0 3px rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.hero-banner .btn:hover::before {
  left: 100%;
}

.hero-banner .btn:active {
  transform: translateY(-2px) scale(0.98);
  box-shadow: 0 4px 15px rgba(162, 25, 27, 0.4);
}

@media (max-width: 991px) {
  .hero-banner {
    padding: var(--space-16) 0;
  }
}

@media (max-width: 767px) {
  .hero-banner {
    padding: var(--space-10) 0;
    text-align: center;
  }

  .hero-banner__content {
    max-width: 100%;
    padding: var(--space-6);
    margin: 0 var(--space-2);
  }

  .hero-banner__title {
    font-size: var(--font-size-3xl);
  }

  .hero-banner__subtitle {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-6);
    max-width: 100%;
  }
}

@media (max-width: 575px) {
  .hero-banner {
    padding: var(--space-8) 0;
  }

  .hero-banner__content {
    padding: var(--space-5);
  }

  .hero-banner__title {
    font-size: var(--font-size-2xl);
  }

  .hero-banner__subtitle {
    font-size: var(--font-size-sm);
  }
}

/* =====================================================
   PAGE BANNER (pour pages intérieures)
   ===================================================== */

.page-banner {
  background-color: var(--color-bg-secondary);
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.page-banner__title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-2);
}

.page-banner__description {
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
}

@media (max-width: 767px) {
  .page-banner {
    padding: var(--space-6) 0;
  }

  .page-banner__title {
    font-size: var(--font-size-2xl);
  }
}
