/* The phone tab bar on every page (inc/mobile-tabs.php). The bar itself is
   styled in shell.css (.mtabs, <=680px); this file is what turns it into a
   site-wide fixture: hidden above the breakpoint, room for it below the page,
   and every other fixed element lifted above it. The festival bar is the same
   markup and the same design with other items, so nothing here is festival
   specific beyond the stacking of its own fixed bars. */

:root{--mtabs-h:calc(64px + env(safe-area-inset-bottom));}

/* Never a layout cost on tablet and desktop. */
@media (min-width:681px){
  .mtabs{display:none;}
}

/* The seller portal has its own navigation. */
.portal-page .mtabs{display:none;}

@media (max-width:680px){
  /* Room under the content and the navy footer. The homepage is a fixed-height
     feed that already leaves the bar its own space. */
  html body.has-mtabs:not(.home) .footer{padding-bottom:calc(32px + var(--mtabs-h));}
  html body.has-mtabs.has-pstick:not(.home) .footer{padding-bottom:calc(96px + var(--mtabs-h));}

  /* Overlays cover the bar: the dimmed backdrops are translucent, so hide it. */
  body:has(.modal.is-open) .mtabs,
  body:has(.scrim.is-open) .mtabs,
  html.fmodal-open .mtabs,
  html.plb-open .mtabs{visibility:hidden;}

  /* Floating WhatsApp button, above the bar (on the homepage it keeps its own place on the feed). */
  html body.has-mtabs:not(.home) .wa-float{bottom:calc(var(--mtabs-h) + 14px);}
  html body.has-mtabs.has-pstick:not(.home) .wa-float{bottom:calc(var(--mtabs-h) + 88px);}
  html body.has-mtabs:not(.home):has(.fest-summary) .wa-float,
  html body.has-mtabs:not(.home):has(.stand-bar:not([hidden])) .wa-float,
  html body.has-mtabs:not(.home):has(.fest-sticky:not([hidden])) .wa-float{bottom:calc(var(--mtabs-h) + 96px);}

  /* Cookie banner and toast above the bar. */
  html body.has-mtabs .thv-cc{bottom:calc(var(--mtabs-h) + 8px);}
  html body.has-mtabs:not(.home) .toast{bottom:calc(var(--mtabs-h) + 14px);}

  /* Sticky purchase bars stack on top of it: the product bar, the festival
     "Koop tickets" button, the ticket summary and the stand bar. The bar
     already carries the safe-area inset, so they drop theirs. */
  body.has-mtabs .pstick{bottom:var(--mtabs-h);padding-bottom:10px;}
  body.has-mtabs .fest-sticky{bottom:calc(var(--mtabs-h) + 10px);}
  body.has-mtabs .fest-summary,
  body.has-mtabs .stand-bar{bottom:var(--mtabs-h);padding-bottom:10px;}
  body.has-mtabs .fest-tickets{padding-bottom:calc(110px + var(--mtabs-h));}
  body.has-mtabs .fest-ways{padding-bottom:calc(clamp(160px,30vw,230px) + var(--mtabs-h));}
}
