/* ==========================================================================
   STS Library — mobile safety layer (assets/css/mobile-fixes.css)
   Loaded LAST. Desktop (>= 901px) is untouched except for harmless overflow
   protection. Fixes content/cards running off-screen on phones and tablets.
   ========================================================================== */
html{-webkit-text-size-adjust:100%}
html,body{max-width:100%}
body{overflow-x:hidden}
img,svg,video,canvas,iframe,embed,object{max-width:100%}
img,video{height:auto}
.map-card iframe{width:100%}

/* Grid/flex children may shrink below their content width (prevents card blow-out) */
.grid>*,.footer-grid>*,.faq-list>*,[class*="-grid"]>*,[class*="-layout"]>*{min-width:0}

@media (max-width:900px){
  .container{padding-left:16px;padding-right:16px}
  h1,h2,h3,h4,p,li,a,span,td,th,label,blockquote{overflow-wrap:break-word;word-wrap:break-word}
  /* every multi-column grid becomes safe 1/2-column tracks that cannot exceed the screen */
  .grid-3,.grid-4,.facility-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .faq-list{grid-template-columns:minmax(0,1fr)}
  .section{padding-top:44px;padding-bottom:44px}
  .section-header-center{margin-bottom:28px}
  .hero{min-height:0}
  .hero-content{padding-top:32px;padding-bottom:72px}
  .cta-banner{padding:32px 20px;gap:18px}
  .rating-summary{flex-direction:column;align-items:flex-start;gap:16px;padding:20px}
  .testi-slider-wrap{padding-left:0;padding-right:0}
  .contact-form-card,.card{max-width:100%}
  /* wide tables scroll inside themselves instead of widening the page */
  .compare-table{min-width:560px}
  .table-wrap,.compare-wrap,.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}
  table{max-width:100%}
  /* give room above the bottom app tab bar */
  body{padding-bottom:max(0px,env(safe-area-inset-bottom))}
}
@media (max-width:640px){
  .grid-2,.grid-3,.grid-4,.facility-detail-grid,.footer-grid{grid-template-columns:minmax(0,1fr)}
  .grid-6{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid{gap:16px}
  .page-hero{padding:36px 0 40px}
  .page-hero h1{font-size:clamp(1.45rem,6.4vw,1.9rem);line-height:1.25}
  .page-hero p{font-size:.95rem}
  .section-title{font-size:clamp(1.3rem,5.6vw,1.65rem)}
  .card{padding-left:18px;padding-right:18px}
  input,select,textarea{max-width:100%;box-sizing:border-box;font-size:16px} /* 16px stops iOS zoom-on-focus */
  .branch-meta li{flex-direction:column;gap:2px}
  .branch-meta span{min-width:0}
}
@media (max-width:380px){
  .container{padding-left:14px;padding-right:14px}
  .grid-6{grid-template-columns:minmax(0,1fr)}
}

/* ==========================================================================
   COMPACT BUTTONS (phones & tablets): buttons size to their label, never
   stretch full-width, and wrap side-by-side according to the screen.
   Overrides the older full-width rules in app.css / home.min.css.
   ========================================================================== */
@media (max-width:900px){
  body .btn,body a.btn,body button.btn{
    width:auto;min-height:0;flex:0 0 auto;
    padding:10px 20px;font-size:.92rem;line-height:1.3;border-radius:999px;
    white-space:normal;max-width:100%;text-align:center;
  }
  body .btn-sm{padding:8px 16px;font-size:.84rem;min-height:0}
  body .hero-ctas,body .cta-banner-actions,body .branch-actions,body .btn-row{
    display:flex;flex-direction:row;flex-wrap:wrap;gap:10px;align-items:center;
  }
  body .hero-ctas{justify-content:flex-start}
  body .cta-banner-actions{justify-content:center}
  body .hero-ctas .btn,body .hero-ctas .btn-glass,body .cta-banner-actions .btn,body .branch-actions .btn{
    width:auto;min-height:0;flex:0 0 auto;font-size:.92rem;padding:10px 20px;
  }
  /* WhatsApp / enquiry submit: still easy to tap, but not oversized */
  body .btn-whatsapp,body .enquiry-submit,body .franchise-submit{min-height:44px;font-size:.95rem;padding:10px 20px}
  body .enquiry-submit,body .franchise-submit{width:100%}
  body .btn-whatsapp{width:auto}
  /* plan cards etc. that used .btn{width:100%} keep their button content-width and centred */
  body .plan-card .btn,body .card .btn{width:auto;margin-top:12px}
}
@media (max-width:900px){
  /* buttons given an inline width:100% in sidebars/forms also size to their label */
  body .btn[style*="width:100%"],body .btn[style*="width: 100%"]{width:auto!important}
}
@media (max-width:380px){
  body .btn{padding:9px 16px;font-size:.88rem}
}
