/* =====================================================================
   INOVSYSTEM — OPTIMISATION CELLULAIRE
   Chargé APRÈS styles.css. Tout ce qui est ici ne s'applique qu'aux
   petits écrans (tablette / cellulaire), sauf le bouton menu caché.
   ===================================================================== */

/* Empêche tout défilement horizontal accidentel */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, iframe, canvas, svg { max-width: 100%; }
img, video { height: auto; }

/* Bouton « hamburger » : caché sur ordinateur */
.nav-burger { display: none; }

@media (max-width: 900px) {
  /* --- Barre du haut plus compacte --- */
  /* Le flou d'arrière-plan emprisonne le menu dans la barre : on le remplace par un fond plein */
  nav.top, nav.top.scrolled { padding: 12px 16px; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(5,10,28,.96); }
  .logo { font-size: 14px; gap: 10px; letter-spacing: 1px; }
  .logo .mark { width: 32px; height: 32px; font-size: 15px; }
  .logo i { display: none; }
  .nav-right { gap: 4px; }
  .nav-icon { padding: 10px; min-width: 44px; min-height: 44px; justify-content: center; }
  .admin-btn { padding: 8px 10px; }

  /* L'aperçu du panier au survol n'a pas de sens au doigt : on va direct au panier */
  .cart-preview { display: none !important; }

  /* --- Bouton hamburger --- */
  .nav-burger {
    position: relative; z-index: 81;
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px; margin-left: 4px;
    background: transparent; border: 1px solid rgba(201,169,97,.4); cursor: pointer;
  }
  .nav-burger span { display: block; height: 2px; background: var(--gold); transition: transform .3s, opacity .3s; }
  body.menu-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.menu-open .nav-burger span:nth-child(2) { opacity: 0; }
  body.menu-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* --- Menu en panneau plein écran --- */
  .nav-links {
    display: flex !important; flex-direction: column; gap: 0;
    position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 360px);
    padding: 84px 0 40px; margin: 0; overflow-y: auto; visibility: hidden;
    background: rgba(5,10,28,.98); border-left: 1px solid rgba(201,169,97,.25);
    transform: translateX(100%); transition: transform .35s ease; z-index: 79;
  }
  body.menu-open .nav-links { transform: translateX(0); visibility: visible; }
  .nav-links { transition: transform .35s ease, visibility .35s; }
  body.menu-open { overflow: hidden; }
  .nav-links > li { border-bottom: 1px solid rgba(201,169,97,.1); }
  .nav-links > li > a { padding: 16px 24px; font-size: 13px; padding-bottom: 16px; }
  .nav-links > li > a::after { display: none; }
  /* Sous-menus : toujours dépliés dans le panneau */
  .nav-links .sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    min-width: 0; padding: 0 0 10px; border: 0; background: transparent; backdrop-filter: none;
  }
  .nav-links .sub a { padding: 12px 24px 12px 40px; font-size: 12px; }
  .nav-links .sub a .arrow { opacity: 1; }
  .nav-links .sub-head { padding: 8px 24px 4px 40px; }
  .nav-links .sub-divider { margin: 6px 24px 6px 40px; }

  /* Voile derrière le menu */
  .nav-veil { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 78; opacity: 0; visibility: hidden; transition: opacity .3s; }
  body.menu-open .nav-veil { opacity: 1; visibility: visible; }

  /* --- Mise en page générale --- */
  section, .section { padding-left: 18px !important; padding-right: 18px !important; }
  .wrap, .container { padding-left: 0; padding-right: 0; max-width: 100%; }
  .sec-head { margin-bottom: 48px; }
  .domain { gap: 36px; }

  [style*="display:flex"], [style*="display: flex"] { flex-wrap: wrap; }

  /* Tableaux : défilent dans leur cadre au lieu d'élargir la page */
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Formulaires : 16 px minimum pour éviter le zoom automatique d'iPhone */
  input, select, textarea { font-size: 16px !important; max-width: 100%; }

  /* Pied de page empilé et centré */
  footer { padding: 48px 18px 30px; }
  footer .wrap { flex-direction: column; align-items: center; text-align: center; gap: 10px; letter-spacing: 1px; }

  /* Retour en haut : un peu plus petit, ne cache pas le contenu */
  .to-top { right: 14px !important; bottom: 14px !important; }
}

@media (max-width: 560px) {
  /* Grilles à colonnes fixes déclarées en ligne (style="grid-template-columns:…") */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .sec-head h2 { font-size: clamp(28px, 8vw, 40px); }
  .sec-tag { letter-spacing: 2px; }
  .sec-tag::before { width: 28px; }
  .btn { padding: 14px 18px; letter-spacing: 1.5px; }
}
