/*
 * Techiconix v3.5.1 responsive QA fixes
 * Loaded last to resolve cross-file breakpoint cascade conflicts safely.
 */

/* General resilience */
html,body{max-width:100%;overflow-x:hidden;overflow-x:clip}
img,video,iframe,embed,object{max-width:100%}
.prose,.article-content,.search-result,.tx-price-card,.footer-links,.footer-brand{min-width:0}
.prose a,.article-content a,.footer-addresses,.mobile-contact-card a{overflow-wrap:anywhere}
.prose table,.article-content table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.tx-form textarea{resize:vertical}

/* Consistent accessible keyboard focus without changing mouse/touch presentation. */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:3px solid color-mix(in srgb,var(--brand,#01b4ae) 55%,white);
  outline-offset:3px;
}

/* Keep floating controls away from notches/safe areas. */
.tx-floating-ui{right:max(15px,env(safe-area-inset-right));bottom:max(15px,env(safe-area-inset-bottom))}
body.tx-consent-visible .tx-floating-ui{opacity:0;visibility:hidden;pointer-events:none;transform:translateY(10px)}

@media(max-width:980px){
  /* Critical header fix: the later 1180px desktop/tablet rule used three columns
     on phones. Force the mobile header to exactly logo + menu button. */
  .site-header .header-shell{
    width:100%!important;
    max-width:none!important;
    padding-left:max(16px,env(safe-area-inset-left))!important;
    padding-right:max(16px,env(safe-area-inset-right))!important;
    margin:0!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:12px!important;
  }
  .site-header .brand-wrap{min-width:0!important;max-width:100%!important}
  .site-header .site-logo-link{max-width:calc(100vw - 92px)!important;min-width:0!important}
  .site-header .site-logo-image{max-width:100%!important;height:auto!important}
  .site-header .header-actions{
    display:flex!important;
    justify-self:end!important;
    justify-content:flex-end!important;
    margin-left:auto!important;
    width:auto!important;
    min-width:46px!important;
  }
  .site-header .mobile-toggle{
    display:inline-flex!important;
    flex:0 0 46px!important;
    width:46px!important;
    height:46px!important;
    margin:0!important;
  }

  /* Drawer must always match the viewport, regardless of desktop menu rules. */
  .mobile-panel{width:100%!important;max-width:100vw!important;left:0!important;right:0!important}
  .mobile-panel-inner{
    width:100%!important;
    max-width:100%!important;
    padding-left:max(18px,env(safe-area-inset-left))!important;
    padding-right:max(18px,env(safe-area-inset-right))!important;
  }

  /* QA-found footer cascade conflict: force a readable tablet footer. */
  .site-footer .footer-main{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:38px 28px!important;
  }
  .site-footer .footer-brand{grid-column:1/-1!important;grid-row:auto!important}

  .tx-chat-panel{max-height:calc(100dvh - 150px);overflow-y:auto;overscroll-behavior:contain}
}

@media(max-width:680px){
  .site-header .header-shell{height:72px!important;padding-left:max(14px,env(safe-area-inset-left))!important;padding-right:max(14px,env(safe-area-inset-right))!important}
  .site-header .site-logo-image{width:min(var(--tx-header-logo-width,190px),180px)!important}
  .site-header .mobile-toggle{flex-basis:44px!important;width:44px!important;height:44px!important}

  /* Single-column footer on phones; previous later stylesheet could override it. */
  .site-footer .footer-main{grid-template-columns:1fr!important;gap:34px!important}
  .site-footer .footer-brand{grid-column:auto!important}
  .footer-links a{font-size:.88rem!important;line-height:1.45}

  /* Avoid iOS zoom-on-focus and keep forms touch friendly. */
  .tx-form input,.tx-form select,.tx-form textarea{font-size:16px!important;min-height:48px}
  .tx-form textarea{min-height:130px}
  .tx-form button[type="submit"]{min-height:52px}

  /* Service/map/visual sections may intentionally extend on desktop; contain them on phones. */
  .tx-platform-map,.tx-growth-console,.tx-page-cockpit,.tx-ghl-flow,.tx-ghl-funnel-board{max-width:100%!important}
  .tx-platform-map{overflow:hidden}

  /* Legal/footer content must wrap instead of creating horizontal scroll. */
  .tx-legal-row,.tx-legal-links{width:100%;max-width:100%}
  .tx-legal-links a{overflow-wrap:anywhere}

  /* Cookie UI on short mobile screens remains scrollable and reachable. */
  .tx-consent-banner{max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}
  .tx-consent-settings{max-height:calc(100dvh - 24px)}
}

@media(max-width:430px){
  .site-header .site-logo-image{width:min(var(--tx-header-logo-width,190px),174px)!important}
  .site-header .site-logo-link{max-width:calc(100vw - 82px)!important}
  .mobile-panel-inner{padding-left:max(14px,env(safe-area-inset-left))!important;padding-right:max(14px,env(safe-area-inset-right))!important}
  .footer-cta h2{font-size:clamp(2rem,10.5vw,2.65rem)!important;overflow-wrap:anywhere}
  .tx-price-line strong{overflow-wrap:anywhere}
}

@media(max-width:360px){
  .site-header .site-logo-image{width:min(var(--tx-header-logo-width,190px),164px)!important}
  .site-header .header-shell{padding-left:12px!important;padding-right:12px!important;gap:9px!important}
  .mobile-panel-inner{padding-left:12px!important;padding-right:12px!important}
}
