/* =========================================================
   Simple CRM 2026 — HOTFIX MENU MOBILE / STICKY
   Version corrigée : pas de menu poussé vers le bas
   ========================================================= */


/* ---------------------------------------------------------
   1. Desktop : masquer la topbar quand la page est scrollée
   --------------------------------------------------------- */

@media screen and (min-width: 1024px) {
  body.scrm-mega-nav-sticky header.scrm-header-2026 .topbar,
  html.scrm-has-scrolled header.scrm-header-2026 .topbar,
  header.scrm-header-2026:has(.scrm-mega-nav.is-sticky) .topbar {
    display: none !important;
  }
}


/* ---------------------------------------------------------
   2. Mobile : header toujours blanc et compact
   --------------------------------------------------------- */

@media screen and (max-width: 1023px) {
  header.scrm-header-2026,
  body:not(.scrm-mega-nav-sticky) > header.scrm-header-2026,
  body.scrm-mega-nav-sticky > header.scrm-header-2026 {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #fff !important;
    background-color: #fff !important;
    box-shadow: 0 4px 24px rgba(9, 19, 55, 0.10) !important;
    z-index: 1040 !important;
  }

  header.scrm-header-2026 .topbar {
    display: none !important;
  }

  header.scrm-header-2026 .scrm-mega-nav,
  header.scrm-header-2026 .scrm-mega-bar {
    background: #fff !important;
    background-color: #fff !important;
  }

  body {
    padding-top: 72px !important;
  }
}


/* ---------------------------------------------------------
   3. Mobile : drawer ouvert en haut, pas en bas
   --------------------------------------------------------- */

@media screen and (max-width: 1023px) {
  header.scrm-header-2026 .scrm-mega-drawer {
    background: #fff !important;
    background-color: #fff !important;
  }

  header.scrm-header-2026 .scrm-mega-drawer.is-open {
    position: fixed !important;
    top: 72px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;

    width: 100% !important;
    height: auto !important;
    max-height: none !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;

    /* Correction critique : empêche les entrées CRM/Solutions/etc. d'être poussées en bas */
    justify-content: flex-start !important;

    gap: 0 !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    padding: 12px 16px calc(28px + env(safe-area-inset-bottom, 0px)) !important;

    background: #fff !important;
    background-color: #fff !important;
    border-top: 1px solid #e8ecf2 !important;
    box-shadow: 0 8px 26px rgba(9, 19, 55, 0.12) !important;
    z-index: 1039 !important;
  }

  header.scrm-header-2026 .scrm-mega-top {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  header.scrm-header-2026 .scrm-mega-item {
    width: 100% !important;
    flex: 0 0 auto !important;
  }

  header.scrm-header-2026 .scrm-mega-toplink {
    width: 100% !important;
    justify-content: space-between !important;
  }

  header.scrm-header-2026 .scrm-mega-panel {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    height: auto !important;

    overflow: visible !important;

    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;

    transform: none !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;

    display: none !important;
    padding: 0 0 12px 12px !important;
    margin: 0 !important;
  }

  header.scrm-header-2026 .scrm-mega-item.has-panel.is-open > .scrm-mega-panel,
  header.scrm-header-2026 .scrm-mega-item.has-panel.is-panel-open > .scrm-mega-panel {
    display: block !important;
  }

  header.scrm-header-2026 .scrm-mega-layout,
  header.scrm-header-2026 .scrm-mega-cols,
  header.scrm-header-2026 .scrm-mega-cols--flow,
  header.scrm-header-2026 .scrm-mega-aside-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 12px !important;
  }

  header.scrm-header-2026 .scrm-mega-layout-feature,
  header.scrm-header-2026 .scrm-mega-layout-aside,
  header.scrm-header-2026 .scrm-mega-col {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
  }

  header.scrm-header-2026 .scrm-mega-share {
    flex: 0 0 auto !important;
    align-self: flex-end !important;
    margin-top: 12px !important;
  }
}


/* ---------------------------------------------------------
   4. Desktop : ne pas perturber le menu normal
   --------------------------------------------------------- */

@media screen and (min-width: 1024px) {
  header.scrm-header-2026 .scrm-mega-drawer {
    position: static !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    justify-content: flex-end !important;
  }
}

/* Fix texte CTA diagnostic */
header.scrm-header-2026 .scrm-mega-cta .text-long {
  display: inline !important;
}

header.scrm-header-2026 .scrm-mega-cta .text-short {
  display: none !important;
}

@media screen and (max-width: 1199px) {
  header.scrm-header-2026 .scrm-mega-cta .text-long {
    display: none !important;
  }

  header.scrm-header-2026 .scrm-mega-cta .text-short {
    display: inline !important;
  }
}