
/* ============================================================
   TEKNIS V50
   Correctifs iOS / mobile uniquement.
   Aucun changement de thème, couleurs, fonds ou design du header.
   ============================================================ */

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

@supports (-webkit-touch-callout:none){
  html,body{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }

  /* Safari iOS zoome automatiquement lorsque la police d'un champ < 16px */
  input,select,textarea{
    font-size:16px!important;
  }

  a,button,input,select,textarea,label{
    touch-action:manipulation;
  }

  /* Menu mobile scrollable au doigt sans modifier son apparence */
  #header .menu,
  #header nav .menu,
  .mobile-menu,
  .nav-menu{
    max-height:calc(100dvh - env(safe-area-inset-top) - 78px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:contain!important;
    padding-bottom:calc(36px + env(safe-area-inset-bottom))!important;
  }

  /* Evite les débordements des médias dans Safari */
  img,video,svg,canvas{
    max-width:100%;
  }

  .catalogue-page .cat2026-nav .wrap{
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none;
    touch-action:pan-x!important;
  }
  .catalogue-page .cat2026-nav .wrap::-webkit-scrollbar{display:none}

  .catalogue-page img,
  .landing-page img{
    max-width:100%!important;
    height:auto!important;
  }

  /* Conserver les deux configurateurs accessibles sur petits écrans */
  .hero-config-launchers,
  .hero-config-grid,
  .hero-configs,
  .hero-tools,
  .configurator-cards,
  .hero-cards{
    overflow:visible!important;
  }

  .cookie-banner,
  #cookieBanner{
    bottom:max(12px,env(safe-area-inset-bottom))!important;
  }
}

/* Mobile/tablette : comportement seulement, sans toucher aux couleurs */
@media(max-width:1024px){
  #header,
  #header .wrap,
  #header .nav{
    overflow:visible!important;
  }

  #header .menu{
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:contain!important;
    touch-action:pan-y!important;
    max-height:calc(100dvh - 86px)!important;
    padding-bottom:max(42px,env(safe-area-inset-bottom))!important;
  }

  #header .menu>li{
    flex:0 0 auto!important;
    overflow:visible!important;
  }

  /* Sous-menus ouverts au tap sur iOS, sans imposer de nouvelle couleur */
  #header .menu-item-has-mega>.mega-menu,
  #header .menu-item-has-children>.sub-menu{
    position:static!important;
    inset:auto!important;
    width:100%!important;
    max-width:100%!important;
    max-height:none!important;
    overflow:visible!important;
    transform:none!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    display:none!important;
    box-shadow:none!important;
  }

  #header .menu-item-has-mega.v50-open>.mega-menu,
  #header .menu-item-has-children.v50-open>.sub-menu{
    display:block!important;
  }

  #header .mega-menu .mega-col{
    overflow:visible!important;
    max-height:none!important;
  }

  #header .mega-menu a,
  #header .sub-menu a{
    min-height:44px;
    touch-action:manipulation!important;
  }

  /* Catalogue */
  .catalogue-page .cat2026-nav .wrap{
    display:flex!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  .catalogue-page .cat-chip{
    flex:0 0 auto!important;
  }

  .catalogue-page .cat-grid-2026{
    grid-template-columns:1fr!important;
  }

  .landing-page .lp2026-grid,
  .landing-page .lp2026-gallery,
  .landing-page .lp2026-gallery.two{
    grid-template-columns:1fr!important;
  }
}
