
/* v51p – oprava mizícího rozbalovacího menu.
   Problém byl v mezeře mezi položkou menu a panelem dropdownu.
   Řešení: menší mezera + neviditelný hover most + krátká tolerance.
*/

/* Desktop dropdown stabilita */
@media (min-width: 921px){
  html body .site-header .nav-dropdown{
    position:relative!important;
  }

  /* neviditelný most mezi položkou a rozbalovacím panelem */
  html body .site-header .nav-dropdown::after{
    content:""!important;
    position:absolute!important;
    left:-18px!important;
    right:-18px!important;
    top:100%!important;
    height:24px!important;
    display:block!important;
    background:transparent!important;
    z-index:4999!important;
    pointer-events:auto!important;
  }

  html body .site-header .mega-menu{
    top:calc(100% + 6px)!important;
    z-index:5000!important;
    pointer-events:auto!important;
    transition:
      opacity .16s ease,
      visibility .16s ease,
      transform .16s ease!important;
    transition-delay:.06s!important;
  }

  html body .site-header .nav-dropdown:hover .mega-menu,
  html body .site-header .nav-dropdown:focus-within .mega-menu{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    transition-delay:0s!important;
  }

  /* Když je kurzor už v panelu, nesmí zmizet */
  html body .site-header .mega-menu:hover{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }

  /* Panel necháme blíž k položce, ale pořád elegantně odsazený */
  html body .site-header .nav-dropdown:hover .mega-menu,
  html body .site-header .nav-dropdown:focus-within .mega-menu{
    transform:translateX(-50%) translateY(0)!important;
  }
}

/* Menší dropdowny také stabilně */
@media (min-width: 921px){
  html body .site-header .mega-menu--small{
    top:calc(100% + 6px)!important;
  }
}

/* Mobil ponechat bez hover mostu, tam se dropdown řeší klikem/dotykem */
@media (max-width: 920px){
  html body .site-header .nav-dropdown::after{
    display:none!important;
  }
}
