/*
 * Canonical owner of global shell geometry.
 * Page-level layout, visual polish and functional content do not belong here.
 */
:root{
  --shell-sidebar-width:288px;
  --shell-mobile-header-height:64px;
  --shell-safe-top:env(safe-area-inset-top, 0px);
  --shell-safe-bottom:env(safe-area-inset-bottom, 0px);
  --shell-safe-left:env(safe-area-inset-left, 0px);
  --shell-safe-right:env(safe-area-inset-right, 0px);
  --shell-content-inline:24px;
  --shell-content-max-width:1120px;
  --shell-z-header:50;
  --shell-z-sidebar:40;
  --shell-z-overlay:35;
}

#appRoot.navx-auth{
  min-height:100svh;
  overflow-x:clip;
}

#appRoot.navx-auth .navx-sidebar{
  display:flex;
  position:fixed;
  inset:0 auto 0 0;
  z-index:var(--shell-z-sidebar);
  box-sizing:border-box;
  width:var(--shell-sidebar-width);
  min-width:var(--shell-sidebar-width);
  max-width:var(--shell-sidebar-width);
  height:100svh;
  max-height:100svh;
  overflow-x:hidden;
  overflow-y:auto;
  transform:none;
  visibility:visible;
  pointer-events:auto;
}

#appRoot.navx-auth .navx-mobileHeader{
  display:none;
}

#appRoot.navx-auth .navx-main{
  box-sizing:border-box;
  width:calc(100% - var(--shell-sidebar-width));
  min-width:0;
  max-width:var(--shell-content-max-width);
  margin-left:var(--shell-sidebar-width);
  margin-right:0;
  padding:22px var(--shell-content-inline) 34px;
  overflow:visible;
}

#appRoot.navx-auth.route-rh.has-page-context-header .navx-main{
  padding-top:12px;
}

#appRoot.navx-auth #pageContextHeader{
  box-sizing:border-box;
  display:grid;
  grid-template-columns:minmax(44px, auto) minmax(0, 1fr) minmax(44px, auto);
  align-items:start;
  gap:12px;
  width:calc(100% - var(--shell-sidebar-width));
  min-width:0;
  max-width:var(--shell-content-max-width);
  margin-left:var(--shell-sidebar-width);
  padding:18px var(--shell-content-inline) 0;
  overflow:hidden;
}

#pageContextHeader[hidden]{
  display:none;
}

#appRoot.navx-auth :is(.rh-module-head, .rh-module-actions)[hidden]{
  display:none;
}

#pageContextBack,
#pageContextRefresh{
  box-sizing:border-box;
  min-width:44px;
  min-height:44px;
  max-width:100%;
}

.page-context-header__copy{
  min-width:0;
  overflow:hidden;
}

.page-context-identity{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  overflow:hidden;
}

.page-context-logo{
  display:none;
}

#pageContextTitle,
#pageContextSubtitle{
  max-width:100%;
  margin:0;
  overflow-wrap:anywhere;
}

@media (max-width:1023px){
  :root{
    --shell-content-inline:12px;
  }

  body.navx-menu-open{
    overflow:hidden;
  }

  #appRoot.navx-auth{
    width:100%;
    max-width:100%;
    min-height:100svh;
    overflow-x:hidden;
  }

  #appRoot.navx-auth .navx-mobileHeader{
    display:flex;
    position:fixed;
    inset:0 0 auto 0;
    z-index:var(--shell-z-header);
    box-sizing:border-box;
    width:100%;
    min-width:0;
    max-width:none;
    height:calc(var(--shell-mobile-header-height) + var(--shell-safe-top));
    min-height:calc(var(--shell-mobile-header-height) + var(--shell-safe-top));
    padding-top:calc(8px + var(--shell-safe-top));
    padding-right:max(14px, var(--shell-safe-right));
    padding-bottom:8px;
    padding-left:max(14px, var(--shell-safe-left));
  }

  .navx-mobileBrand{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
  }

  .navx-mobileIdentity{
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
  }

  .navx-mobileBack{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    width:44px;
    min-width:44px;
    height:44px;
    min-height:44px;
    flex:0 0 44px;
  }

  .navx-mobileBack[hidden]{
    display:none;
  }

  .navx-mobileBrand img{
    box-sizing:border-box;
    width:40px;
    min-width:40px;
    max-width:40px;
    height:40px;
    min-height:40px;
    max-height:40px;
    flex:0 0 40px;
    object-fit:contain;
  }

  .navx-mobileBrand > div,
  .navx-mobileText{
    min-width:0;
    overflow:hidden;
  }

  .navx-mobileBrandSub,
  .navx-mobileText strong,
  .navx-mobileText small{
    display:block;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .navx-mobileTrigger{
    display:flex;
    align-items:center;
    gap:8px;
    box-sizing:border-box;
    min-width:0;
    max-width:min(58vw, 278px);
    min-height:44px;
    padding:4px 7px 4px 10px;
  }

  #appRoot.navx-auth .navx-close,
  #appRoot.navx-auth .navx-item,
  #appRoot.navx-auth .navx-subitem,
  #appRoot.navx-auth #navxLogout,
  #appRoot.navx-auth #pageContextBack,
  #appRoot.navx-auth #pageContextRefresh{
    box-sizing:border-box;
    min-width:44px;
    min-height:44px;
  }

  #appRoot.navx-auth #pageContextRefresh{
    width:42px;
    min-width:42px;
    max-width:42px;
    height:42px;
    min-height:42px;
    max-height:42px;
  }

  #appRoot.navx-auth .navx-close{
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }

  .navx-mobileText{
    display:flex;
    flex-direction:column;
    align-items:flex-end;
  }

  .navx-mobileTrigger #navxMobileAvatar{
    box-sizing:border-box;
    width:34px;
    min-width:34px;
    max-width:34px;
    height:34px;
    min-height:34px;
    max-height:34px;
    flex:0 0 34px;
  }

  .navx-mobileChevron{
    box-sizing:border-box;
    width:9px;
    min-width:9px;
    height:9px;
    min-height:9px;
    flex:0 0 9px;
    transform:rotate(45deg) translateY(-2px);
  }

  #appRoot.navx-open .navx-mobileChevron{
    transform:rotate(45deg) translateY(-2px);
  }

  #appRoot.navx-auth .navx-sidebar{
    inset:calc(var(--shell-mobile-header-height) + var(--shell-safe-top)) 0 auto 0;
    z-index:var(--shell-z-sidebar);
    box-sizing:border-box;
    width:100%;
    min-width:100%;
    max-width:100%;
    height:calc(100svh - var(--shell-mobile-header-height) - var(--shell-safe-top));
    min-height:0;
    max-height:calc(100svh - var(--shell-mobile-header-height) - var(--shell-safe-top));
    padding-bottom:var(--shell-safe-bottom);
    overflow-x:hidden;
    overflow-y:auto;
    transform:translateY(-104%);
    visibility:hidden;
    pointer-events:none;
  }

  #appRoot.navx-auth .navx-sidebar.open{
    transform:translateY(0);
    visibility:visible;
    pointer-events:auto;
  }

  #appRoot.navx-auth .navx-main{
    width:100%;
    min-width:0;
    max-width:var(--shell-content-max-width);
    margin:0 auto;
    padding-top:calc(var(--shell-mobile-header-height) + var(--shell-safe-top) + 16px);
    padding-right:max(var(--shell-content-inline), var(--shell-safe-right));
    padding-bottom:calc(24px + var(--shell-safe-bottom));
    padding-left:max(var(--shell-content-inline), var(--shell-safe-left));
    overflow:visible;
  }

  #appRoot.navx-auth.has-page-context-header .navx-main{
    padding-top:12px;
  }

  #appRoot.navx-auth #pageContextHeader{
    grid-template-columns:minmax(0, 1fr) minmax(44px, auto);
    gap:8px;
    width:100%;
    min-width:0;
    max-width:var(--shell-content-max-width);
    margin:0 auto;
    padding-top:calc(var(--shell-mobile-header-height) + var(--shell-safe-top) + 12px);
    padding-right:max(var(--shell-content-inline), var(--shell-safe-right));
    padding-bottom:12px;
    padding-left:max(var(--shell-content-inline), var(--shell-safe-left));
  }

  /* V3 — delta mínimo e exclusivo do contexto RH mobile, conforme Golden. */
  #appRoot.navx-auth.route-rh.has-page-context-header #pageContextHeader{
    padding-top:calc(var(--shell-mobile-header-height) + var(--shell-safe-top) + 16px);
    padding-bottom:18px;
  }

  #appRoot.navx-auth.route-rh.has-page-context-header #pageContextHeader .page-context-logo{
    width:50px;
    min-width:50px;
    height:50px;
    min-height:50px;
    flex-basis:50px;
  }

  #appRoot.navx-auth.route-rh.has-page-context-header #pageContextHeader .page-context-logo img{
    width:44px;
    height:44px;
  }

  #appRoot.navx-auth #pageContextBack{
    display:none;
  }

  .page-context-logo{
    display:flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    width:42px;
    min-width:42px;
    height:42px;
    min-height:42px;
    flex:0 0 42px;
  }

  .page-context-logo img{
    display:block;
    width:36px;
    height:36px;
    object-fit:contain;
  }

  #appRoot.navx-auth .homev2-dock{
    bottom:calc(12px + var(--shell-safe-bottom));
  }
}

/* iOS/Android defensivo quando o navegador entrega um viewport de layout desktop. */
body.mobile-force{
  overflow-x:hidden !important;
  overscroll-behavior-y:auto;
}

#appRoot.mobile-force{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow-x:hidden !important;
}

#appRoot.mobile-upscale{ zoom:var(--mobile-upscale, 1); }

@supports not (zoom:1){
  #appRoot.mobile-upscale{
    width:calc(100% / var(--mobile-upscale, 1)) !important;
    transform:scale(var(--mobile-upscale, 1));
    transform-origin:top left;
  }
}

#appRoot.mobile-force.navx-auth .navx-mobileHeader{
  display:flex;
  position:fixed;
  inset:0 0 auto;
  z-index:var(--shell-z-header);
  align-items:center;
  justify-content:space-between;
  gap:8px;
  width:100%;
  max-width:100%;
  height:calc(var(--shell-mobile-header-height) + var(--shell-safe-top));
  min-height:calc(var(--shell-mobile-header-height) + var(--shell-safe-top));
  padding-top:calc(8px + var(--shell-safe-top));
  padding-bottom:8px;
  padding-right:max(14px, var(--shell-safe-right));
  padding-left:max(14px, var(--shell-safe-left));
}

#appRoot.mobile-force .navx-mobileIdentity,
#appRoot.mobile-force .navx-mobileBrand{
  display:flex;
  align-items:center;
  min-width:0;
}

#appRoot.mobile-force.has-page-context-header .navx-mobileBrand img,
#appRoot.mobile-force.has-page-context-header .navx-mobileBrandSub{ display:none; }

#appRoot.mobile-force.has-page-context-header .navx-mobileTrigger{
  width:min(42vw, 164px);
  max-width:min(42vw, 164px);
}

#appRoot.mobile-force .navx-mobileText small{ display:none; }

#appRoot.mobile-force.navx-auth .navx-sidebar{
  inset:calc(var(--shell-mobile-header-height) + var(--shell-safe-top)) 0 auto 0;
  width:100%;
  min-width:100%;
  max-width:100%;
  height:calc(100svh - var(--shell-mobile-header-height) - var(--shell-safe-top));
  max-height:calc(100svh - var(--shell-mobile-header-height) - var(--shell-safe-top));
  transform:translateY(-104%);
  visibility:hidden;
  pointer-events:none;
}

#appRoot.mobile-force.navx-auth .navx-sidebar.open{
  transform:translateY(0);
  visibility:visible;
  pointer-events:auto;
}

#appRoot.mobile-force.navx-auth .navx-main,
#appRoot.mobile-force.navx-auth #pageContextHeader{
  width:100%;
  max-width:100%;
  margin-left:0;
  padding-right:max(12px, var(--shell-safe-right));
  padding-left:max(12px, var(--shell-safe-left));
}

#appRoot.mobile-force.navx-auth .navx-main{
  padding-top:12px;
  padding-bottom:calc(24px + var(--shell-safe-bottom));
}

#appRoot.mobile-force.navx-auth #pageContextHeader{
  grid-template-columns:minmax(0, 1fr) minmax(44px, auto);
  padding-top:calc(var(--shell-mobile-header-height) + var(--shell-safe-top) + 12px);
  padding-bottom:12px;
}

#appRoot.mobile-force.navx-auth #pageContextBack{ display:none; }

#appRoot.mobile-force :is(input, select, textarea){ font-size:16px !important; }

#appRoot.mobile-force :is(.page-compactHeader){ display:none !important; }
#appRoot.mobile-force :is(.reservas-controls, .consumo-filters, .rh-editor-scope-toolbar, .rh-editor-date-toolbar){ min-width:0; }
#appRoot.mobile-force .rh-module-shell{
  max-width:100%;
  margin-top:8px;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
#appRoot.mobile-force .rh-module-nav{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  padding:12px;
  border:1px solid rgba(15,23,42,.10);
  border-radius:10px;
  background:#fff;
}
#appRoot.mobile-force .rh-module-tabs{ display:none !important; }
#appRoot.mobile-force .rh-mobile-tab{ display:block !important; }
#appRoot.mobile-force .rh-module-actions{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  width:100%;
}
#appRoot.mobile-force .rh-tab-panel{ padding:16px 0 20px; }
#appRoot.mobile-force .rh-editor-scope-toolbar,
#appRoot.mobile-force .rh-editor-date-toolbar{ grid-template-columns:1fr; }
#appRoot.mobile-force .rh-cardapios-subtabs{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
#appRoot.mobile-force .reservas-toolbar,
#appRoot.mobile-force .consumo-filters{ grid-template-columns:repeat(2, minmax(0, 1fr)); }

#appRoot.navx-auth .navx-item:hover{
  transform:translateX(1px);
}
