/* =========================================
   STYLE MOBILE & TABLETTE (Max 768px)
   ========================================= */

@media (max-width: 768px) {

  /* --- 1. GLOBAUX --- */
  .container-layout {
    width: 90%;
    padding: 0;
  }

  h1 {
    font-size: 28px;
  }

  section.section {
    padding: 30px 20px;
  }

  div.footer-container {
    padding: 40px 20px 0 20px;
  }

  /* --- 2. HEADER & MENU --- */

  header .container-layout {
    /* On reste en static pour que le menu se cale sur le header global */
    position: static;
    flex-wrap: wrap;
  }

  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-dark-color);
    cursor: pointer;
    padding: 10px;
    margin-left: auto;
  }

  /* LE MENU DÉROULANT */
  .main-nav {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;

    /* Z-Index élevé pour passer au-dessus de l'overlay */
    z-index: 1100;

    background: var(--background-light-color);
    /* FOND BLANC/CLAIR */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);

    /* Animation fluide */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    border-top: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .main-nav.active {
    max-height: 500px;
    opacity: 1;
    border-top-color: var(--border-color);
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0;
  }

  .main-nav a {
    display: block;
    padding: 15px 20px;
    width: 100%;
    border-bottom: 1px solid var(--secondary-color);
    text-align: center;
    background: var(--background-light-color);
  }

  /* L'OVERLAY SOMBRE (NOUVEAU) */
  .menu-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    /* Le fond assombri */

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
  }

  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* --- 3. FIX PAGE PACKAGES --- */
  div.container {
    display: flex !important;
    flex-direction: column;
    gap: 15px;
    padding: 20px !important;
  }

  div.container>div,
  div.container input[type="text"],
  div.container select {
    width: 100% !important;
    max-width: none !important;
    margin-top: 5px;
  }

  div.container label.inline {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 10px;
    width: 100%;
  }

  label.second {
    margin-left: 0 !important;
  }

  /* --- 4. DOCUMENTATION --- */
  .doc-layout {
    grid-template-columns: 1fr;
    margin: 1rem auto;
    width: 95%;
  }

  #doc-menu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    text-align: left;
  }

  #doc-sidebar {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    min-height: 100vh;
    z-index: 1200;
    border-right: 1px solid var(--border-color);
    background: var(--background-light-color);
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  }

  #doc-sidebar.active {
    transform: translateX(0);
  }

  #doc-close-btn {
    display: block;
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #888;
    padding: 5px 10px;
    cursor: pointer;
    z-index: 1001;
  }

  #doc-sidebar h3:first-of-type {
    margin-right: 30px;
    margin-top: 20px;
  }

  .doc-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
  }

  .doc-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* --- 5. AUTRES --- */
  #doc-content pre {
    max-width: 100vw;
  }

  .roadmap::before {
    left: 19px;
    top: 30px;
  }

  .step {
    padding-left: 50px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 16px;
    left: 2px;
    top: 18px;
  }

  .step-content:hover::before {
    display: none;
  }

  /* No-Hover Touch */
  a:hover, button:hover {
    transform: none !important;
    box-shadow: none !important;
    background-color: initial !important;
  }

  nav a:hover {
    border-bottom: 1px solid var(--secondary-color) !important;
    background: #f9f9f9 !important;
    /* Léger feedback visuel */
  }

  button.primary:hover {
    background: var(--primary-dark-color) !important;
    color: var(--text-light-color) !important;
  }
}

/* --- ORDI --- */
@media (min-width: 769px) {
  #doc-close-btn, .mobile-menu-toggle, #doc-menu-toggle {
    display: none !important;
  }
}