/* ============================================================
   KLUUB PRODUCTION — Menu mobile hamburger
   À ajouter dans votre feuille de style principale
   Breakpoint d'activation : ≤ 768px
   ============================================================ */

/* -- Masquer le menu horizontal existant sur mobile -- */
@media (max-width: 768px) {

  /* Adaptez ce sélecteur à votre nav existante */
  nav .nav-links,
  header nav a,
  .header-nav a,
  nav > a {
    display: none;
  }

  /* ---- Bouton hamburger ---- */

  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-hamburger:hover,
  .nav-hamburger:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.35);
    outline: none;
  }

  .nav-hamburger__bar {
    display: block;
    width: 18px;
    height: 1.5px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity   0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
  }

  /* Animation hamburger → croix */
  .nav-hamburger[aria-expanded="true"] .nav-hamburger__bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  .nav-hamburger[aria-expanded="true"] .nav-hamburger__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .nav-hamburger[aria-expanded="true"] .nav-hamburger__bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  /* ---- Overlay sombre derrière le drawer ---- */
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 98;
    pointer-events: none;
    transition: background 0.28s ease;
  }

  .nav-overlay.is-open {
    background: rgba(0, 0, 0, 0.55);
    pointer-events: auto;
  }

  /* ---- Drawer (tiroir) ---- */
  .nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: #0d0d0d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
    will-change: transform;
    padding-top: 60px; /* hauteur de la nav header */
  }

  .nav-drawer.is-open {
    transform: translateY(0);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  }

  /* ---- Items du menu ---- */
  .nav-drawer__list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .nav-drawer__item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .nav-drawer__item:last-of-type {
    border-bottom: none;
  }

  .nav-drawer__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    color: #cccccc;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.01em;
    min-height: 54px;
    transition: background 0.15s, color 0.15s, padding-left 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-drawer__link:hover,
  .nav-drawer__link:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding-left: 26px;
    outline: none;
  }

  .nav-drawer__link:active {
    background: rgba(255, 255, 255, 0.09);
  }

  /* Icône SVG inline dans chaque lien */
  .nav-drawer__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
  }

  .nav-drawer__link:hover .nav-drawer__icon,
  .nav-drawer__link:focus-visible .nav-drawer__icon {
    opacity: 0.9;
  }

  /* ---- Bouton CTA "Demander un devis" ---- */
  .nav-drawer__cta {
    margin: 14px 20px 20px;
  }

  .nav-drawer__cta a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f0a500;
    color: #1a0e00;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 14px 20px;
    border-radius: 8px;
    transition: background 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-drawer__cta a:hover {
    background: #ffb520;
  }

  .nav-drawer__cta a:active {
    transform: scale(0.98);
  }

  /* Animation d'entrée décalée pour les items */
  .nav-drawer.is-open .nav-drawer__item {
    animation: slideInItem 0.3s ease both;
  }

  .nav-drawer.is-open .nav-drawer__item:nth-child(1) { animation-delay: 0.04s; }
  .nav-drawer.is-open .nav-drawer__item:nth-child(2) { animation-delay: 0.08s; }
  .nav-drawer.is-open .nav-drawer__item:nth-child(3) { animation-delay: 0.12s; }
  .nav-drawer.is-open .nav-drawer__item:nth-child(4) { animation-delay: 0.16s; }

  .nav-drawer.is-open .nav-drawer__cta {
    animation: slideInItem 0.3s ease 0.2s both;
  }

  @keyframes slideInItem {
    from {
      opacity: 0;
      transform: translateX(-10px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  /* ---- Bloquer le scroll du body quand le menu est ouvert ---- */
  body.menu-open {
    overflow: hidden;
  }

}

/* Sur desktop : masquer le bouton hamburger et le drawer */
@media (min-width: 769px) {
  .nav-hamburger,
  .nav-drawer,
  .nav-overlay {
    display: none !important;
  }
}
