/* Beta-only layout. Shared catalog, ordering and modal styles remain unchanged. */
body.hk-sidebar-beta { position: relative; --hk-beta-sidebar-width: clamp(254.6px, 25.9825vw, 294.5px); }
body.hk-sidebar-beta #menuBackdrop { display: none !important; }
body.hk-sidebar-beta #menuOverlay {
    width: var(--hk-beta-sidebar-width) !important;
    max-width: none; top: 10px !important; bottom: 5px !important;
    height: calc(100% - 15px); height: calc(100dvh - 15px);
    z-index: 850; border-radius: 0 20px 20px 0;
    box-shadow: none !important;
    transform: translateX(-103%) !important;
    opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
    will-change: transform, opacity !important;
    transition: none !important;
}
body.hk-sidebar-beta #menuOverlay.open { transform: translateX(0) !important; opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; transition: none !important; }
body.hk-sidebar-beta #menuOverlay .overlay-header {
    display: grid; grid-template-columns: minmax(0,1fr);
    flex: 0 0 auto; gap: 9px; padding: max(12px, env(safe-area-inset-top)) 14px 12px;
    align-items: center;
}
body.hk-sidebar-beta #menuOverlay .overlay-header > h3 {
    display: block !important; font-size: 1.08rem; line-height: 1.2;
    color: var(--theme-text); margin: 0;
}
body.hk-sidebar-beta #menuOverlay .hk-beta-menu-close {
    grid-column: 1 / -1; width: 100%; box-sizing: border-box; min-height: 44px; min-width: 120px; padding: 9px 16px; font-size: .82rem;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: #187a46; color: #fff;
}
body.hk-sidebar-beta #menuOverlay .hk-category-hide-arrow {
    font-size: 18px; line-height: 1;
}
body.hk-sidebar-beta #menuOverlay .overlay-info-group {
    grid-column: 1 / -1; margin: 0; padding: 0; font-size: .8rem;
    justify-content: center; text-align: center; white-space: normal; background: transparent; color: var(--theme-text);
}
body.hk-sidebar-beta #menuOverlay .hk-beta-menu-tools {
    display: grid !important; grid-column: 1 / -1;
    grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px !important;
}
body.hk-sidebar-beta #menuOverlay .hk-beta-menu-tools button {
    min-height: 38px; min-width: 0; padding: 8px 5px;
    font-size: .74rem; white-space: normal;
}
body.hk-sidebar-beta #menuOverlay .menu-grid-container {
    grid-template-columns: minmax(0,1fr) !important;
    min-height: 0; gap: 18.2px; padding: 26px 16px 30px 16px;
    overflow-y: auto; overflow-x: hidden;
    overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}
body.hk-sidebar-beta #menuOverlay .category-group-heading { font-size: .9rem; gap: 8px; }
body.hk-sidebar-beta #menuOverlay .sidebar-cat-link { column-gap: 5px; padding: 5px 7px; }
body.hk-sidebar-beta #menuOverlay .sidebar-cat-link.has-category-limit > .cat-text-wrap { padding-right: 0; }
body.hk-sidebar-beta #menuOverlay .category-workload-badge { width: 36px; height: 36px; flex-basis: 36px; font-size: 12px; }
body.hk-sidebar-beta #menuOverlay .sidebar-cat-link > img { width: 68.64px !important; max-width: 68.64px; height: 68.64px !important; }
body.hk-sidebar-beta #menuOverlay .category-name { font-size: .97rem !important; }
body.hk-sidebar-beta #menuOverlay .category-highlight-badge { max-width: calc(100% - 8px); padding: 2px 5px; font-size: .66rem; }
body.hk-sidebar-beta #menuOverlay .category-workload-note { padding: 9px; gap: 7px; align-items: flex-start; }
body.hk-sidebar-beta #menuOverlay .category-workload-guide-icon { width: 30px; height: 30px; flex-basis: 30px; font-size: 19px; }
body.hk-sidebar-beta #menuOverlay .category-workload-guide-title { font-size: .8rem; }
body.hk-sidebar-beta #menuOverlay .category-workload-guide-copy { font-size: .76rem; line-height: 1.3; }
body.hk-sidebar-open { padding-top: calc(var(--hk-beta-header-height,71px) - 21px); }
body.hk-sidebar-open > header { left: var(--hk-beta-sidebar-width); width: calc(100% - var(--hk-beta-sidebar-width)); height: auto; }
body.hk-sidebar-open > header .top-bar { width: calc(100% - 20px); max-width: 1400px; min-height: 61px; height: auto; flex-wrap: wrap; padding: 5px 8px; }
body.hk-sidebar-open > header .btn-menu-tall { display: none !important; }
body.hk-sidebar-open > main { margin-left: var(--hk-beta-sidebar-width); min-width: 0; }
body.hk-sidebar-open > main > .grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
body.hk-sidebar-open .special-menu-wrap { grid-template-columns: minmax(0,1fr); }
body.hk-sidebar-open .special-menu-summary { position: relative; top: auto; max-height: none; order: -1; }
body.hk-sidebar-open .special-menu-summary-list { max-height: 180px; }
@media (min-width: 701px) {
    body.hk-sidebar-beta:not(.hk-sidebar-open) > main > .grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 1100px) {
    body.hk-sidebar-open > header .top-bar { gap: 5px; padding: 5px; }
    body.hk-sidebar-open > header .info-pill { padding: 0 7px; gap: 4px; }
    body.hk-sidebar-open > header .info-pill .table-info { min-width: 32px; }
    body.hk-sidebar-open > header .info-pill .menu-info { min-width: 56px; }
    body.hk-sidebar-open > header .info-pill .table-info + .table-info { padding-left: 4px; }
    body.hk-sidebar-open > header .table-info-number { font-size: 1.06rem; }
    body.hk-sidebar-open > header .btn-cart-floating { width: 145.2px; min-width: 145.2px; font-size: .82rem; }
    body.hk-sidebar-open > header .btn-cart-floating #cart-label { left: 9px; width: 76px; min-width: 76px; }
    body.hk-sidebar-open > header .btn-cart-floating #cart-badge { right: 9px; }
    body.hk-sidebar-open > header .header-group, body.hk-sidebar-open > header .right-icons { gap: 5px; }
    body.hk-sidebar-open > main > .grid { gap: 10px; padding: 10px; padding-bottom: 80px; }
}
/* Keep narrow phones usable; the tablet beta remains three/four columns. */
@media (max-width: 700px) {
    body.hk-sidebar-beta { --hk-beta-sidebar-width: min(218.5px, 45.6vw); }
    body.hk-sidebar-beta #menuOverlay .sidebar-cat-link > img { display: none; }
    body.hk-sidebar-beta #menuOverlay .sidebar-cat-link.has-category-photo { grid-template-columns: minmax(0,1fr); }
    body.hk-sidebar-beta #menuOverlay .sidebar-cat-link.has-category-photo > .cat-text-wrap { grid-column: 1; }
    body.hk-sidebar-beta #menuOverlay .sidebar-cat-link.has-category-workload { grid-template-columns: auto minmax(0,1fr); }
    body.hk-sidebar-beta #menuOverlay .sidebar-cat-link.has-category-workload > .cat-text-wrap { grid-column: 2; }
    body.hk-sidebar-open > main > .grid { grid-template-columns: minmax(0,1fr); }
    body.hk-sidebar-open > header .top-bar { border-radius: 18px; }
    body.hk-sidebar-open > header .right-icons { margin-left: 0; flex-wrap: wrap; }
    body.hk-sidebar-beta #menuOverlay .category-workload-guide-icon { display: none; }
}

/* Refinement: sidebar owns table context and Staff tools. */
body.hk-sidebar-open > header .info-pill { display: none !important; }
body.hk-sidebar-beta #menuOverlay .category-workload-note { display: none !important; }
body.hk-sidebar-beta #menuOverlay .overlay-info-group { flex-wrap: wrap; gap: 6px; line-height: 1.3; }
body.hk-sidebar-beta #menuOverlay .hk-beta-menu-footer {
    grid-column: 1 / -1; padding: 12px 0 calc(4px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(15,23,42,.12); background: var(--theme-categories-bg);
}
body.hk-sidebar-beta #menuOverlay .hk-beta-menu-footer .btn-admin-menu {
    width: 100%; min-height: 44px; padding: 10px 18px; font-size: .88rem;
}
body.hk-sidebar-beta.hk-sidebar-motion-ready #menuOverlay {
    transition: transform .7s cubic-bezier(.25,.1866666667,.75,1), opacity .7s cubic-bezier(.25,.1866666667,.75,1), visibility 0s linear .7s !important;
}
body.hk-sidebar-beta.hk-sidebar-motion-ready #menuOverlay.open {
    transition: transform .7s cubic-bezier(.25,.1866666667,.75,1), opacity .7s cubic-bezier(.25,.1866666667,.75,1), visibility 0s !important;
}
html.hk-beta-motion-clip { overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) {
    body.hk-sidebar-beta.hk-sidebar-motion-ready #menuOverlay,
    body.hk-sidebar-beta.hk-sidebar-motion-ready #menuOverlay.open { transition: none !important; }
}

body.hk-sidebar-beta > header .btn-mobile-color { width: auto; flex-shrink: 0; padding: 0 14px !important; font-size: .9rem; font-weight: 700; }
body.hk-sidebar-beta > header .mobile-order-copy { display: block; }

/* In the sidebar layout, fixed-menu choices precede their complete summary. */
body.hk-sidebar-open .special-menu-fixed > .special-menu-summary { order: 1; }
body.hk-sidebar-open .special-menu-fixed > .special-menu-summary .special-menu-summary-list { max-height: none; }

/* Give the cart more room and keep its enlarged counter inside the right edge. */
body.hk-sidebar-beta > header .btn-cart-floating { width: 178.2px; min-width: 178.2px; }
body.hk-sidebar-beta > header .btn-cart-floating #cart-badge { transform-origin: right center; }
@media (max-width: 1100px) {
    body.hk-sidebar-beta.hk-sidebar-open > header .btn-cart-floating { width: 145.2px; min-width: 145.2px; }
}

/* Smaller addition message; the normal and removal labels keep their size. */
body.hk-sidebar-beta > header .btn-cart-floating.cart-add-feedback #cart-label { font-size: .72675rem; }

/* Stable native catalog scrolling prevents iOS page momentum from capturing the sidebar. */
body.hk-sidebar-beta { position: relative; height: 100vh; height: 100dvh; overflow: hidden; padding-top: 0; }
body.hk-sidebar-beta.hk-sidebar-open { padding-top: 0; }
body.hk-sidebar-beta > main {
    position: absolute; top: var(--hk-beta-header-height,71px); bottom: 0;
    left: 0; right: 0; margin-left: 0;
    overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch; touch-action: pan-y;
}
body.hk-sidebar-beta.hk-sidebar-open > main { left: var(--hk-beta-sidebar-width); margin-left: 0; }
body.hk-sidebar-beta > main > .main-category-title { margin-top: 15px; }
body.hk-sidebar-beta.hk-sidebar-open > main > .main-category-title { margin-top: 10px; }
body.hk-sidebar-beta.tablet-overlay-page-locked > main { overflow-y: hidden; }
body.hk-sidebar-beta > main .special-menu-section { scroll-margin-top: max(12px, calc(96px - var(--hk-beta-header-height,71px))); }

/* Keep the scrolling catalog opaque: loading still blocks purchases as before. */
body.hk-sidebar-beta > main.category-loading { opacity: 1 !important; transition: none; }

/* A small stationary veil softens the catalog edge without compositing the catalog. */
body.hk-sidebar-beta > header .top-bar::after {
    content: ''; position: absolute; top: calc(100% + 1px); left: 50%;
    width: 100vw; height: 15px; transform: translateX(-50%);
    background: var(--bg, #ebebeb);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 2px, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 2px, transparent 100%);
    pointer-events: none;
}
body.hk-sidebar-beta.hk-sidebar-open > header .top-bar::after {
    width: calc(100vw - var(--hk-beta-sidebar-width));
}

/* Personalized poke: all choices precede the complete summary in the beta. */
body.hk-sidebar-beta .special-menu-wrap[data-menu-code="poke"] { grid-template-columns: minmax(0,1fr); }
body.hk-sidebar-beta .special-menu-wrap[data-menu-code="poke"] > .special-menu-summary { order: 1; position: relative; top: auto; max-height: none; }
body.hk-sidebar-beta .special-menu-wrap[data-menu-code="poke"] > .special-menu-summary .special-menu-summary-list { max-height: none; overflow: visible; }

body.hk-sidebar-beta #menuOverlay #btn-allergen-filter {
    background: #ffd8a8 !important; color: #663c17;
}

/* Preserve the full search control and show assistance text only in landscape. */
body.hk-sidebar-beta > header .btn-search-header { flex: 0 0 auto; width: auto; min-width: 56px; justify-content: center; padding: 0 15px; }
body.hk-sidebar-beta > header .btn-call-waiter { flex: 0 0 auto; transition: none; }
body.hk-sidebar-beta > header .hk-assistance-label { display: none !important; font-size: .78rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
body.hk-sidebar-beta.hk-sidebar-open > header #btn-cameriere { display: flex !important; }
@media (orientation: landscape) {
    body.hk-sidebar-beta.hk-sidebar-open > header .btn-call-waiter { width: 114px; gap: 5px; padding: 0 10px; overflow: hidden; transition: none; }
    body.hk-sidebar-beta.hk-sidebar-open > header .hk-assistance-label { display: inline-flex !important; }
}
@media (orientation: portrait) {
    body.hk-sidebar-beta.hk-sidebar-open > header .btn-call-waiter { width: 50px; gap: 0; padding: 0; overflow: visible; transition: none; }
}
/* Keep the first category compact and protect an overhanging Max badge. */
body.hk-sidebar-beta #menuOverlay .menu-grid-container.has-workload-indicators > .category-group-heading:first-child { margin-top: 0; }
body.hk-sidebar-beta #menuOverlay .menu-grid-container.has-workload-indicators > .sidebar-cat-link.has-category-limit:first-child { margin-top: 18px; }

/* A compact gap still leaves room for the iOS-style Max badge above the card. */
body.hk-sidebar-beta #menuOverlay .menu-grid-container > .sidebar-cat-link.has-category-limit { margin-top: 7.8px; }
body.hk-sidebar-beta #menuOverlay .sidebar-cat-link:not(.active-cat) { background: #edf1f4 !important; border-color: #d7dfe3 !important; }
body.hk-sidebar-beta.hk-sidebar-open #menuOverlay .hk-category-hide-arrow { animation: hkCategoryHideHint 1.3s ease-in-out infinite; }
@keyframes hkCategoryHideHint { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-5px); } }
@media (prefers-reduced-motion: reduce) { body.hk-sidebar-beta.hk-sidebar-open #menuOverlay .hk-category-hide-arrow { animation: none; } }

/* Match the category corners and reserve space for Max with symmetric margins. */
body.hk-sidebar-beta > header .top-bar { width: calc(100% - 20px); margin-left: auto; margin-right: 10px; padding-right: 8px; }
body.hk-sidebar-beta #menuOverlay .hk-beta-menu-close,
body.hk-sidebar-beta #menuOverlay #btn-allergen-filter,
body.hk-sidebar-beta #menuOverlay #btn-text-size { border-radius: 14px; }
body.hk-sidebar-beta #menuOverlay .category-limit-circle { right: -14px; }
body.hk-sidebar-beta #menuOverlay .menu-grid-container { padding-right: max(0px, calc(16px - var(--hk-sidebar-scrollbar-width, 0px))); }
body.hk-sidebar-beta #menuOverlay .category-limit-circle { right: calc(-14px + var(--hk-sidebar-scrollbar-width, 0px)); }
body.hk-sidebar-beta #menuOverlay .hk-category-hide-arrow { display: inline-flex; width: 34px; height: 18px; flex: 0 0 34px; }
body.hk-sidebar-beta #menuOverlay .hk-category-hide-arrow svg { width: 100%; height: 100%; }
body.hk-sidebar-beta #menuOverlay .hk-beta-menu-close:active { transform: scale(.965); background: #136b3d; }
body.hk-sidebar-beta #cartOverlay .cart-tab { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
body.hk-sidebar-beta #cartOverlay .cart-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 25px; padding: 2px 7px; border-radius: 999px; background: rgba(100,116,139,.13); color: inherit; font-weight: 900; font-variant-numeric: tabular-nums; }

/* Only the small toolbar surface expands; its actual controls never stretch. */
body.hk-sidebar-beta > header .top-bar.hk-toolbar-surface-ready { background: transparent !important; border-color: transparent !important; box-shadow: none; }
body.hk-sidebar-beta > header .top-bar > .hk-toolbar-surface {
    position: absolute; inset: -1px; z-index: 0; pointer-events: none;
    border-radius: inherit; background: var(--theme-toolbar-bg);
    border: 1px solid #dbe3ef;
    box-shadow: 0 8px 24px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.42), inset 0 -1px 0 rgba(255,255,255,.12);
}
/* Keep the existing loading colour/spinner; the finite press owns the scale. */
body.hk-sidebar-beta #menuOverlay .sidebar-cat-link.category-click-feedback { transform: none; }

/* A small composited capsule keeps cart sizing off the layout/raster path. */
body.hk-sidebar-beta > header .btn-cart-floating.hk-cart-surface-ready { isolation: isolate; background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
body.hk-sidebar-beta > header .hk-cart-motion-surface { position: absolute; inset: -1px; z-index: -1; border-radius: inherit; background: var(--theme-toolbar-button-bg); border: 1px solid rgba(255,255,255,.28); pointer-events: auto; }
body.hk-sidebar-beta > header .cart-add-feedback > .hk-cart-motion-surface { background: #16a34a; }
body.hk-sidebar-beta > header .cart-remove-feedback > .hk-cart-motion-surface { background: #dc2626; }

/* Seal the short gap beside the closed toolbar's rounded lower corners.
   The catalog starts at the header edge, six pixels before the existing veil. */
body.hk-sidebar-beta:not(.hk-sidebar-open) > header::before {
    content: ''; position: absolute; top: calc(100% - 2px); left: -2px; right: -2px; height: 10px;
    background: var(--bg, #ebebeb); pointer-events: none; z-index: -1;
}

/* Two pixels of overdraw avoid fractional raster seams at the closed veil edge. */
body.hk-sidebar-beta:not(.hk-sidebar-open) > header .top-bar::after {
    width: calc(100vw + 4px);
}
