/* ============================================================
   SiteBug — header.css (Mega Menu)
   ============================================================ */

/* ---- Header ---- */
.sb-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(22,38,176,.06);
  transition: box-shadow .25s ease;
}
.sb-header.scrolled {
  box-shadow: 0 4px 32px rgba(22,38,176,.10);
}

/* ---- Conteneur nav ---- */
.sb-nav {
  display: flex;
  align-items: center;
  height: 68px;
  gap: 8px;
}

/* ---- Logo ---- */
.sb-nav__logo {
  flex-shrink: 0;
  margin-right: 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.sb-logo-text {
  font-size: 20px;
  font-weight: 800;
  color: #24244D;
  letter-spacing: -.03em;
  line-height: 1;
  white-space: nowrap;
}
.sb-logo-text span { color: #1626B0; }

/* ---- Collapse (liens + CTA) ---- */
.sb-nav__collapse {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 12px;
  min-width: 0;
}

/* ---- Liste de liens ---- */
.sb-nav__links {
  display: flex;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  gap: 2px;
  flex-wrap: nowrap;
  align-items: center;
}

/* ---- Lien nav standard ---- */
.sb-nav__link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: #3A3A70;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
  line-height: 1.3;
}
.sb-nav__link:hover {
  background: #F2F4FD;
  color: #1626B0;
}
.sb-nav__link--active {
  color: #1626B0;
  background: #EEF0FF;
}

/* ---- Trigger bouton (mega menu) ---- */
.sb-nav__trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.sb-trigger__chevron {
  flex-shrink: 0;
  transition: transform .2s ease;
  color: #8888B0;
}

/* ---- Bouton CTA ---- */
.sb-nav__cta {
  flex-shrink: 0;
  padding: 10px 22px;
  background: #1626B0;
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
  line-height: 1.3;
}
.sb-nav__cta:hover {
  background: #0F1C96;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22,38,176,.28);
}

/* ---- Burger ---- */
.sb-nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 9px;
  background: none;
  border: 1px solid #DDE2F5;
  border-radius: 8px;
  cursor: pointer;
  margin-left: auto;
}
.sb-nav__burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #24244D;
  border-radius: 2px;
  transition: opacity .2s;
}


/* ============================================================
   MEGA MENU
   ============================================================ */

/* L'item parent est position:relative pour ancrer le panel */
.sb-mega-parent {
  position: static; /* le panel se positionne sur .sb-header */
}

/* Panel mega menu */
.sb-mega {
  position: fixed;
  top: 68px; /* hauteur header */
  left: 0;
  width: 100%;
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(22,38,176,.08);
  box-shadow: 0 20px 60px rgba(22,38,176,.13);
  padding: 28px 0 32px;
  z-index: 999;
  /* État fermé */
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .22s ease, visibility .2s;
}

/* Grille interne : 4 colonnes pour Dépannage */
.sb-mega__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 36px;
  align-items: start;
}

/* Grille pour Création : featured + techno + autres */
.sb-mega__grid--creation {
  grid-template-columns: 220px 1fr 1fr;
  gap: 8px 48px;
}

/* ---- Heading colonne ---- */
.sb-mega__heading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #8888B0;
}
.sb-mega__heading svg,
.sb-mega__heading .bi {
  flex-shrink: 0;
  font-size: 12px;
  color: #AAAAD0;
}

/* ---- Liste de liens ---- */
.sb-mega__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sb-mega__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: #3A3A70;
  text-decoration: none;
  transition: background .13s ease, color .13s ease, padding-left .13s ease;
}
.sb-mega__link:hover {
  background: #F2F4FD;
  color: #1626B0;
  padding-left: 14px;
}
.sb-mega__link.is-active {
  color: #1626B0;
  background: #EEF0FF;
  font-weight: 600;
}

/* Icônes Bootstrap Icons dans les liens */
.sb-mega__link .bi {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: #AAAAD0;
  transition: color .13s ease, transform .13s ease;
}
.sb-mega__link:hover .bi,
.sb-mega__link.is-active .bi {
  color: #1626B0;
  transform: scale(1.12);
}

/* ---- Lien tech (avec logo) ---- */
.sb-mega__list--tech {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}
.sb-mega__link--tech {
  gap: 8px;
  padding: 8px 10px;
}
.sb-mega__link--tech img {
  flex-shrink: 0;
  border-radius: 3px;
  object-fit: contain;
}

/* ---- CTA card (col 4 de Dépannage) ---- */
.sb-mega__col--cta {
  display: flex;
  flex-direction: column;
}
.sb-mega__card {
  background: linear-gradient(135deg, #1626B0 0%, #2D3EC7 100%);
  border-radius: 14px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}
.sb-mega__card-icon {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb-mega__card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.sb-mega__card-text {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,.75);
  line-height: 1.5;
}
.sb-mega__card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 10px 18px;
  background: #fff;
  color: #1626B0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.sb-mega__card-btn:hover {
  background: #EEF0FF;
  transform: translateY(-1px);
}

/* ---- Featured (Création) ---- */
.sb-mega__featured-wrap {
  display: flex;
  flex-direction: column;
}
.sb-mega__featured {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, #1626B0 0%, #3B4FD8 100%);
  border-radius: 14px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
  margin-top: 4px;
  flex: 1;
}
.sb-mega__featured:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(22,38,176,.22);
}
.sb-mega__featured-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: rgba(255,255,255,.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sb-mega__featured-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.sb-mega__featured-sub {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,.7);
  margin-top: 3px;
}
.sb-mega__featured-arrow {
  margin-left: auto;
  flex-shrink: 0;
  color: rgba(255,255,255,.6);
  transition: transform .15s ease;
}
.sb-mega__featured:hover .sb-mega__featured-arrow {
  transform: translateX(3px);
}


/* ============================================================
   Affichage du mega : desktop hover / focus-within + JS
   ============================================================ */
@media (min-width: 992px) {
  .sb-mega-parent:hover .sb-mega,
  .sb-mega-parent:focus-within .sb-mega,
  .sb-mega-parent.is-open .sb-mega {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateY(0);
  }
  .sb-mega-parent:hover .sb-trigger__chevron,
  .sb-mega-parent:focus-within .sb-trigger__chevron,
  .sb-mega-parent.is-open .sb-trigger__chevron {
    transform: rotate(180deg);
    color: #1626B0;
  }
  .sb-mega-parent:hover > .sb-nav__trigger,
  .sb-mega-parent:focus-within > .sb-nav__trigger,
  .sb-mega-parent.is-open > .sb-nav__trigger {
    background: #F2F4FD;
    color: #1626B0;
  }
}


/* ============================================================
   RESPONSIVE — Mobile / Tablette
   ============================================================ */
@media (max-width: 991.98px) {
  .sb-nav {
    flex-wrap: wrap;
    height: auto;
    padding: 14px 0;
    align-items: center;
  }

  .sb-nav__burger {
    display: flex;
  }

  .sb-nav__collapse {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid #F2F4FD;
  }
  .sb-nav__collapse.is-open {
    display: flex;
  }

  .sb-nav__links {
    flex-direction: column;
    margin: 0;
    gap: 2px;
    align-items: stretch;
  }

  .sb-nav__link {
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 10px;
    justify-content: space-between;
  }

  .sb-nav__cta {
    text-align: center;
    margin-top: 4px;
    padding: 13px 20px;
    border-radius: 12px;
  }

  /* Mega menu mobile : panel en accordéon inline */
  .sb-mega {
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #F8F9FE;
    border-radius: 10px;
    padding: 10px 8px;
    margin: 2px 0 6px;
    display: none;
    transition: none;
  }
  .sb-mega-parent.is-open .sb-mega {
    display: block;
  }
  .sb-mega-parent.is-open .sb-trigger__chevron {
    transform: rotate(180deg);
    color: #1626B0;
  }

  .sb-mega__grid,
  .sb-mega__grid--creation {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .sb-mega__heading {
    padding: 0 6px;
  }

  .sb-mega__col--cta {
    display: none; /* masquer la carte CTA sur mobile */
  }

  .sb-mega__list--tech {
    grid-template-columns: 1fr 1fr;
  }

  .sb-mega__featured-wrap {
    gap: 8px;
  }
  .sb-mega__featured {
    padding: 14px;
  }
  .sb-mega__featured-icon {
    width: 38px;
    height: 38px;
  }
}

/* ── Dépannage Express — bouton header ──────────────────────────────────────── */
.sb-express-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  border: 1.5px solid transparent;
}

/* État ouvert : vert fluo */
.sb-express-btn--open {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}
.sb-express-btn--open:hover {
  background: #bbf7d0;
  color: #166534;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(34,197,94,.25);
}

/* État fermé / file pleine : orange discret */
.sb-express-btn--closed {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.sb-express-btn--closed:hover {
  background: #fde68a;
  color: #78350f;
  transform: translateY(-1px);
}

/* Point de statut animé */
.sb-express-btn__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sb-express-btn--open .sb-express-btn__dot {
  background: #22c55e;
  animation: er-pulse 2s infinite;
}
.sb-express-btn--closed .sb-express-btn__dot {
  background: #f59e0b;
}

/* Icône éclair */
.sb-express-btn__icon {
  display: inline-flex;
  align-items: center;
}
.sb-express-btn--open  .sb-express-btn__icon { color: #16a34a; }
.sb-express-btn--closed .sb-express-btn__icon { color: #d97706; }

@keyframes er-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
  50%       { opacity: .85; box-shadow: 0 0 0 4px rgba(34,197,94,.0); }
}

/* Mobile */
@media (max-width: 991.98px) {
  .sb-express-btn {
    text-align: center;
    justify-content: center;
    border-radius: 12px;
    padding: 13px 20px;
    margin-bottom: 6px;
    font-size: 14px;
  }
}
