/* =========================================================
   HADS V19 — MOBILE RESPONSIVE STABILIZATION
   Scope: layout-only fixes for phones/tablets. Desktop behavior untouched.
========================================================= */
@media (max-width:760px){
  html,body{max-width:100%!important;overflow-x:hidden!important}
  body{width:100%!important}
  *{min-width:0}
  img,video,svg{max-width:100%}
  .container{width:calc(100% - 28px)!important;max-width:none!important;margin-inline:auto!important}
  h1,h2,h3,h4,p,span,a,button,label,input,textarea,select{overflow-wrap:anywhere}

  /* Header: compact, stable, no clipping */
  .main-header,.nav{height:70px!important;min-height:70px!important}
  .main-header{position:sticky!important;top:0!important;z-index:1900!important}
  .nav{padding-inline:14px!important}
  .logo{margin-right:10px!important;max-width:145px!important}
  .logo img{width:118px!important;max-width:118px!important;height:auto!important}
  .logo small{font-size:6.5px!important;white-space:nowrap!important}
  .lang-switch{margin-left:auto!important;margin-right:8px!important;padding-left:10px!important;gap:7px!important;flex-shrink:0!important}
  .lang-btn{font-size:11px!important}
  .partner-access-link{flex:0 0 auto!important}
  .mobile-toggle{font-size:28px!important;line-height:1!important}
  .main-menu{top:70px!important;max-height:calc(100svh - 70px)!important;overflow:auto!important}

  /* Universal hero stabilization */
  .hero:not(#homeHero),.history-hero{
    min-height:0!important;height:auto!important;max-height:none!important;
    background-size:cover!important;background-position:center!important;background-repeat:no-repeat!important;
    overflow:hidden!important;border-radius:0 0 28px 28px!important;
  }
  .hero:not(#homeHero) .hero-content,.history-hero-content{
    padding-top:54px!important;padding-bottom:54px!important;
    max-width:100%!important;width:100%!important;
  }
  .hero:not(#homeHero) h1,.history-hero h1{
    font-size:clamp(38px,11vw,52px)!important;line-height:1.02!important;letter-spacing:-2px!important;max-width:100%!important;
  }
  .hero:not(#homeHero) p,.history-hero p{font-size:15px!important;line-height:1.55!important;max-width:100%!important}

  /* HOME — stack copy / CTAs / image / section navigation cleanly */
  #homeHero{height:auto!important;min-height:0!important;max-height:none!important;display:block!important;overflow:visible!important;padding:0 0 18px!important;border-radius:0 0 30px 30px!important}
  #homeHero .hero-content-wrap{position:relative!important;display:block!important;padding:30px 18px 0!important;min-height:0!important;width:100%!important}
  #homeHero .hero-copy{width:100%!important;max-width:none!important;padding:0!important;margin:0!important}
  #homeHero .hero-experience{margin-bottom:14px!important}
  #homeHero .hero-experience strong{font-size:30px!important}
  #homeHero .hero-experience span{font-size:9px!important;letter-spacing:.16em!important}
  #homeHero .hero-title,#homeHero .hero-title-fixed{font-size:clamp(36px,10vw,46px)!important;line-height:1.02!important;letter-spacing:-2px!important}
  #homeHero .hero-description{font-size:15px!important;line-height:1.5!important;margin:20px 0 16px!important}
  #homeHero .hero-process-line{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;margin-bottom:18px!important}
  #homeHero .hero-process-line span{display:flex!important;justify-content:center!important;align-items:center!important;min-height:42px!important;padding:8px 10px!important;font-size:10px!important;text-align:center!important}
  #homeHero .hero-process-line span:nth-of-type(5){grid-column:1/-1!important}
  #homeHero .hero-actions{display:grid!important;grid-template-columns:1fr!important;gap:12px!important;max-width:none!important}
  #homeHero .hero-actions a{min-height:58px!important;width:100%!important;font-size:13px!important;padding:0 16px!important;text-align:center!important}
  #homeHero .hero-slides{position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;width:calc(100% - 28px)!important;height:360px!important;margin:22px auto 0!important;border-radius:30px!important;overflow:hidden!important}
  #homeHero .hero-slide{inset:-5px!important;transform:scale(1.03)!important}
  #homeHero .hero-nav,#homeHero .hero-progress{display:none!important}
  #homeHero .home-path{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;margin:18px 0 0!important;padding:14px!important;background:rgba(255,255,255,.92)!important}
  #homeHero .home-path-inner{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important;width:100%!important;overflow:visible!important}
  #homeHero .home-path a{min-width:0!important;min-height:138px!important;padding:16px!important}
  #homeHero .home-path a span{font-size:13px!important}
  #homeHero .home-path a small{font-size:9px!important;line-height:1.15!important}

  /* Home internal screens: do not force one-screen clipping on mobile */
  main>section:not(#homeHero),#industrial-capability{height:auto!important;min-height:0!important;overflow:visible!important;margin:8px 10px!important;padding:38px 0!important;border-radius:28px!important}
  .section-return{display:none!important}
  .section-header{display:block!important;margin-bottom:22px!important}
  .section-header .section-title,.section-title{font-size:clamp(34px,9vw,46px)!important;line-height:1.02!important}
  .why-grid,.workwear-grid,.intro-meta.commercial-stats,.expertise-grid,.responsibility-grid,.industrial-v7-grid,.nearshore-v7-grid,.nearshore-merge .nearshore-grid,#industrial-capability>.container{grid-template-columns:1fr!important}
  .why-card,.workwear-card{height:auto!important;min-height:300px!important}
  #from-idea .expertise-grid{grid-template-columns:1fr!important;gap:22px!important}
  #from-idea .expertise-visual{height:390px!important}
  #from-idea .process{grid-template-columns:1fr!important;gap:12px!important}
  #from-idea .process-item{min-height:0!important;padding:20px!important}
  .industrial-v7-grid,.nearshore-v7-grid{width:calc(100% - 28px)!important;gap:24px!important}
  .industrial-v7-visual,.nearshore-map,#quality-compliance .resp-visual{height:430px!important}
  .industrial-v7-points,.nearshore-v7-points,#quality-compliance .resp-points{grid-template-columns:1fr!important}
  .industrial-v7-copy .section-title,.nearshore-v7-copy .section-title,#quality-compliance .section-title{font-size:clamp(38px,10vw,50px)!important}

  /* Quick navigation: part of the hero, never floating outside / clipped */
  .expertise-hero-with-nav,.history-hero{padding-bottom:0!important}
  .expertise-hero-with-nav .hero-content{padding-bottom:40px!important}
  .expertise-hero-quicknav,.history-hero-quicknav{
    position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;top:auto!important;
    width:calc(100% - 24px)!important;margin:0 auto 16px!important;
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;
  }
  .expertise-hero-quicknav .hads-qbubble,.history-hero-quicknav .hads-qbubble{min-width:0!important;min-height:78px!important;padding:12px!important}
  .hads-quicknav .label{font-size:11px!important;line-height:1.15!important}

  /* Dark lower navigation bars: scroll inside themselves, never crop the page */
  .expertise-subnav,.co-subnav,.subnav,.ww-family-rail,.family-shortcuts{width:100%!important;max-width:100%!important;overflow:hidden!important}
  .expertise-subnav .container,.co-subnav .container,.subnav-inner,.ww-family-rail{
    display:flex!important;justify-content:flex-start!important;gap:10px!important;overflow-x:auto!important;overscroll-behavior-inline:contain!important;
    scroll-snap-type:x proximity!important;padding:16px!important;min-height:88px!important;-webkit-overflow-scrolling:touch!important;
  }
  .expertise-subnav a,.co-subnav a,.subnav a,.ww-family-rail .hads-qbubble,.family-shortcuts a{flex:0 0 min(72vw,285px)!important;scroll-snap-align:center!important;min-width:0!important;min-height:58px!important;font-size:11px!important}

  /* Catalogue/family public pages */
  .catalogue-layout{display:block!important;padding-top:18px!important}
  .catalogue-sidebar{position:relative!important;top:auto!important;width:100%!important;border-right:0!important;border-bottom:1px solid #e5e5e8!important;padding:0 0 16px!important;margin-bottom:18px!important}
  .catalogue-toolbar,.catalogue-headline{flex-direction:column!important;align-items:flex-start!important}
  .product-grid{grid-template-columns:1fr!important}
  .product-visual{height:350px!important}

  /* Product detail: remove the tiny left tree that was covering content on phone */
  .product-detail-grid{display:block!important;padding-top:16px!important}
  .detail-sidebar{display:none!important}
  .visual-area,.product-info-panel{display:block!important;width:100%!important;grid-column:auto!important;grid-row:auto!important}
  .product-info-panel{margin-top:18px!important}
  .viewer-grid{display:grid!important;grid-template-columns:1fr!important}
  .main-stage{min-height:360px!important}
  .main-stage img{max-height:360px!important}
  .thumb-column{display:flex!important;flex-direction:row!important;overflow-x:auto!important;gap:8px!important;padding-top:10px!important}
  .product-shell{width:calc(100% - 24px)!important;padding:14px 0 44px!important}
  .product-page-top{gap:10px!important}
  .product-lower{display:block!important;margin-top:28px!important;padding-top:22px!important}
  .detail-columns{grid-template-columns:1fr!important;gap:24px!important}
  .develop h2{font-size:40px!important;letter-spacing:-2px!important}

  /* Process / fact grids that were overflowing in two columns */
  .process,.process-grid,.steps-grid,.delivery-grid,.fact-grid,.principles-grid,.production-grid,.model-panels,.flex-grid{grid-template-columns:1fr!important}
  .delivery-card,.fact-grid .fact,.production-card,.model-panel,.flex-card{min-width:0!important;width:100%!important}

  /* Contact: remove giant empty gradient and keep form readable */
  body[data-page="contact"] .hero,.contact-page .hero,body:has(.contact-grid)>.hero,body:has(.contact-grid) .hero{min-height:360px!important;padding:44px 0!important}
  .contact{padding:40px 0!important}
  .contact-grid{grid-template-columns:1fr!important;gap:22px!important}
  .form-box{padding:24px!important;border-radius:26px!important}
  .form-grid{grid-template-columns:1fr!important}

  /* Top companion: visible but not covering content */
  .hads-top-companion{right:10px!important;bottom:12px!important;min-width:88px!important;height:44px!important;transform:scale(.92)!important;transform-origin:right bottom!important}

  /* Prevent legacy 'complete image' phone rule from creating huge blank gradients */
  .hero{background-size:cover!important;background-position:center!important}
}

/* Very narrow phones */
@media (max-width:430px){
  .container{width:calc(100% - 22px)!important}
  .logo img{width:108px!important;max-width:108px!important}
  #homeHero .hero-content-wrap{padding-inline:14px!important}
  #homeHero .hero-title,#homeHero .hero-title-fixed{font-size:36px!important}
  #homeHero .hero-slides{height:330px!important;width:calc(100% - 22px)!important}
  #homeHero .home-path{padding:11px!important}
  #homeHero .home-path-inner{gap:9px!important}
  #homeHero .home-path a{min-height:126px!important;padding:13px!important}
  .expertise-hero-quicknav,.history-hero-quicknav{grid-template-columns:1fr 1fr!important}
  .expertise-hero-quicknav .hads-qbubble,.history-hero-quicknav .hads-qbubble{min-height:70px!important}
}

/* =========================================================
   HADS V19.1 — PHONE HOTFIX
   Fixes reported from real Android/Safari-style phone checks.
   Mobile only; desktop untouched.
========================================================= */
@media (max-width:760px){
  *,*::before,*::after{box-sizing:border-box!important}
  html,body{width:100%!important;max-width:100%!important;overflow-x:clip!important}
  body{position:relative!important}
  main,section,header,footer,.container{max-width:100%!important}

  /* Never split navigation labels letter-by-letter. */
  .hads-qbubble,.hads-qbubble *,.expertise-subnav a,.co-subnav a,.subnav a,
  .ww-family-rail a,.history-hero-quicknav a,.expertise-hero-quicknav a{
    overflow-wrap:normal!important;word-break:normal!important;hyphens:none!important;
  }
  .hads-qbubble .label{white-space:normal!important;line-height:1.12!important;font-size:12px!important;font-weight:800!important}
  .hads-qbubble .num{flex:0 0 50px!important;width:50px!important;height:50px!important;display:grid!important;place-items:center!important}
  .hads-qbubble{display:grid!important;grid-template-columns:50px minmax(0,1fr)!important;align-items:center!important;gap:12px!important;width:100%!important;min-width:0!important;height:auto!important;min-height:78px!important;padding:13px 15px!important}

  /* Expertise hero: content first, 6 clean buttons after it, never overlaying copy. */
  .expertise-hero-with-nav{display:flex!important;flex-direction:column!important;align-items:stretch!important;min-height:0!important;height:auto!important;padding-bottom:14px!important}
  .expertise-hero-with-nav>.hero-content{order:1!important;position:relative!important;width:100%!important;padding:48px 18px 28px!important;margin:0!important}
  .expertise-hero-with-nav>.expertise-hero-quicknav{order:2!important;position:relative!important;inset:auto!important;transform:none!important;width:calc(100% - 24px)!important;margin:0 auto!important;padding:12px!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;background:rgba(24,16,29,.88)!important;border-radius:24px!important;overflow:visible!important}
  .expertise-hero-quicknav>a{width:100%!important;min-width:0!important;display:block!important}
  .expertise-hero-quicknav .hads-qbubble{min-height:78px!important;background:linear-gradient(145deg,rgba(63,42,72,.96),rgba(42,28,49,.98))!important;color:#fff!important;box-shadow:0 8px 0 rgba(23,13,28,.85),0 16px 28px rgba(0,0,0,.24)!important}
  .expertise-hero-quicknav .hads-qbubble .label{color:#fff!important}

  /* Workwear hero: make the 4 family cards readable and keep title visible. */
  .hero:has(>.ww-family-rail){display:flex!important;flex-direction:column!important;align-items:stretch!important;height:auto!important;min-height:0!important;padding-bottom:14px!important}
  .hero:has(>.ww-family-rail)>.hero-content{order:1!important;position:relative!important;width:100%!important;padding:52px 18px 28px!important;margin:0!important;z-index:2!important}
  .hero:has(>.ww-family-rail)>.hero-content h1{font-size:clamp(39px,10.5vw,48px)!important;line-height:1.00!important;letter-spacing:-2px!important;max-width:100%!important;margin:0!important}
  .hero:has(>.ww-family-rail)>.hero-content p{font-size:15px!important;line-height:1.55!important;max-width:100%!important}
  .hero:has(>.ww-family-rail)>.ww-family-rail{order:2!important;position:relative!important;inset:auto!important;transform:none!important;width:calc(100% - 24px)!important;margin:0 auto!important;padding:12px!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;background:rgba(24,16,29,.9)!important;border-radius:24px!important;overflow:visible!important;z-index:3!important}
  .ww-family-rail>a{width:100%!important;min-width:0!important;display:block!important;flex:none!important}
  .ww-family-rail .hads-qbubble{min-height:82px!important;background:linear-gradient(145deg,rgba(63,42,72,.97),rgba(42,28,49,.99))!important;color:#fff!important;box-shadow:0 8px 0 rgba(23,13,28,.85),0 16px 28px rgba(0,0,0,.24)!important}
  .ww-family-rail .hads-qbubble .label{color:#fff!important}

  /* Who We Are / history hero: prevent left-side clipping and ugly word wrapping. */
  .history-hero{display:flex!important;flex-direction:column!important;justify-content:flex-end!important;align-items:stretch!important;min-height:0!important;height:auto!important;padding-top:36px!important;overflow:hidden!important}
  .history-hero>.history-hero-content{order:1!important;position:relative!important;width:100%!important;max-width:100%!important;margin:0!important;padding:56px 22px 28px!important;transform:none!important}
  .history-hero h1{font-size:clamp(42px,11vw,52px)!important;line-height:.98!important;letter-spacing:-2px!important;max-width:100%!important;overflow-wrap:normal!important;word-break:normal!important}
  .history-hero p{font-size:15px!important;line-height:1.55!important;max-width:100%!important}
  .history-hero>.history-hero-quicknav{order:2!important;position:relative!important;inset:auto!important;transform:none!important;width:calc(100% - 24px)!important;margin:0 auto 16px!important;padding:12px!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;background:rgba(16,12,20,.72)!important;border-radius:24px!important}
  .history-hero-quicknav>a{width:100%!important;min-width:0!important;display:block!important}
  .history-hero-quicknav .hads-qbubble{min-height:76px!important;background:linear-gradient(145deg,#fff,#f7f1fa)!important;color:#2d2631!important}
  .history-hero-quicknav .hads-qbubble .label{color:#2d2631!important}

  /* Page sub-navigation bars: swipe horizontally, with full readable pills. */
  .expertise-subnav,.co-subnav,.subnav{overflow:hidden!important}
  .expertise-subnav .container,.co-subnav .container,.subnav-inner{display:flex!important;grid-template-columns:none!important;overflow-x:auto!important;overflow-y:hidden!important;gap:10px!important;padding:15px 14px 20px!important;scroll-padding-inline:14px!important;scroll-snap-type:x mandatory!important}
  .expertise-subnav a,.co-subnav a,.subnav a{flex:0 0 76vw!important;max-width:310px!important;min-width:220px!important;min-height:64px!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:12px 18px!important;white-space:normal!important;text-align:center!important;font-size:12px!important;line-height:1.2!important;border-radius:20px!important;scroll-snap-align:center!important}

  /* Two-column process/fact cards were wider than the phone. */
  .process,.process-grid,.steps-grid,.delivery-grid,.fact-grid,.principles-grid,.production-grid,.model-panels,.flex-grid{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;max-width:100%!important;gap:14px!important;
  }
  .process>* ,.process-grid>* ,.steps-grid>* ,.delivery-grid>* ,.fact-grid>* ,.principles-grid>* ,.production-grid>* ,.model-panels>* ,.flex-grid>*{width:100%!important;max-width:100%!important;min-width:0!important}

  /* Generic section titles on phone: no clipped words or forced desktop widths. */
  .section-title,.title,.intro h2,.process-title h2,.production-header h2,.factory-copy h2,.principles h2,.manufacturing-model h2,.next-step h2{
    max-width:100%!important;overflow-wrap:normal!important;word-break:normal!important;hyphens:none!important;
  }

  /* Why Tunisia: keep cinematic impact but fit the viewport. */
  .nearshore-v7-copy .section-title,.nearshore-merge .section-title{font-size:clamp(39px,10.5vw,48px)!important;line-height:.98!important;letter-spacing:-2px!important}
  .nearshore-map{width:100%!important;max-width:100%!important}

  /* Eliminate legacy horizontal shifts and partial content on family/product/editor pages. */
  .page-hero,.section,.intro,.timeline-section,.catalogue-layout,.product-shell,.product-detail-grid,.contact,.contact-grid{margin-left:0!important;margin-right:0!important;transform:none!important;max-width:100%!important}
  .page-hero .container,.section>.container,.intro>.container{padding-left:0!important;padding-right:0!important}

  /* Public catalogue legacy page safety. */
  .products{display:grid!important;grid-template-columns:1fr!important;gap:16px!important}
  .filters{display:flex!important;overflow-x:auto!important;gap:8px!important;padding-bottom:8px!important}
  .filter-btn{flex:0 0 auto!important;white-space:nowrap!important}
  .product-card,.card{max-width:100%!important;min-width:0!important}

  /* Keep floating TOP clear of important text. */
  .hads-top-companion{right:8px!important;bottom:10px!important;z-index:1800!important}
}

@media (max-width:430px){
  .expertise-hero-with-nav>.expertise-hero-quicknav,
  .hero:has(>.ww-family-rail)>.ww-family-rail,
  .history-hero>.history-hero-quicknav{grid-template-columns:1fr 1fr!important;gap:8px!important;padding:9px!important}
  .hads-qbubble{grid-template-columns:44px minmax(0,1fr)!important;gap:9px!important;padding:11px 10px!important;min-height:72px!important}
  .hads-qbubble .num{width:44px!important;height:44px!important;flex-basis:44px!important;font-size:12px!important}
  .hads-qbubble .label{font-size:10.5px!important;line-height:1.15!important}
  .history-hero>.history-hero-content{padding-inline:18px!important}
}

/* =========================================================
   HADS V19.2 — FINAL MOBILE TYPOGRAPHY / BUBBLE SAFETY
   No letter-by-letter breaking in cards, buttons or navigation.
========================================================= */
@media(max-width:760px){
  /* Undo the old global overflow-wrap:anywhere on UI copy. */
  h1,h2,h3,h4,h5,h6,p,span,a,button,label,
  .hads-qbubble,.hads-qbubble *,
  .home-path a,.home-path a *,
  .card,.card *,
  .process-card,.process-card *,
  .fact-card,.fact-card *,
  .step-card,.step-card *,
  .expertise-subnav a,.co-subnav a,.subnav a,.ww-family-rail a{
    overflow-wrap:normal!important;word-break:normal!important;hyphens:none!important;
  }

  /* Home 01–08 navigation: preserve words and give copy enough width. */
  #homeHero .home-path a{
    display:grid!important;grid-template-columns:56px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;column-gap:10px!important;align-content:start!important;
  }
  #homeHero .home-path a>span,#homeHero .home-path a .num{grid-column:1!important;grid-row:1!important}
  #homeHero .home-path a>strong,#homeHero .home-path a .label,#homeHero .home-path a h3{grid-column:2!important;grid-row:1!important;min-width:0!important}
  #homeHero .home-path a>small{grid-column:1/-1!important;grid-row:2!important;width:100%!important;margin-top:14px!important;font-size:10px!important;line-height:1.25!important;letter-spacing:.10em!important}

  /* Buttons/pills: words wrap only at spaces. */
  .btn,.button,.cta,a[class*="btn"],button,[class*="bubble"],[class*="pill"]{
    word-break:normal!important;overflow-wrap:normal!important;hyphens:none!important;
  }
}
@media(max-width:430px){
  #homeHero .home-path a{grid-template-columns:48px minmax(0,1fr)!important;padding:12px!important;column-gap:8px!important}
  #homeHero .home-path a>small{font-size:9px!important;letter-spacing:.08em!important}
}
