/* (C)2026 Badger Commerce Limited, a subsidiary of Kedos Consulting Limited */

/* Bistro: a menu-first storefront for restaurants and takeaways, layered on Brock (Bistro -> Brock -> Nova).

   Brock supplies the type (Inter), the spacing and container widths, the neutral ramp, the buttons, the
   product page, basket, mini basket, checkout and the footer; Nova's bdgr.css underneath it. This file only
   adds what a restaurant needs on top: the sticky ordering bar and its service strip, the brand layout's
   site header, the site menu's drop-downs, the footer's allergen band, and the restaurant menu's and
   table booking's public tokens (--rm-*, --tb-*) pointed at Brock's.

   The one idea that stays from the menu card is the dotted leader running each dish into its price. The
   brand colour (--color-primary, which a site's Design Brief overrides) is spent only on the buy path: Add,
   Add to order, the order bar and Checkout. A site that wants serif menu headings sets --rm-font-display
   (and --tb-font-display) in its Design Brief custom CSS. */

:root {
    /* Bistro's names for Brock's roles, so a Design Brief that re-points Nova's tokens carries through */
    --bi-paper: var(--b-surface);
    --bi-surface: var(--color-gray-100);
    --bi-ink: var(--b-ink);
    --bi-muted: var(--b-muted);
    --bi-line: var(--b-line);
    --bi-open: #1D7A45;
    --bi-paused: #9A6300;
    --bi-closed: #A23B2A;
    --bi-header-h: 64px;

    /* The restaurant menu */
    --rm-bg: var(--bi-paper);
    --rm-surface: var(--bi-surface);
    --rm-ink: var(--bi-ink);
    --rm-muted: var(--bi-muted);
    --rm-line: var(--bi-line);
    --rm-accent: var(--color-primary);
    --rm-accent-ink: var(--color-on-primary);
    --rm-radius: var(--radius-xl);
    --rm-font-display: var(--font-family-display);
    --rm-sticky-top: var(--bi-header-h);
    --rm-leader: dotted;

    /* Book a table (table-booking.css) */
    --tb-bg: var(--bi-paper);
    --tb-surface: var(--bi-surface);
    --tb-ink: var(--bi-ink);
    --tb-muted: var(--bi-muted);
    --tb-line: var(--bi-line);
    --tb-accent: var(--color-primary);
    --tb-accent-ink: var(--color-on-primary);
    --tb-ring: var(--color-primary-ring);
    --tb-danger: var(--bi-closed);
    --tb-radius: var(--radius-xl);
    --tb-font-display: var(--font-family-display);

    /* Nova's basket re-skin hooks (fragments/basketTokens) */
    --nb-ink: var(--bi-ink);
    --nb-muted: var(--bi-muted);
    --nb-line: var(--bi-line);
}

.bi-wrap {
    width: 100%; max-width: var(--container-max-width); margin-inline: auto; padding-inline: var(--container-padding);
}
.bi-skip {
    position: absolute; left: 16px; top: -48px; z-index: 100; padding: 10px 14px;
    background: var(--bi-ink); color: #fff; border-radius: 8px; font-weight: 600;
}
.bi-skip:focus { top: 8px; color: #fff; }

/* ── the sticky bar ── */
.bi-header {
    position: sticky; top: 0; z-index: 50; height: var(--bi-header-h);
    background: var(--bi-paper); border-bottom: 1px solid var(--bi-line);
}
.bi-header__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 100%; }
.bi-brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--bi-ink); text-decoration: none; }
.bi-brand:hover { color: var(--bi-ink); }
.bi-brand__logo { max-height: 40px; max-width: 140px; width: auto; }
.bi-brand__name {
    font-size: 1.375rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bi-header__tools { display: flex; align-items: center; gap: 8px; flex: none; }

.bi-more { position: relative; }
.bi-more__toggle {
    display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px;
    font-weight: 600; font-size: 0.9375rem; color: var(--bi-ink); border-radius: 999px; cursor: pointer; list-style: none;
}
.bi-more__toggle::-webkit-details-marker { display: none; }
.bi-more__toggle:hover { background: var(--bi-surface); }
.bi-more__toggle:focus-visible { outline: 2px solid var(--bi-ink); outline-offset: 2px; }
.bi-more__toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.bi-more[open] .bi-more__toggle svg { transform: rotate(180deg); }
.bi-more__panel {
    position: absolute; right: 0; top: calc(100% + 8px); width: min(320px, calc(100vw - 32px)); padding: 8px;
    background: var(--bi-paper); border: 1px solid var(--bi-line); border-radius: 12px;
    box-shadow: 0 12px 32px rgb(24 33 29 / .14);
    /* A long menu scrolls inside the panel instead of running off the bottom of the screen */
    max-height: calc(100vh - var(--bi-header-h) - 24px);
    max-height: calc(100dvh - var(--bi-header-h) - 24px);
    overflow-y: auto; overscroll-behavior: contain;
}
.bi-more__account { display: block; margin-top: 4px; padding: 12px; border-top: 1px solid var(--bi-line); color: var(--bi-ink); font-weight: 600; text-decoration: none; }
.bi-more__account:hover { color: var(--bi-ink); background: var(--bi-surface); }

/* the order link is Brock's header basket (brock-action--basket); its count and mini basket are Brock's too */
.bi-header .brock-action { min-height: 44px; }

/* ── buttons (the brand layout's header): the shared button (ui/button.html) as pills. Everywhere else
   Bistro's buttons are Brock's (brock.css). ── */
.bi-header .nova-button {
    --button-height: 40px; --button-padding: 0 18px; --button-gap: normal; --button-border-width: 1px;
    --button-radius: 999px; --button-font-size: 0.9375rem; --button-line-height: 1; --button-letter-spacing: normal;
    --button-transition: color var(--transition-fast); --button-active-transform: none;
    --button-buy-bg: var(--color-primary); --button-buy-color: var(--color-on-primary); --button-buy-hover-bg: var(--color-primary-dark);
    --button-outline-bg: transparent; --button-outline-border-color: var(--bi-ink); --button-outline-color: var(--bi-ink);
    --button-outline-hover-bg: var(--bi-ink); --button-outline-hover-color: #fff;
}
.bi-header .nova-button:focus-visible { outline: 2px solid var(--bi-ink); outline-offset: 2px; }

/* ── the site menu (templates/bistro/extensions/menuGeneratorExtension/menu.html) ──
   One markup, three places: a row in .bi-nav, an accordion in .bi-burger__body and in .bi-more__panel. */
.bi-menu { list-style: none; margin: 0; padding: 0; }
.bi-menu__item { position: relative; }
.bi-menu__row { display: flex; align-items: center; }
.bi-menu__link {
    display: inline-flex; align-items: center; gap: 4px; padding: 10px 12px; border: 0; border-radius: 999px;
    background: none; color: var(--bi-ink); font-family: inherit; font-size: 0.9375rem; font-weight: 500; line-height: 1.2; text-decoration: none;
    white-space: nowrap; cursor: pointer;
}
.bi-menu__link:hover, .bi-menu__item.is-open > .bi-menu__row > .bi-menu__link { background: var(--bi-surface); color: var(--bi-ink); }
.bi-menu__link:focus-visible { outline: 2px solid var(--bi-ink); outline-offset: 2px; }
.bi-menu__caret { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.bi-menu__item.is-open > .bi-menu__row .bi-menu__caret { transform: rotate(180deg); }
/* The item's own page, last in its panel and styled like the links around it */
.bi-menu__all { display: block; padding: 9px 12px; border-radius: 8px; color: var(--bi-ink); font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
.bi-menu__all:hover { background: var(--bi-surface); color: var(--bi-ink); }
.bi-menu__list, .bi-menu__sublist { list-style: none; margin: 0; padding: 0; }
.bi-menu__sublink { display: block; padding: 9px 12px; border-radius: 8px; color: var(--bi-ink); font-size: 0.9375rem; font-weight: 500; text-decoration: none; }
.bi-menu__sublink:hover { background: var(--bi-surface); color: var(--bi-ink); }
.bi-menu__sublink--heading, .bi-menu__heading { font-weight: 600; }
.bi-menu__heading { margin: 0; padding: 9px 12px 4px; color: var(--bi-muted); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.bi-menu__sublist { padding-left: 10px; margin-bottom: 6px; }
.bi-menu__sublist .bi-menu__sublink { padding-block: 7px; color: var(--bi-muted); font-size: 0.875rem; }

/* a row of links with drop-down panels: the brand layout's site header, from 992px */
.bi-nav { display: none; flex: 1 1 auto; min-width: 0; margin-left: 12px; }
.bi-nav .bi-menu { display: flex; align-items: center; gap: 2px; }
.bi-nav .bi-menu__panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: max-content; min-width: 220px; max-width: min(360px, 90vw);
    max-height: calc(100vh - var(--bi-header-h) - 24px); max-height: calc(100dvh - var(--bi-header-h) - 24px); overflow-y: auto;
    padding: 8px; background: var(--bi-paper); border: 1px solid var(--bi-line); border-radius: 12px;
    box-shadow: 0 12px 32px rgb(24 33 29 / .14);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.bi-nav .bi-menu__item:nth-last-child(-n+2) .bi-menu__panel { left: auto; right: 0; }
/* Without script hover and keyboard focus open a panel; with it bistro.js sets .is-open (hover intent) */
html:not(.bi-js) .bi-nav .bi-menu__item:hover > .bi-menu__panel,
.bi-nav .bi-menu__item:focus-within > .bi-menu__panel,
.bi-nav .bi-menu__item.is-open > .bi-menu__panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.bi-js .bi-nav .bi-menu__item:not(.is-open):focus-within > .bi-menu__panel { opacity: 0; visibility: hidden; }

/* an accordion: the small-screen panel and "More" */
.bi-burger__body .bi-menu__item, .bi-more__panel .bi-menu__item { border-bottom: 1px solid var(--bi-line); }
.bi-burger__body .bi-menu__link, .bi-more__panel .bi-menu__link { flex: 1; justify-content: space-between; border-radius: 8px; padding: 12px; white-space: normal; text-align: left; }
.bi-burger__body .bi-menu__link { font-size: 1.0625rem; font-weight: 600; padding-block: 14px; }
.bi-burger__body .bi-menu__panel, .bi-more__panel .bi-menu__panel { display: none; padding: 0 0 10px 8px; }
.bi-burger__body .bi-menu__item.is-open > .bi-menu__panel, .bi-more__panel .bi-menu__item.is-open > .bi-menu__panel { display: block; }
/* Without script nothing could open an accordion, so every panel is open */
html:not(.bi-js) .bi-burger__body .bi-menu__panel, html:not(.bi-js) .bi-more__panel .bi-menu__panel { display: block; }

/* ── the brand layout's site header ── */
.bi-header--site .bi-brand { flex: none; }
.bi-header--site .bi-header__tools { flex: none; gap: 8px; margin-left: auto; }
.bi-header__account { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; color: var(--bi-ink); }
.bi-header__account:hover { background: var(--bi-surface); color: var(--bi-ink); }
.bi-header__account svg, .bi-burger__toggle svg, .bi-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bi-header__book { display: none; }
.bi-header--site .bi-header__orderNow { min-height: 40px; padding: 0 16px; }
@media (max-width: 575px) { .bi-header--site .bi-brand__logo { max-width: 110px; } }

.bi-burger { position: static; }
.bi-burger__toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 40px; border-radius: 999px;
    color: var(--bi-ink); cursor: pointer; list-style: none;
}
.bi-burger__toggle::-webkit-details-marker { display: none; }
.bi-burger__toggle:hover { background: var(--bi-surface); }
.bi-burger__toggle:focus-visible { outline: 2px solid var(--bi-ink); outline-offset: 2px; }
.bi-burger__close, .bi-burger[open] .bi-burger__open { display: none; }
.bi-burger[open] .bi-burger__close { display: block; }
/* Full height under the bar, always on screen: the menu scrolls inside, the two buttons stay pinned below it */
.bi-burger__panel {
    position: fixed; left: 0; right: 0; top: var(--bi-header-h); bottom: 0; z-index: 60;
    height: calc(100vh - var(--bi-header-h)); height: calc(100dvh - var(--bi-header-h)); max-height: calc(100dvh - var(--bi-header-h));
    display: flex; flex-direction: column; background: var(--bi-paper); border-top: 1px solid var(--bi-line);
}
/* The panel lives in the header's stacking context (z-index 50): Nova's docked buy bar must sit below that or it covers the pinned buttons */
@media (max-width: 1023px) { .nova-sticky-buybar { z-index: 45; } }
.bi-burger__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px; }
.bi-burger__body .bi-menu__item:last-child { border-bottom: 0; }
.bi-burger__account { display: block; padding: 14px 12px; border-top: 1px solid var(--bi-line); color: var(--bi-ink); font-weight: 600; text-decoration: none; }
.bi-burger__foot { flex: none; display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--bi-paper); border-top: 1px solid var(--bi-line); box-shadow: 0 -8px 24px rgb(24 33 29 / .08); }
.bi-burger__foot .nova-button { flex: 1 1 0; --button-height: 48px; }
html.bi-menu-open { overflow: hidden; }

@media (min-width: 992px) {
    .bi-nav { display: block; }
    .bi-burger { display: none; }
    .bi-header__account { display: inline-flex; }
    .bi-header__book { display: inline-flex; }
}

/* ── the ordering section of a brand site: the way back to the site ── */
.bi-back {
    display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 14px 0 6px; border-radius: 999px;
    color: var(--bi-ink); font-weight: 600; font-size: 0.9375rem; text-decoration: none; white-space: nowrap;
}
.bi-back:hover { background: var(--bi-surface); color: var(--bi-ink); }
.bi-back:focus-visible { outline: 2px solid var(--bi-ink); outline-offset: 2px; }
.bi-back__short { display: none; }
@media (max-width: 575px) { .bi-back__long { display: none; } .bi-back__short { display: inline; } }

/* ── the service strip: open / closed, how long, collection or delivery ── */
.bi-service { background: var(--bi-surface); border-bottom: 1px solid var(--bi-line); }
.bi-service__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-block: 12px; }
.bi-service__status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; font-size: 0.9375rem; flex: 1 1 18rem; min-width: 0; }
.bi-service__status strong { font-weight: 700; }
.bi-service__status .rm-status__sub { margin-left: 8px; color: var(--bi-muted); }
.bi-service__dot { flex: none; align-self: center; width: 10px; height: 10px; border-radius: 50%; background: var(--bi-muted); }
.bi-service--OPEN .bi-service__dot { background: var(--bi-open); box-shadow: 0 0 0 4px rgb(29 122 69 / .16); }
.bi-service--PAUSED .bi-service__dot { background: var(--bi-paused); }
.bi-service--CLOSED .bi-service__dot { background: var(--bi-closed); }
.bi-service__prep { color: var(--bi-muted); }
@media (min-width: 768px) { .bi-service__prep::before { content: "·"; margin-right: 10px; color: var(--bi-muted); } }
@media (max-width: 767px) { .bi-service__prep { flex-basis: 100%; padding-left: 20px; } }
.bi-service .rm-mode { --rmc-bg: var(--bi-paper); --rmc-ink: var(--bi-ink); --rmc-muted: var(--bi-muted); --rmc-line: var(--bi-line); }
@media (max-width: 767px) {
    .bi-service__in { padding-block: 10px 12px; }
    .bi-service .rm-mode { width: 100%; }
}

/* ── the menu, Bistro-specific touches ── */
/* html raises these above restaurant-menu.css, which the menu extension may load again after this file */
html .rm-section__title { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 800; letter-spacing: -0.02em; }
html .rm-tab { font-size: 1rem; }
/* menu pages: the menu is the page, so Nova's section padding goes */
.nova-page-main .nova-section:has(> .rm) { padding-top: 0; }

/* Restaurant estimates other parts of the platform draw (local delivery: basket and checkout) */
.bdgr-kitchen-estimate { color: var(--bi-ink); background: var(--bi-surface); border-radius: 10px; padding: 10px 12px; font-weight: 500; }
/* the estimate under an option; the "we don't deliver" notice under the list stays muted */
.nc-option .nc-option-eta { color: var(--bi-open); font-weight: 600; }

/* ── footer: Brock's, with the allergen band (fragment/footerNotice) above its main block ── */
.bi-notice { background: var(--b-dark); color: rgba(255, 255, 255, 0.82); border-bottom: 1px solid rgb(255 255 255 / .1); }
.bi-notice__in { display: grid; gap: 6px; padding-block: 20px; }
.bi-notice a { color: #fff; }
.bi-notice__kitchen, .bi-notice__allergens { margin: 0; }
.bi-notice__allergens { max-width: 60ch; font-size: 0.9375rem; color: rgba(255, 255, 255, 0.7); }

@media (prefers-reduced-motion: reduce) {
    .bi-more__toggle svg, .bi-menu__caret, .bi-nav .bi-menu__panel { transition: none; }
}
