/* nbcurtains v11 — mobile header/category/hero alignment hotfix */
@media (max-width:760px){
  html body:not(.admin-body){overflow-x:hidden!important}

  /* Keep the utility strip in normal document flow. */
  html body:not(.admin-body) .nb-top-strip{
    position:relative!important;
    top:auto!important;
    z-index:62!important;
    width:100%!important;
  }
  html body:not(.admin-body) .nb-top-strip-inner{
    min-height:30px!important;
    padding:3px 10px!important;
  }

  /* Header is a clean, self-contained 62px row on mobile. */
  html body:not(.admin-body) header.topbar.modern-topbar.nb-topbar{
    position:relative!important;
    top:auto!important;
    left:auto!important;
    right:auto!important;
    z-index:60!important;
    width:100%!important;
    height:62px!important;
    min-height:62px!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }
  html body:not(.admin-body) header.nb-topbar .nb-nav-shell{
    width:100%!important;
    max-width:none!important;
    height:62px!important;
    min-height:62px!important;
    margin:0!important;
    padding:0 12px!important;
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr) 42px!important;
    align-items:center!important;
    gap:8px!important;
    overflow:visible!important;
  }
  html body:not(.admin-body) header.nb-topbar .header-menu-btn{
    position:static!important;
    inset:auto!important;
    justify-self:start!important;
    align-self:center!important;
    width:38px!important;
    height:38px!important;
    margin:0!important;
    transform:none!important;
  }
  html body:not(.admin-body) header.nb-topbar .header-brand.nb-brand{
    position:static!important;
    inset:auto!important;
    justify-self:center!important;
    align-self:center!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:min(100%,220px)!important;
    max-width:220px!important;
    min-width:0!important;
    height:52px!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    overflow:visible!important;
  }
  html body:not(.admin-body) header.nb-topbar .header-brand .nb-logo,
  html body:not(.admin-body) header.nb-topbar .nb-brand .nb-logo{
    display:block!important;
    width:auto!important;
    max-width:100%!important;
    height:43px!important;
    max-height:43px!important;
    margin:0 auto!important;
    object-fit:contain!important;
    object-position:center!important;
    transform:none!important;
    border-radius:12px!important;
  }
  html body:not(.admin-body) header.nb-topbar .nb-header-actions{
    position:static!important;
    inset:auto!important;
    justify-self:end!important;
    align-self:center!important;
    width:40px!important;
    height:40px!important;
    margin:0!important;
    transform:none!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
  }
  html body:not(.admin-body) header.nb-topbar .nb-account-chip{
    position:static!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    margin:0!important;
    transform:none!important;
  }

  /* Category navigation belongs directly below the main header, never over it. */
  html body:not(.admin-body) nav.category-subnav{
    position:relative!important;
    top:auto!important;
    left:auto!important;
    right:auto!important;
    z-index:50!important;
    width:100%!important;
    margin:0!important;
    transform:none!important;
  }
  html body:not(.admin-body) nav.category-subnav .category-subnav-inner{
    width:100%!important;
    max-width:none!important;
    min-height:42px!important;
    height:42px!important;
    margin:0!important;
    padding:0 10px!important;
    gap:14px!important;
    align-items:center!important;
  }
  html body:not(.admin-body) nav.category-subnav .category-subnav-link{
    min-height:42px!important;
    height:42px!important;
    padding:0 3px!important;
    line-height:1!important;
    display:inline-flex!important;
    align-items:center!important;
    gap:5px!important;
    white-space:nowrap!important;
  }

  /* Hero begins immediately after category nav; remove inherited offsets. */
  html body.tpl-home:not(.admin-body) main.main-wide{
    padding-top:0!important;
    margin-top:0!important;
  }
  html body.tpl-home:not(.admin-body) main.main-wide > .km-hero-slider,
  html body.tpl-home:not(.admin-body) .km-hero-slider.nb-hero-slider{
    position:relative!important;
    top:auto!important;
    margin-top:0!important;
    transform:none!important;
    width:100vw!important;
    max-width:100vw!important;
    margin-left:calc(50% - 50vw)!important;
    margin-right:calc(50% - 50vw)!important;
    border-radius:0 0 20px 20px!important;
    overflow:hidden!important;
  }

  /* Prevent legacy fixed/sticky offsets from reappearing after scrolling. */
  html body:not(.admin-body) .category-subnav.is-sticky,
  html body:not(.admin-body) .nb-topbar.is-sticky{
    top:auto!important;
  }
}

@media (max-width:390px){
  html body:not(.admin-body) header.nb-topbar .header-brand.nb-brand{max-width:190px!important}
  html body:not(.admin-body) header.nb-topbar .header-brand .nb-logo,
  html body:not(.admin-body) header.nb-topbar .nb-brand .nb-logo{height:39px!important;max-height:39px!important}
  html body:not(.admin-body) nav.category-subnav .category-subnav-inner{gap:11px!important}
  html body:not(.admin-body) nav.category-subnav .category-subnav-link{font-size:9px!important}
}
