/* v163: finální mobilní oprava hlavičky, loga, menu a vnitřního scrollu */
@media (max-width: 980px) {
  html,
  body {
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    position: static !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: auto !important;
  }

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

  .site-header,
  body.subpage .site-header,
  body:not(.subpage) .site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 76px !important;
    min-height: 76px !important;
    max-height: 76px !important;
    z-index: 2147483000 !important;
    overflow: visible !important;
    background: rgba(3, 8, 18, 0.98) !important;
    border-bottom: 1px solid rgba(85, 124, 196, 0.22) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    transform: translateZ(0) !important;
  }

  .site-header .container,
  .header-inner,
  body.subpage .header-inner,
  body:not(.subpage) .header-inner {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    height: 76px !important;
    min-height: 76px !important;
    max-height: 76px !important;
    padding: 0 12px !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: visible !important;
  }

  .brand,
  body.subpage .brand,
  body:not(.subpage) .brand {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex: 0 0 162px !important;
    width: 162px !important;
    min-width: 162px !important;
    max-width: 162px !important;
    height: 52px !important;
    min-height: 52px !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
    text-decoration: none !important;
    background: url("duxnet-logo.svg") left center / contain no-repeat !important;
    z-index: 2147483002 !important;
  }

  .brand img,
  body.subpage .brand img,
  body:not(.subpage) .brand img {
    position: relative !important;
    display: block !important;
    width: 162px !important;
    max-width: 162px !important;
    height: auto !important;
    max-height: 52px !important;
    object-fit: contain !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 2 !important;
  }

  .brand::before {
    content: "DUXNET";
    display: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    color: #ff6a00;
    font-weight: 900;
    font-size: 1.45rem;
    line-height: 1;
    letter-spacing: 0.08em;
  }

  .brand.logo-broken::before {
    display: block !important;
  }

  .brand.logo-broken img {
    display: none !important;
  }

  .nav-toggle,
  body.subpage .nav-toggle,
  body:not(.subpage) .nav-toggle {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    margin-left: auto !important;
    z-index: 2147483003 !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }

  .main-nav,
  body.subpage .main-nav,
  body:not(.subpage) .main-nav {
    position: fixed !important;
    top: 86px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    z-index: 2147483001 !important;

    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 8px !important;

    max-height: calc(100dvh - 100px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;

    padding: 12px !important;
    margin: 0 !important;
    background: rgba(4, 9, 20, 0.985) !important;
    border: 1px solid rgba(255, 106, 0, 0.32) !important;
    border-radius: 14px !important;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.58) !important;
  }

  .main-nav.is-open,
  body.menu-open .main-nav,
  body.subpage .main-nav.is-open,
  body.subpage.menu-open .main-nav,
  body:not(.subpage) .main-nav.is-open,
  body:not(.subpage).menu-open .main-nav {
    display: flex !important;
  }

  .main-nav a,
  body.subpage .main-nav a,
  body:not(.subpage) .main-nav a {
    display: block !important;
    width: 100% !important;
    padding: 13px 14px !important;
    border-radius: 10px !important;
    color: #f4f7ff !important;
    background: rgba(255, 255, 255, 0.035) !important;
    text-decoration: none !important;
    white-space: normal !important;
  }

  .main-nav a::after,
  body.subpage .main-nav a::after,
  body:not(.subpage) .main-nav a::after {
    display: none !important;
  }

  body.subpage main,
  body.subpage main section,
  body.subpage main article,
  body.subpage .subpage-shell,
  body.subpage .subpage-shell > .container,
  body.subpage .sub-hero,
  body.subpage .sub-hero--photo,
  body.subpage .sub-hero--photo-left,
  body.subpage .sub-hero--clean,
  body.subpage .hero-no-gradient,
  body.subpage .sub-hero__main,
  body.subpage .sub-summary-under-hero,
  body.subpage .sub-hero__side,
  body.subpage .sub-side-card,
  body.subpage .sub-grid,
  body.subpage .sub-stack,
  body.subpage .sub-section,
  body.subpage .sub-section--accordion-wrap,
  body.subpage .sub-flow,
  body.subpage .sub-flow__grid,
  body.subpage .sub-flow__step,
  body.subpage .sub-related,
  body.subpage .sub-related__grid,
  body.subpage .sub-related__item,
  body.subpage .sub-accordion,
  body.subpage .sub-accordion-item,
  body.subpage .sub-accordion-content,
  body.subpage .sub-accordion-content p,
  body:not(.subpage) main,
  body:not(.subpage) .services,
  body:not(.subpage) .service-grid-expanded,
  body:not(.subpage) .service-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    touch-action: pan-y !important;
  }

  body.subpage .sub-hero-photo-bg,
  body.subpage .sub-accordion-media,
  body.subpage .sub-accordion-media img {
    pointer-events: none !important;
    touch-action: none !important;
  }

  body.subpage .sub-hero,
  body.subpage .sub-hero--photo,
  body.subpage .sub-hero--photo-left,
  body.subpage .sub-hero--clean,
  body.subpage .hero-no-gradient {
    min-height: auto !important;
  }

  body.menu-open {
    overflow-y: auto !important;
  }
}
