/* Top Notch full mobile + desktop QA fix v12
   Purpose: prevent text overlap, protect taps/clicks, stabilize menus/forms/chatbot without rebuilding pages. */
html{box-sizing:border-box;-webkit-text-size-adjust:100%;scroll-behavior:smooth;overflow-x:hidden;}
*,*:before,*:after{box-sizing:inherit;}
body{overflow-x:hidden;word-break:normal;overflow-wrap:break-word;}
img,video,iframe,svg{max-width:100%;height:auto;}
iframe{display:block;border:0;}
a,button,input,select,textarea,label{font-family:inherit;}
a,button,[role="button"],input,select,textarea{touch-action:manipulation;}
button,input,select,textarea{font-size:16px;}
a,button{cursor:pointer;}
.container{min-width:0;}

/* Click target audit */
.btn,.primary-btn,.secondary-btn,.secondary-dark-btn,.nav-cta,.tn-quote-btn,.tn-submit-btn,.mobile-quote-btn,.mobile-call-btn,.tn-mobile-sticky a,.hero-buttons a,.footer a,.main-nav a,.dropbtn,.mobile-dropdown-btn{min-height:44px;display:inline-flex;align-items:center;justify-content:center;text-align:center;line-height:1.18;white-space:normal;overflow-wrap:anywhere;}
.hero-buttons,.center-buttons{display:flex;flex-wrap:wrap;gap:12px;align-items:center;}
.hero-buttons .btn,.center-buttons .btn{max-width:100%;}

/* Desktop nav: no crowding or hidden hover layers */
.site-header{isolation:isolate;}
.desktop-nav-wrap,.main-nav{min-width:0;}
.main-nav{gap:10px 12px;}
.main-nav a,.dropbtn{white-space:nowrap;}
.dropdown-content{max-width:min(92vw,340px);}
.dropdown.is-open .dropdown-content{display:block!important;}
.dropdown-content a{white-space:normal;line-height:1.22;}

/* Cards/grids: prevent crossing/overflow */
.hero-grid,.quote-grid,.two-col,.service-grid,.services-grid,.proof-grid,.review-grid,.local-grid,.content-grid,.tn-quote-grid,.booking-trust-grid{min-width:0;}
.hero-grid>*,.quote-grid>*,.two-col>*,.service-grid>*,.services-grid>*,.proof-grid>*,.review-grid>*,.local-grid>*,.content-grid>*,.tn-quote-grid>*,.booking-trust-grid>*{min-width:0;}
h1,h2,h3,h4,p,li,span,strong,small{overflow-wrap:break-word;}
h1,h2,h3{line-height:1.08;}
p,li{line-height:1.55;}

/* Forms */
form,.quote-form,.tn-quote-form,.contact-card,.tn-quote-card,.booking-panel{position:relative;z-index:3;max-width:100%;min-width:0;}
.quote-form,.tn-quote-form{gap:14px;}
.quote-form label,.tn-quote-form label{min-width:0;line-height:1.25;}
.quote-form input,.quote-form select,.quote-form textarea,.tn-quote-form input,.tn-quote-form select,.tn-quote-form textarea,input,select,textarea{width:100%;max-width:100%;min-height:48px;line-height:1.3;}
textarea{resize:vertical;}
input[type="file"]{min-height:52px;padding-top:12px;}
button[type="submit"],.tn-submit-btn{width:auto;max-width:100%;white-space:normal;}

/* Mobile layout protection */
@media(max-width:980px){
  body{padding-bottom:calc(84px + env(safe-area-inset-bottom,0px));}
  .top-strip .strip-inner{display:flex;flex-direction:column;gap:4px;text-align:center;font-size:13px;line-height:1.25;}
  .site-header{position:sticky!important;top:0!important;z-index:9000!important;background:#fff!important;}
  .mobile-topbar{display:grid!important;grid-template-columns:46px minmax(0,1fr) 46px!important;gap:8px!important;align-items:center!important;}
  .logo-area{min-width:0!important;overflow:hidden!important;display:flex!important;justify-content:center!important;}
  .main-logo{max-height:54px!important;max-width:100%!important;object-fit:contain!important;}
  .mobile-menu-btn,.phone-icon{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;display:grid!important;place-items:center!important;z-index:9015!important;}
  .desktop-nav-wrap{display:none!important;pointer-events:none!important;}
  .hero,.inner-hero{padding:44px 0!important;}
  .hero h1,.inner-hero h1{font-size:clamp(30px,9vw,44px)!important;line-height:1.05!important;}
  .hero p,.inner-hero p{font-size:17px!important;line-height:1.45!important;}
  .hero-grid,.quote-grid,.two-col,.tn-quote-grid{grid-template-columns:1fr!important;gap:22px!important;}
  .service-grid,.services-grid,.proof-grid,.review-grid,.booking-trust-grid,.local-grid,.content-grid{grid-template-columns:1fr!important;}
  .hero-buttons,.center-buttons{display:grid!important;grid-template-columns:1fr!important;width:100%;}
  .hero-buttons a,.center-buttons a,.btn,.primary-btn,.secondary-btn,.secondary-dark-btn{width:100%;min-height:50px;padding-left:14px!important;padding-right:14px!important;}
  .quote-form,.tn-quote-form{display:grid!important;grid-template-columns:1fr!important;}
  .quote-form label,.tn-quote-form label,.quote-form .full,.tn-quote-form .full{grid-column:1/-1!important;}
  .tn-mobile-sticky{z-index:8700!important;}
  .tn-mobile-sticky a{min-height:50px!important;}
  .mobile-overlay:not(.active){opacity:0!important;visibility:hidden!important;pointer-events:none!important;}
  .mobile-overlay.active{opacity:1!important;visibility:visible!important;pointer-events:auto!important;}
  .mobile-menu{z-index:9900!important;max-width:92vw!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;}
  .mobile-menu:not(.active){pointer-events:none!important;}
  .mobile-menu.active{pointer-events:auto!important;}
  .mobile-menu-content a,.mobile-dropdown-btn{min-height:48px!important;line-height:1.2!important;white-space:normal!important;}
}
@media(max-width:420px){
  .mobile-topbar{grid-template-columns:42px minmax(0,1fr) 42px!important;gap:6px!important;}
  .main-logo{max-height:48px!important;}
  .mobile-menu-btn,.phone-icon{width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;}
  .container{width:94%!important;}
  .btn,.primary-btn,.secondary-btn,.secondary-dark-btn,.tn-submit-btn{font-size:15px!important;}
}

/* Booking / Markate page: keep booking usable */
body.tn-booking-page{padding-bottom:0!important;}
body.tn-booking-page .tn-mobile-sticky,body.tn-booking-page .sticky-cta{display:none!important;pointer-events:none!important;}
body.tn-booking-page .booking-panel{overflow:visible!important;padding:8px!important;}
body.tn-booking-page .booking-panel iframe{width:100%!important;min-height:1550px!important;overflow:auto!important;background:#fff!important;}
@media(max-width:768px){body.tn-booking-page .booking-panel iframe{min-height:1750px!important;}}

/* Lisa chatbot: full-screen mobile, no stuck keyboard/footer overlap */
#tn-smart-chatbot-root{pointer-events:none!important;}
#tn-smart-chatbot-root .tn-bot-button,#tn-smart-chatbot-root .tn-bot-panel{pointer-events:auto!important;}
#tn-smart-chatbot-root .tn-bot-panel{display:none!important;flex-direction:column!important;overflow:hidden!important;}
#tn-smart-chatbot-root .tn-bot-panel.tn-open{display:flex!important;}
#tn-smart-chatbot-root .tn-bot-head,#tn-smart-chatbot-root .tn-bot-input,#tn-smart-chatbot-root .tn-bot-links{flex:0 0 auto!important;}
#tn-smart-chatbot-root .tn-bot-messages{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;}
@media(max-width:768px){
  body.tn-chat-open{overflow:hidden!important;padding-bottom:0!important;}
  body.tn-chat-open .tn-mobile-sticky{display:none!important;}
  #tn-smart-chatbot-root .tn-bot-panel.tn-open{position:fixed!important;left:8px!important;right:8px!important;top:8px!important;bottom:8px!important;width:auto!important;height:auto!important;max-height:none!important;border-radius:16px!important;z-index:2147483647!important;}
  #tn-smart-chatbot-root .tn-bot-button{bottom:calc(84px + env(safe-area-inset-bottom,0px))!important;}
  #tn-smart-chatbot-root .tn-bot-input input{min-width:0!important;}
  #tn-smart-chatbot-root .tn-bot-input button{min-width:62px!important;}
}
