/* Final responsive recheck layer
   - mobile header follows the client reference layout
   - preserves BNB Tech Pro branding/colors/content
   - readability + overflow fixes across 320px -> large desktop
*/

html{max-width:100%;overflow-x:hidden}
body{max-width:100%;overflow-x:clip}
img,svg,video,canvas{max-width:100%}
main,.container,.growth-hero-grid,.service-duo,.why-combo-grid,.process-track,.choose-layout,.faq-grid,.blog-hero-inner,.blog-grid,.article-layout,.article-hero-grid,.page-hero-grid,.contact-layout{min-width:0}

/* Keep desktop header polished and stable. */
@media (min-width:761px){
  .client-mobile-nav{display:none!important}
  .client-nav-shell .brand{transition:transform .22s ease,box-shadow .22s ease}
  .client-nav-shell .brand:hover{transform:translateY(-1px)}
}

/* CLIENT-REFERENCE MOBILE HEADER */
@media (max-width:760px){
  .client-header.site-header{
    height:auto!important;
    padding:10px 0 8px!important;
    background:#f4f8ff!important;
    border:0!important;
    box-shadow:none!important;
    backdrop-filter:none!important;
  }
  .client-header .container{width:calc(100% - 24px)!important}
  .client-nav-shell.nav-row{
    position:relative;
    width:100%!important;
    height:64px!important;
    min-height:64px!important;
    padding:0 10px 0 14px!important;
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
    border-radius:19px!important;
    background:linear-gradient(112deg,#052955 0%,#073b7c 58%,#0757bd 100%)!important;
    border:1px solid rgba(255,255,255,.15)!important;
    box-shadow:0 12px 28px rgba(4,42,91,.18)!important;
    overflow:visible!important;
  }
  .client-nav-shell .brand{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:auto!important;
    min-width:0!important;
    margin:0!important;
    padding:0 3px!important;
    background:transparent!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
  }
  .client-nav-shell .brand img{
    display:block!important;
    width:136px!important;
    max-width:46vw!important;
    height:auto!important;
    filter:brightness(0) invert(1)!important;
    object-fit:contain!important;
  }
  .client-nav-shell .main-nav,
  .client-nav-shell .nav-actions,
  .client-nav-shell .login-btn,
  .client-nav-shell .search-btn{display:none!important}
  .client-nav-shell .menu-toggle{
    display:flex!important;
    flex:0 0 44px!important;
    width:44px!important;
    height:44px!important;
    margin-left:auto!important;
    padding:0!important;
    border-radius:50%!important;
    border:1px solid rgba(255,255,255,.42)!important;
    background:rgba(255,255,255,.08)!important;
    align-items:center!important;
    justify-content:center!important;
    flex-direction:column!important;
    gap:4px!important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.03)!important;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
  }
  .client-nav-shell .menu-toggle span{
    display:block!important;
    width:17px!important;
    height:1.7px!important;
    margin:0!important;
    border-radius:20px!important;
    background:#fff!important;
    transform-origin:center;
    transition:transform .22s ease,opacity .18s ease,width .18s ease;
  }
  .client-nav-shell .menu-toggle[aria-expanded="true"] span:nth-child(1){transform:translateY(5.7px) rotate(45deg)}
  .client-nav-shell .menu-toggle[aria-expanded="true"] span:nth-child(2){opacity:0;width:0!important}
  .client-nav-shell .menu-toggle[aria-expanded="true"] span:nth-child(3){transform:translateY(-5.7px) rotate(-45deg)}

  /* Keep the panel mounted so open/close can animate naturally. */
  .client-mobile-nav,
  body:not(.blog-page) .client-mobile-nav{
    display:grid!important;
    position:fixed!important;
    z-index:89!important;
    top:88px!important;
    left:max(16px,env(safe-area-inset-left))!important;
    right:max(16px,env(safe-area-inset-right))!important;
    width:auto!important;
    max-height:calc(100dvh - 106px)!important;
    overflow:auto!important;
    gap:4px!important;
    padding:18px 16px 16px!important;
    border-radius:18px!important;
    border:1px solid rgba(255,255,255,.13)!important;
    background:linear-gradient(155deg,#062b5e 0%,#073a79 58%,#08326b 100%)!important;
    color:#fff!important;
    box-shadow:0 26px 62px rgba(2,26,61,.31)!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transform:translateY(-10px) scale(.985)!important;
    transform-origin:top center!important;
    transition:opacity .2s ease,transform .22s ease,visibility .2s!important;
    overscroll-behavior:contain;
  }
  .client-mobile-nav.open,
  body:not(.blog-page) .client-mobile-nav.open{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    transform:translateY(0) scale(1)!important;
  }
  .client-mobile-nav>a,
  .client-mobile-nav summary{
    min-height:50px!important;
    padding:0 14px!important;
    border-radius:12px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:14px!important;
    color:#fff!important;
    font-size:15px!important;
    line-height:1.2!important;
    font-weight:650!important;
    letter-spacing:-.01em!important;
    border:0!important;
    background:transparent!important;
    text-decoration:none!important;
    list-style:none!important;
    -webkit-tap-highlight-color:transparent;
  }
  .client-mobile-nav>a:active,
  .client-mobile-nav summary:active{background:rgba(255,255,255,.09)!important}
  .client-mobile-nav details{min-width:0!important}
  .client-mobile-nav details summary::-webkit-details-marker{display:none}
  .client-mobile-nav details[open] summary{background:rgba(255,255,255,.075)!important}
  .client-mobile-nav details>div{
    display:grid!important;
    gap:2px!important;
    padding:3px 5px 8px 15px!important;
  }
  .client-mobile-nav details a{
    min-height:40px!important;
    display:flex!important;
    align-items:center!important;
    padding:0 12px!important;
    border-radius:10px!important;
    color:#d8eaff!important;
    font-size:12.5px!important;
    line-height:1.35!important;
    font-weight:550!important;
  }
  .client-mobile-nav .mobile-login{
    min-height:48px!important;
    margin-top:13px!important;
    padding:0 18px!important;
    justify-content:center!important;
    gap:14px!important;
    border-radius:999px!important;
    background:#fff!important;
    color:#0b4b9a!important;
    font-size:14px!important;
    font-weight:750!important;
    box-shadow:0 10px 24px rgba(1,22,54,.16)!important;
  }
  body.mobile-nav-open{overflow:hidden!important}

  /* Better general mobile density. */
  .section-space{padding-top:42px!important;padding-bottom:42px!important}
  .center-heading{margin-bottom:24px!important}
  .center-heading h2,.why-copy h2{line-height:1.12!important}
  .center-heading p,.why-copy>p{max-width:640px!important}

  /* Client explicitly said process/growth text was too small. */
  .process-track{padding-top:19px!important;padding-bottom:19px!important}
  .process-step b{font-size:13.5px!important;line-height:1.35!important}
  .process-step p{font-size:12px!important;line-height:1.55!important;color:#52657c!important}
  .growth-benefits-grid h3{font-size:13px!important;line-height:1.35!important}
  .growth-benefits-grid p{font-size:11.25px!important;line-height:1.52!important;color:#5f7187!important}

  /* Editorial cards: ensure content never gets squeezed by fixed media widths. */
  .editorial-post.home-post,.blog-card,.cover-item,.mv-card,.form-card,.info-panel{min-width:0!important}
  .editorial-body{min-width:0!important}
  .editorial-post h3,.blog-card h3{overflow-wrap:anywhere}

  /* Footer: comfortable tap/read sizes, no tiny desktop columns on mobile. */
  .client-footer .footer-col h3{font-size:12px!important}
  .client-footer .footer-col>a,.client-footer .footer-col>span{font-size:12px!important;line-height:1.55!important;min-height:31px}
}

@media (max-width:520px){
  .client-header .container{width:calc(100% - 20px)!important}
  .client-nav-shell.nav-row{height:62px!important;min-height:62px!important;border-radius:17px!important;padding-left:12px!important}
  .client-nav-shell .brand img{width:128px!important;max-width:48vw!important}
  .client-nav-shell .menu-toggle{width:42px!important;height:42px!important;flex-basis:42px!important}
  .client-mobile-nav,
  body:not(.blog-page) .client-mobile-nav{top:84px!important;left:12px!important;right:12px!important;padding:17px 14px 15px!important}
  .client-mobile-nav>a,.client-mobile-nav summary{font-size:14.5px!important;min-height:49px!important}

  /* Home two-column micro cards become readable without huge vertical expansion. */
  .benefit-four{grid-template-columns:1fr!important}
  .benefit-four strong{font-size:12.5px!important}
  .benefit-four p{font-size:11px!important;line-height:1.5!important}
  .benefit-four>div{padding:12px!important}

  .editorial-post.home-post{display:block!important;min-height:0!important}
  .editorial-post .editorial-media{height:auto!important;aspect-ratio:16/9!important}
  .editorial-post .editorial-media img{width:100%!important;height:100%!important;aspect-ratio:auto!important;object-fit:cover!important}
  .editorial-body{padding:15px!important}
  .editorial-post h3{font-size:15px!important;line-height:1.35!important}
  .editorial-post p{font-size:12px!important;line-height:1.55!important;display:block!important;overflow:visible!important}
  .editorial-meta{font-size:9.5px!important}
  .editorial-footer{font-size:9.5px!important}

  /* Blog page rows use one-column cards on phones. */
  .blog-grid{grid-template-columns:1fr!important}
  .related-posts .blog-grid{grid-template-columns:1fr!important}
  .blog-card-media{height:auto!important;aspect-ratio:16/9!important}
  .blog-card-media img{width:100%!important;height:100%!important;object-fit:cover!important}

  .client-detail-hero h1,.article-hero h1{font-size:clamp(29px,9vw,34px)!important;line-height:1.12!important}
  .article-body{font-size:15.5px!important;line-height:1.82!important}
  .article-body h2{font-size:23px!important;line-height:1.28!important}
  .article-body h3{font-size:19px!important;line-height:1.35!important}
  .toc-mobile-toggle{min-height:44px!important;font-size:13px!important}
}

@media (max-width:420px){
  .container{width:calc(100% - 22px)!important}
  .client-header .container{width:calc(100% - 18px)!important}
  .client-nav-shell.nav-row{height:60px!important;min-height:60px!important;padding:0 8px 0 11px!important}
  .client-nav-shell .brand img{width:120px!important}
  .client-nav-shell .menu-toggle{width:40px!important;height:40px!important;flex-basis:40px!important}
  .client-mobile-nav,
  body:not(.blog-page) .client-mobile-nav{top:81px!important;left:10px!important;right:10px!important;border-radius:16px!important}

  /* At narrow phone widths 2-column growth cards force the client-requested copy too small. */
  .growth-benefits-grid{grid-template-columns:1fr!important}
  .growth-benefits-grid article{min-height:0!important;padding:16px 16px!important;border-bottom:1px solid #e6edf5!important}
  .growth-benefits-grid article:last-child{border-bottom:0!important}
  .growth-benefits-grid article:after{display:none!important}
  .growth-benefits-grid article>span{width:40px!important;height:40px!important;margin-bottom:8px!important}
  .growth-benefits-grid h3{font-size:13.5px!important}
  .growth-benefits-grid p{font-size:11.75px!important;max-width:270px!important}

  .service-list.two-col{grid-template-columns:1fr!important}
  .service-list span{font-size:12px!important}
  .growth-hero-actions{grid-template-columns:1fr!important}
  .motion-btn{min-height:46px!important}
  .hero-trust-line{grid-template-columns:1fr!important}
  .hero-trust-line span{font-size:10px!important;text-overflow:clip!important}

  .blog-stats-grid{grid-template-columns:1fr 1fr!important;gap:8px!important}
  .blog-stat{min-width:0!important}
  .blog-stat strong{font-size:23px!important}
  .blog-stat small{font-size:9px!important}

  .popular-tools{grid-template-columns:1fr!important}
  .compact-search,.popular-tools select{width:100%!important;min-width:0!important}

  .client-footer-grid.footer-grid{grid-template-columns:1fr!important}
  .client-footer .footer-about,.client-footer .footer-contact{grid-column:auto!important}
}

@media (max-width:340px){
  .client-nav-shell .brand img{width:112px!important}
  .client-mobile-nav>a,.client-mobile-nav summary{font-size:14px!important;padding-left:12px!important;padding-right:12px!important}
  .growth-hero-copy h1{font-size:28px!important}
  .growth-hero-copy>p{font-size:13px!important}
  .blog-stats-grid{grid-template-columns:1fr!important}
  .blog-stat{display:flex!important;text-align:left!important}
  .blog-stat-icon{margin:0!important}
}

/* Tablets: prevent in-between widths from feeling like scaled desktop. */
@media (min-width:761px) and (max-width:1024px){
  .container{width:min(100% - 42px,1180px)!important}
  .client-nav-shell.nav-row{grid-template-columns:165px 1fr 150px!important;padding-left:11px!important;padding-right:11px!important}
  .client-nav-shell .brand img{width:118px!important}
  .client-nav-shell .main-nav{gap:20px!important}
  .client-nav-shell .main-nav>a,.client-nav-shell .nav-dropdown-btn{font-size:12.5px!important}
  .client-nav-shell .login-btn{min-width:82px!important;padding:0 14px!important}
  .growth-hero-grid{gap:28px!important}
  .service-duo,.why-combo-grid,.faq-grid{gap:28px!important}
}

@media (prefers-reduced-motion:reduce){
  .client-mobile-nav,.client-nav-shell .menu-toggle span{transition:none!important}
}
