/* =====================================================================
   Mobile stability fixes  (public site + home page)
   Loaded AFTER site.css / page css.  Fixes: page wobbling sideways,
   iOS zoom-jump on input focus, header wrapping, wide grids/tables.
   ===================================================================== */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html,body{max-width:100%;overflow-x:clip}
img,svg,video,canvas,iframe{max-width:100%}
img{height:auto}
a,button,select,summary,label,input[type=checkbox],input[type=radio]{touch-action:manipulation}
a,button{-webkit-tap-highlight-color:rgba(79,70,229,.15)}

/* grid / flex children may shrink instead of pushing the page wider than the screen */
.layout>*,.cards>*,.feat>*,.steps>*,.sr>*,.pc-b>*,.hero2>*,.hx-layout>*,.pkr>*,.vgrid>*,.hgc>*,.pb>*,.row>*,.g2>*{min-width:0}
.cards{grid-template-columns:repeat(auto-fill,minmax(min(240px,100%),1fr))}
.tw{overflow-x:auto;-webkit-overflow-scrolling:touch}
h1,h2,h3,h4,p,li,td,th,.pc h3,.cx b{overflow-wrap:anywhere}
input[type=date],input[type=time]{min-width:0;max-width:100%;display:block;min-height:44px}
.twocol{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.pkimg{display:block;width:100%;height:auto;aspect-ratio:16/7;max-height:380px;object-fit:cover;border-radius:16px;margin:0 0 16px;background:#e2e8f0}

@media(max-width:850px){
  /* 1fr = minmax(auto,1fr) lets wide content stretch the column; minmax(0,1fr) does not */
  .layout{grid-template-columns:minmax(0,1fr)}
  .twocol{grid-template-columns:minmax(0,1fr)}
  .pkr-r{min-width:0;align-items:stretch;text-align:left;width:100%}
  .hhead{flex-wrap:wrap}
  .sw{padding:14px 12px 76px}
  .card{padding:16px}
  .wa{bottom:calc(84px + env(safe-area-inset-bottom,0px))}
  .mbar{padding-bottom:calc(10px + env(safe-area-inset-bottom,0px))}
}
@media(max-width:820px){
  /* iOS Safari zooms the whole page when an input under 16px gets focus -> page "jumps" */
  input,select,textarea{font-size:16px!important}
  .re-btn{font-size:16px}
  button,.btn{min-height:42px}
  h1{font-size:clamp(22px,6.4vw,30px)}

  /* home hero + tabs must fit narrow phones */
  .hero{padding:30px 14px 130px}
  .wrap{margin-top:-100px;padding:0 12px}
  .panel{padding:14px}
  .tabs{max-width:100%}
  .tabs button{padding:9px clamp(10px,3.6vw,26px);white-space:nowrap}
  .mode button{padding:6px clamp(10px,3vw,18px)}
  .banner{flex-direction:column;align-items:flex-start}
  .ci{height:130px}
  .hs,.hg,.results,.about{padding-left:12px;padding-right:12px}

  /* home search forms: index.php has `.pk .row{4 columns}` which beats its own mobile rule -> form squeezed on phones */
  .pk .row,.cabs .row{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pk .row .go,.cabs .row .go{grid-column:1/-1}
  .bs{padding-bottom:46px}

  /* rooms & persons popup: bottom sheet so it can never overflow the right edge */
  .re-panel{position:fixed!important;left:3vw;right:3vw;top:auto!important;bottom:calc(10px + env(safe-area-inset-bottom,0px));width:auto!important;max-height:78vh;z-index:80}
  .re-panel[hidden]{display:none!important}
}
@media(max-width:560px){
  .pk .row,.cabs .row,.g2{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:420px){
  .bookf .two,.calc .two{grid-template-columns:minmax(0,1fr)}
  .hero2 h1,.mm h1{font-size:23px}
  .hero h1{font-size:27px}
  .hprice{text-align:left}
  .pc-tiles,.acts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pc-t{min-width:0;overflow-wrap:anywhere}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
