/* ============ Reset & base ============ */
/* === Structure pour que le footer reste collé en bas === */
html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1; /* prend tout l'espace disponible entre header et footer */
}


* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'Urbanist', sans-serif;
  background-color: #fdfdfd;
  color: #1a1a1a;
  overflow-x: hidden;
}

body { line-height: 1.6; }

/* ============ Header ============ */
header {
  position: sticky;
  top: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  padding: 0rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
}

.logo-container { display: flex; align-items: center; gap: .5rem; }
.logo { width: 40px; height: 60px; object-fit: contain; }
.logo-text { font-size: 1.8rem; font-weight: 800; color: #7f0000; }

/* Barre de navigation (desktop) */
nav { display: flex; align-items: center; gap: 1.5rem; }
nav a {
  text-decoration: none; color: #333; font-weight: 600;
  transition: color 0.3s ease;
}
nav a:hover, nav a.active { color: #7f0000; }

/* Actions à droite (coeur + hamburger) */
.header-actions{
  margin-left: auto;          /* pousse tout le bloc à droite */
  display: flex;
  align-items: center;
  gap: 0rem;
}

/* ----- Bouton Favoris ----- */
.fav-btn{
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  color: #7f0000;
  width: 44px; height: 44px;
  cursor: pointer; padding: .5rem;
  border-radius: 10px; border: 1px solid transparent;
  background: transparent; transition: background-color .25s ease, border-color .25s ease;
    margin-left: 0px;
}
.fav-btn:hover, .fav-btn:focus{
  background-color: rgba(127,0,0,0.06);
  border-color: rgba(127,0,0,0.15);
  outline: none;
}
.heart-icon{ width:24px; height:24px; stroke: currentColor; fill: none; stroke-width: 2.2; display:block; }
.fav-count{
  position:absolute; top:-6px; right:-6px;
  background:#e60023; color:#fff; font-size:12px; font-weight:700;
  padding:2px 6px; border-radius:12px; line-height:1; box-shadow:0 0 2px rgba(0,0,0,.3);
}

/* ----- Hamburger amélioré ----- */
.hamburger{
  display:none;
  position:relative;
  width:44px;height:44px;
  border:1px solid #e9e9e9;background:#fff;cursor:pointer;
  border-radius:10px; color:#1a1a1a;
  transition: box-shadow .25s ease, border-color .25s ease, color .25s ease;
}
.hamburger:hover{ box-shadow:0 4px 12px rgba(0,0,0,.08); border-color:#e2e2e2; }
.hamburger.is-active{ color:#7f0000; border-color:#efd6d6; }

.hamburger-box{ display:inline-block; position:relative; width:22px; height:16px; }
.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after{
  position:absolute; left:0; width:22px; height:2px; background: currentColor;
  content:""; transition:transform .25s ease, opacity .2s ease, top .25s ease, bottom .25s ease;
  border-radius:2px;
}
.hamburger-inner{ top:7px; }
.hamburger-inner::before{ top:-7px; }
.hamburger-inner::after{ bottom:-7px; }
/* État ouvert (croix) */
.hamburger.is-active .hamburger-inner{ transform:rotate(45deg); }
.hamburger.is-active .hamburger-inner::before{ top:0; transform:rotate(90deg); }
.hamburger.is-active .hamburger-inner::after{ bottom:0; opacity:0; }

/* Backdrop pour menu mobile */
.backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  opacity:0; pointer-events:none; transition:opacity .25s ease; z-index:900;
}
.backdrop.show{ opacity:1; pointer-events:auto; }

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-video {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; object-fit: cover; z-index: 0;
}
.hero-content {
  position: relative; z-index: 1; color: #fff; text-align: center;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  padding: 4rem 2rem; width: 100%; max-width: 800px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.hero-content h1 { font-size: 3rem; margin-bottom: 1rem; font-weight: 800; }
.hero-content p { font-size: 1.2rem; margin-bottom: 2rem; }
.hero-content a {
  padding: 1rem 2rem; background: #7f0000; color: #fff;
  text-decoration: none; border-radius: 8px; font-weight: bold;
  transition: background 0.3s ease;
}
.hero-content a:hover { background: #660000; }

/* ============ How it works ============ */
.how-it-works {
  padding: 4rem 2rem; text-align: center; background: #fff;
}
.how-it-works h2 { font-size: 2rem; color: #7f0000; margin-bottom: 2rem; }
.steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; }
.step {
  width: 280px; padding: 2rem; border-radius: 1rem; background: #f8f8f8;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.step h3 { margin-bottom: .5rem; font-size: 1.3rem; color: #333; }
.step p { font-size: .95rem; color: #666; }

/* ============ About ============ */
.about { background: #fafafa; padding: 4rem 2rem; text-align: center; }
.about h2 { color: #7f0000; margin-bottom: 1rem; }
.about p { max-width: 600px; margin: 0 auto; color: #444; font-size: 1rem; line-height: 1.6; }

/* ============ Animate on scroll ============ */
.animate-on-scroll {
  opacity: 0; transform: translateY(30px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* ============ Footer ============ */
footer {
  text-align: center; padding: 2rem 1rem; background: #f0f0f0;
  font-size: .9rem; color: #888;
}
.footer-links { margin-bottom: .8rem; }
.footer-links a {
  color: #7f0000; text-decoration: none; margin: 0 .4rem; font-weight: 600;
  transition: color .3s ease;
}
.footer-links a:hover { color: #660000; }

/* ============ Section Coups de cœur ============ */
.favorites { background:#fff; padding:4rem 2rem; text-align:center; }
.favorites h2 { font-size:2rem; color:#7f0000; margin-bottom:2rem; }

/* Zone centrée et limitée sur desktop */
.favorites-wrap{
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

/* Desktop : grille auto et propre */
.favorites-track{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.fav-item{
  width: 100%;
  transition: transform .3s ease, box-shadow .3s ease;
}
.fav-item img{
  width:100%; border-radius:12px; box-shadow:0 4px 12px rgba(0,0,0,.08);
}
.fav-item p{ margin-top:.6rem; font-weight:600; color:#333; }
.fav-item:hover{ transform: translateY(-6px); box-shadow:0 6px 16px rgba(0,0,0,.12); }

/* Flèches (affichées seulement en mobile) */
.fav-arrow{
  position:absolute; top:50%; transform:translateY(-50%);
  width:40px; height:40px; border:none; border-radius:9999px;
  background:#ffffff; box-shadow:0 6px 16px rgba(0,0,0,.12);
  font-size:22px; line-height:1; cursor:pointer; z-index:2;
  display:none; /* caché par défaut (desktop) */
}
.fav-arrow.prev{ left:.5rem; }
.fav-arrow.next{ right:.5rem; }
.fav-arrow:disabled{ opacity:.4; cursor:default; }

/* ============ Responsive (≤ 820px) ============ */
@media (max-width: 820px){
  header{ padding: .25rem .5rem; }
  .logo{ width:34px; height:50px; }
  .logo-text{ font-size:1.5rem; }

  /* Afficher hamburger en mobile */
  .hamburger{ display:inline-flex; align-items:center; justify-content:center; }

  /* Forcer l'ordre : logo -> nav -> [coeur][hamburger] à droite */
  .logo-container{ order:1; }
  nav{ order:2; }
  .header-actions{
    order:3;
    margin-left:auto !important;
    display:flex; align-items:center; gap:.25rem;
  }
  .header-actions .fav-btn{ order:1; }   /* coeur à gauche */
  .header-actions .hamburger{ order:2; } /* hamburger à droite */

  /* --- NAV OFF-CANVAS AMÉLIORÉ --- */
  #main-nav{
    position:fixed; top:0; right:-100%;
    width:min(86vw,380px); height:100dvh;
    background:#fff; border-left:1px solid #eee;
    border-top-left-radius:16px; border-bottom-left-radius:16px;
    box-shadow:-10px 0 30px rgba(0,0,0,.12);
    display:flex; flex-direction:column; gap:0;
    padding:5.25rem 1.25rem 1.25rem;
    transition:right .32s cubic-bezier(.22,.61,.36,1);
    z-index:1000;
  }
  #main-nav.open{ right:0; }

  #main-nav a{
    display:block; padding:1rem 0; font-size:1.08rem; font-weight:700;
    color:#1a1a1a; border-bottom:1px solid #f1f1f1;
  }
  #main-nav a:last-of-type{ border-bottom:none; }

  /* Apparition progressive des liens */
  @keyframes slideIn {
    from { opacity:0; transform:translateX(12px); }
    to   { opacity:1; transform:translateX(0); }
  }
  #main-nav.open a { animation: slideIn .28s both; }
  #main-nav.open a:nth-child(1){ animation-delay: .02s; }
  #main-nav.open a:nth-child(2){ animation-delay: .06s; }
  #main-nav.open a:nth-child(3){ animation-delay: .10s; }
  #main-nav.open a:nth-child(4){ animation-delay: .14s; }

  /* Mobile : carrousel horizontal avec 2 cartes visibles */
  .favorites-track{
    display:flex; overflow-x:auto; scroll-snap-type:x mandatory;
    gap: 1rem; padding: .25rem .25rem 0;
    -webkit-overflow-scrolling: touch;
  }
  .favorites-track .fav-item{
    flex: 0 0 calc(50% - 0.5rem);
    scroll-snap-align: start;
  }
  .fav-arrow{ display:flex; align-items:center; justify-content:center; }
}

/* En desktop (≥ 821px), le hamburger est caché (rappel) */
@media (min-width: 821px){
  .hamburger{ display:none; }
}

/* ====== DESKTOP : nav + actions vraiment à droite ====== */
@media (min-width: 821px){
  /* ordre : logo -> nav -> actions */
  .logo-container{ order:1; }
  nav{ order:2; margin-left:auto; }      /* pousse le bloc de liens à droite */
  .header-actions{ order:3; margin-left:0; gap: 0rem; } /* actions collées à droite du nav */
}

/* ====== MOBILE : hamburger plus petit & joli + drawer propre ====== */
@media (max-width: 820px){
  /* cœur à gauche du hamburger, bloc à droite */
  .logo-container{ order:1; }
  nav{ order:2; }
  .header-actions{ order:3; margin-left:auto !important; gap:.25rem; }
  .header-actions .fav-btn{ order:1; }   /* coeur à gauche */
  .header-actions .hamburger{ order:2; } /* hamburger à droite */

  /* hamburger compact & clean */
  .hamburger{
    width:36px; height:36px;
    border:1px solid #e6e6e6; border-radius:10px;
    display:inline-flex; align-items:center; justify-content:center;
    background:#fff; color:#7f0000;
    box-shadow:0 1px 0 rgba(0,0,0,.02);
  }
  .hamburger:hover{ box-shadow:0 4px 12px rgba(0,0,0,.08); }
  .hamburger-box{ width:20px; height:14px; }
  .hamburger-inner,
  .hamburger-inner::before,
  .hamburger-inner::after{
    width:20px; height:2px; border-radius:2px; background:currentColor;
  }
  .hamburger-inner{ top:6px; }
  .hamburger-inner::before{ top:-6px; }
  .hamburger-inner::after{ bottom:-6px; }
  /* croix bien nette quand ouvert */
  .hamburger.is-active{ color:#7f0000; border-color:#7f0000; }

  /* drawer plus soigné */
  #main-nav{
    position:fixed; top:0; right:-100%;
    width:min(84vw, 360px); height:100dvh;
    background:#fff; border-left:1px solid #eee;
    border-top-left-radius:16px; border-bottom-left-radius:16px;
    box-shadow:-12px 0 28px rgba(0,0,0,.14);
    display:flex; flex-direction:column; gap:0;
    padding:5rem 1.25rem 1.25rem;
    transition:right .32s cubic-bezier(.22,.61,.36,1);
    z-index:1000;
  }
  #main-nav.open{ right:0; }

  #main-nav a{
    display:block;
    padding:1rem 0; font-size:1.06rem; font-weight:700; color:#1a1a1a;
    border-bottom:1px solid #f2f2f2;
    transition: transform .15s ease, background-color .15s ease;
  }
  #main-nav a:hover{ background:#faf7f7; }
  #main-nav a:active{ transform: translateX(2px); }

  /* petite anim d’apparition des liens */
  @keyframes slideIn { from{opacity:0; transform:translateX(12px);} to{opacity:1; transform:none;} }
  #main-nav.open a{ animation: slideIn .28s both; }
  #main-nav.open a:nth-child(1){ animation-delay:.02s; }
  #main-nav.open a:nth-child(2){ animation-delay:.06s; }
  #main-nav.open a:nth-child(3){ animation-delay:.10s; }
  #main-nav.open a:nth-child(4){ animation-delay:.14s; }

  /* au cas où : pas de bouton favoris dans le panneau */
  #main-nav .fav-btn{ display:none !important; }
}
/* --- CROIX visible au-dessus du menu quand il est ouvert (mobile) --- */
@media (max-width: 820px){
  /* le drawer passe dessous */
  #main-nav{ z-index: 1000; }

  /* le bouton devient au-dessus et fixe en haut à droite */
  .hamburger{ z-index: 1101; }

  .hamburger.is-active{
    position: fixed;
    top: 10px;            /* aligne avec ton header */
    right: 10px;
    width: 36px; height: 36px;   /* taille compacte et constante */
    background: #fff;
    color: #7f0000;
    border-color: #7f0000;
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
  }

  /* renforce la forme en X (barres bien centrées) */
  .hamburger.is-active .hamburger-inner{ transform: rotate(45deg); top: 7px; }
  .hamburger.is-active .hamburger-inner::before{ top: 0; transform: rotate(90deg); }
  .hamburger.is-active .hamburger-inner::after{ bottom: 0; opacity: 0; }
}


#lang-floating {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  z-index: 1000;
}

#lang-floating select {
  border: none;
  background: transparent;
  font-weight: bold;
  font-size: 14px;
  color: #7f0000;
  cursor: pointer;
}

#lang-floating select:focus {
  outline: none;
}


.user-link {
  color: #333;
  font-weight: 600;
  text-decoration: none;
}

.user-link:hover {
  color: #7f0000;
}

.user-link.active {
  color: #7f0000 !important;
}
