/**
 * R10.39.6 — smart / direction-aware sticky public navigation.
 *
 * Behaviour:
 * - At the top or while scrolling upward: show the complete navigation stack.
 * - While scrolling downward: keep only the food-category rail visible.
 * - Uses transform-only animation so the document layout never reflows while
 *   the user scrolls (prevents the iOS/mobile "shaking" seen with collapsing
 *   sticky heights).
 */
:root{
  --ubp-public-primary-h:82px;
  --ubp-public-category-h:72px;
  --ubp-public-nav-ease:cubic-bezier(.22,.8,.24,1);
  --ubp-public-nav-speed:240ms;
}

body.fazfood-public .faz-topbar,
body.fazfood-public .theme-site-header.faz-header,
body.fazfood-public #site-header{
  transform:translate3d(0,0,0)!important;
  -webkit-transform:translate3d(0,0,0)!important;
  transition:transform var(--ubp-public-nav-speed) var(--ubp-public-nav-ease),
             box-shadow var(--ubp-public-nav-speed) ease!important;
  will-change:transform!important;
  backface-visibility:hidden!important;
  -webkit-backface-visibility:hidden!important;
}

/* Scrolling down: move the utility strip completely out, then move the whole
   white header far enough upward that its category rail lands exactly at 0. */
body.fazfood-public.ubp-nav-compact:not(.nav-open) .faz-topbar{
  transform:translate3d(0,-100%,0)!important;
  -webkit-transform:translate3d(0,-100%,0)!important;
  pointer-events:none!important;
}
body.fazfood-public.ubp-nav-compact:not(.nav-open) .theme-site-header.faz-header,
body.fazfood-public.ubp-nav-compact:not(.nav-open) #site-header{
  transform:translate3d(0,calc(-1 * (var(--ubp-public-topbar-h) + var(--ubp-public-primary-h))),0)!important;
  -webkit-transform:translate3d(0,calc(-1 * (var(--ubp-public-topbar-h) + var(--ubp-public-primary-h))),0)!important;
  box-shadow:none!important;
}
body.fazfood-public.ubp-nav-compact:not(.nav-open) .faz-category-bar.menu-category-bar{
  box-shadow:0 7px 18px rgba(15,23,42,.09)!important;
  border-bottom-color:rgba(15,23,42,.09)!important;
}

/* Scrolling up / at top: restore every navigation row as one smooth motion. */
body.fazfood-public.ubp-nav-expanded .faz-topbar,
body.fazfood-public.ubp-nav-expanded .theme-site-header.faz-header,
body.fazfood-public.ubp-nav-expanded #site-header,
body.fazfood-public.nav-open .faz-topbar,
body.fazfood-public.nav-open .theme-site-header.faz-header,
body.fazfood-public.nav-open #site-header{
  transform:translate3d(0,0,0)!important;
  -webkit-transform:translate3d(0,0,0)!important;
}

/* Category rail is the persistent navigation surface. Keep it stable and on a
   GPU layer so Safari does not repaint/jump while the browser chrome resizes. */
body.fazfood-public .faz-category-bar.menu-category-bar{
  transform:translateZ(0)!important;
  -webkit-transform:translateZ(0)!important;
  backface-visibility:hidden!important;
  -webkit-backface-visibility:hidden!important;
}
body.fazfood-public .faz-category-bar.menu-category-bar .faz-category-scroll{
  overscroll-behavior-x:contain!important;
  scroll-behavior:smooth!important;
}

/* Do not let focus jump behind a compact header. */
body.fazfood-public.ubp-nav-compact{scroll-padding-top:var(--ubp-public-category-h)!important}
body.fazfood-public.ubp-nav-expanded{scroll-padding-top:var(--ubp-public-sticky-offset)!important}

/* Mobile-specific stability: no height transitions, no top-property animation,
   no rubber-band driven CSS recalculation. Horizontal category scrolling stays
   independent of the page's vertical scroll. */
@media(max-width:780px){
  :root{--ubp-public-nav-speed:210ms}
  body.fazfood-public .faz-topbar,
  body.fazfood-public .theme-site-header.faz-header,
  body.fazfood-public #site-header{
    transition-property:transform,box-shadow!important;
  }
  body.fazfood-public .faz-category-bar.menu-category-bar,
  body.fazfood-public .faz-category-bar.menu-category-bar .faz-category-scroll{
    touch-action:pan-x pan-y!important;
  }
  body.fazfood-public.ubp-nav-compact:not(.nav-open) .faz-category-bar.menu-category-bar{
    box-shadow:0 5px 15px rgba(15,23,42,.11)!important;
  }
}

/* Opening the hamburger must always reveal the complete header state. */
@media(max-width:1180px){
  body.fazfood-public.nav-open{scroll-padding-top:0!important}
  body.fazfood-public.nav-open .theme-site-header,
  body.fazfood-public.nav-open #site-header{transform:none!important;-webkit-transform:none!important}
}

html[data-ubp-theme="dark"] body.fazfood-public.ubp-nav-compact .faz-category-bar.menu-category-bar{
  box-shadow:0 7px 20px rgba(0,0,0,.35)!important;
}

@media(prefers-reduced-motion:reduce){
  body.fazfood-public .faz-topbar,
  body.fazfood-public .theme-site-header.faz-header,
  body.fazfood-public #site-header{transition:none!important}
  body.fazfood-public .faz-category-bar.menu-category-bar .faz-category-scroll{scroll-behavior:auto!important}
}
