/**
 * Kreboo App Layer - Mobile refinements
 * Only enhances the PWA/mobile presentation layer.
 */
@media (max-width: 782px){
  html.ga-kreboo-app-shell-active body,
  body.ga-kreboo-app-shell-active{
    padding-top: calc(62px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html.ga-kreboo-app-shell-active .ga-saas-app .ga-saas-main > .ga-saas-topbar{
    display:none !important;
  }

  html.ga-kreboo-app-shell-active .ga-saas-clean-root,
  html.ga-kreboo-app-shell-active .ga-saas-app,
  html.ga-kreboo-app-shell-active .ga-saas-shell{
    min-height: calc(100vh - 62px - env(safe-area-inset-top, 0px)) !important;
  }

  html.ga-kreboo-app-shell-active .ga-saas-app .ga-saas-content{
    padding-top: 14px !important;
  }

  .ga-pwa-bottom-widget{
    left: 10px !important;
    right: 10px !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 8px !important;
    border-radius: 24px !important;
    background: var(--ga-app-shell-bg) !important;
    border: 1px solid var(--ga-app-shell-border) !important;
    box-shadow: var(--ga-app-shell-shadow) !important;
    backdrop-filter: blur(18px) !important;
  }

  .ga-pwa-bottom-widget.is-solid{
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 22px 22px 0 0 !important;
  }

  .ga-pwa-bottom-action{
    min-height: 54px !important;
    padding: 7px 4px !important;
    border-radius: 18px !important;
    touch-action: manipulation;
  }

  .ga-pwa-bottom-action.is-active,
  .ga-pwa-bottom-action:active{
    background: rgba(255,255,255,.14) !important;
    transform: translateY(-1px);
  }

  .ga-pwa-bottom-icon{
    font-size: 21px !important;
  }

  .ga-pwa-bottom-label{
    font-size: 10.5px !important;
    letter-spacing: -.01em;
  }

  .ga-pwa-bottom-action.ga-pwa-action-new_appointment{
    position: relative;
  }

  .ga-pwa-bottom-action.ga-pwa-action-new_appointment .ga-pwa-bottom-icon{
    width: 34px;
    height: 34px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 10px 26px rgba(37,99,235,.35);
    margin-top: -14px;
  }

  .gestionale-saas-portal,
  .gestionale-saas-dashboard,
  .gestionale-saas-calendar,
  .gestionale-saas-account,
  .gestionale-saas-settings{
    scroll-margin-bottom: 110px;
  }
}

/* PWA menu overlay coordination: when the SaaS hamburger menu is open,
   the installed-app bottom widget steps out to avoid covering the drawer. */
html.ga-saas-menu-is-open .ga-pwa-bottom-widget,
.ga-pwa-bottom-widget.is-temporarily-hidden,
.ga-pwa-bottom-widget[data-ga-menu-open="1"]{
  opacity:0 !important;
  transform:translateY(120%) !important;
  pointer-events:none !important;
}
