/* Shop view: the week banner, the allergen drawer and the basket pill (concept B, Matt 26 Oct 2026; prototype docs/concepts/2026-10-26-shop-B-interactive.html,
   DMS 3298534926701; L20). Loads on /order/ after shop.css. PRESENTATION ONLY: the allergen filter keeps its markup and logic (js/site.js: input[name="allergen"],
   #filter-status, #clear-filters) and the basket keeps its (js/order-flow.js: #basket-open / #basket-count / #basket-price, #basket-dialog, [data-open-basket]);
   this sheet and js/shop-top.js only dress what they paint. Every number shown comes from site.json / menu.json through pages.mjs, never from the prototype. */

/* ---------- the week banner (deep green, the page's one bold panel) ---------- */
.shop-top { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px 32px; align-items: end; margin: 0 0 14px; padding: 28px 34px 24px; border-radius: 18px; background: var(--green-deep); color: var(--white); }   /* 18px: the top of the site's declared radius scale (design-spec.json), not the prototype's 28px */
.shop-top-count { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--mint-text); }
.shop-top-count:empty { display: none; }
.shop-top h2 { margin: 0 0 10px; font-family: var(--display); font-size: 35px; font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; color: var(--white); }
.shop-top-facts { margin: 0; max-width: 62ch; font-size: 16px; line-height: 1.5; color: var(--mint-text); }
.shop-top-facts + .shop-top-facts { margin-top: 4px; }
.shop-top-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 0; }

/* The category chips are the existing .product-filters (css/extras.css), re-dressed as pills on the green. */
.shop-top .product-filters { position: static; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: 0; padding: 0; background: transparent; border: 0; }
.shop-top .product-filters button[data-product-filter],
.shop-top .chip-toggle { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0; padding: 8px 16px; border: 1.5px solid var(--mint-text); border-radius: 999px; background: transparent; color: var(--mint-text); font-family: var(--body); font-size: 16px; font-weight: 600; line-height: 1.2; box-shadow: none; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.shop-top .product-filters button[data-product-filter]:hover { background: transparent; border-color: var(--white); color: var(--white); }
/* Text on the brand pink is ink (#071a10, 5.32:1), never white (3.39:1) or deep green (3.69:1) — the same pairing as the home "Order Here" button (site.css). L24, 26 Oct 2026. */
.shop-top .product-filters button[aria-pressed="true"], .shop-top .product-filters button[aria-pressed="true"]:hover { background: var(--pink); border-color: var(--pink); color: var(--ink); }
.shop-top .chip-toggle { background: var(--white); border-color: var(--white); color: var(--green-deep); }
.shop-top .chip-toggle:hover, .shop-top .chip-toggle[aria-expanded="true"] { background: var(--mint-light); border-color: var(--mint-light); }
.shop-top .chip-toggle .chip-n { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: var(--ink); font-size: 13px; font-weight: 700; }
.shop-top .chip-toggle .chip-n[hidden] { display: none; }
.shop-top .chip-toggle svg { flex: none; transition: transform 0.2s ease; }
.shop-top .chip-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.shop-top .product-filters :focus-visible, .shop-top .chip-toggle:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }

/* ---------- the allergen drawer: the same <details> the filter always had, opened by the banner chip ---------- */
.shop-filter { margin: 0 0 16px; }
.shop-filter .allergen-filter-box { margin: 0; border: 0; border-radius: var(--radius); background: var(--mint-light); }
.shop-filter .allergen-filter-box > summary { display: none; }
.shop-filter .allergen-filter-box .allergen-filter { border: 0; padding: 14px 16px 12px; }
.shop-filter .allergen-filter legend { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--green-deep); }
.shop-filter .filter-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; overflow: visible; }
.shop-filter .filter-choice { gap: 8px; min-height: 40px; min-width: 0; padding: 8px 14px; border: 1.5px solid var(--hairline); border-radius: 999px; background: var(--white); color: var(--green-deep); font-size: 16px; font-weight: 600; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.shop-filter .filter-choice:hover { border-color: var(--green-deep); }
.shop-filter .filter-choice:has(:checked) { background: var(--pink); border-color: var(--pink); color: var(--ink); font-weight: 600; }
.shop-filter .filter-choice input { margin: 0; width: 16px; height: 16px; accent-color: var(--pink); }
.shop-filter .filter-choice:has(:checked) input { accent-color: var(--white); }
.shop-filter .filter-choice:has(:focus-visible) { outline: 3px solid var(--pink); outline-offset: 2px; }
.shop-filter #clear-filters { margin-left: auto; min-height: 40px; padding: 8px 16px; border: 1.5px solid var(--green-deep); border-radius: 999px; background: transparent; color: var(--green-deep); font-size: 16px; font-weight: 700; }
.shop-filter #clear-filters:hover { background: var(--green-deep); color: var(--white); }
.shop-filter #clear-filters[hidden] { display: none; }
.shop-filter .allergen-drawer-note { margin: 10px 0 0; font-size: 16px; font-style: italic; line-height: 1.45; color: var(--green-text); }
.shop-filter .allergen-drawer-note[hidden] { display: none; }

/* The shop view carries the facts in the banner: the ledger keeps only its "last updated" line, as a quiet line. The checkout view keeps the full ledger and hides the banner. */
html[data-shop-live][data-shop-view="shop"] .cutoff-ledger { margin: 0 0 18px; padding: 0; border: 0; background: transparent; }
html[data-shop-live][data-shop-view="shop"] .cutoff-ledger .menu-delivery { display: none; }
html[data-shop-live][data-shop-view="shop"] .cutoff-ledger .menu-date { font-size: 16px; font-weight: 500; color: var(--muted); }
html[data-shop-live][data-shop-view="checkout"] :is(.shop-top, .shop-filter) { display: none !important; }

/* ---------- the basket pill (bottom right; a full-width bar on phones) ---------- */
.shop-pill { position: fixed; right: 32px; bottom: 32px; z-index: 55; display: inline-flex; align-items: center; gap: 18px; padding: 8px 8px 8px 22px; border: 0; border-radius: 999px; background: var(--green-deep); color: var(--white); font-family: var(--body); text-align: left; box-shadow: 0 12px 32px rgba(7, 26, 16, 0.32); cursor: pointer; }
.shop-pill[hidden],
html:not([data-shop-live]) .shop-pill,
html[data-shop-live]:not([data-shop-view="shop"]) .shop-pill,
html.dialog-open .shop-pill,
html:has(dialog[open]) .shop-pill { display: none !important; }
.shop-pill-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.shop-pill-amt { font-size: 16px; font-weight: 700; line-height: 1.25; white-space: nowrap; font-variant-numeric: tabular-nums; }
.shop-pill-sub { font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--mint-text); white-space: nowrap; }
.shop-pill-sub:empty { display: none; }
.shop-pill-go { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--pink); color: var(--ink); font-size: 16px; font-weight: 700; transition: background-color 0.15s ease; }
.shop-pill:hover .shop-pill-go { background: #ec3884; }   /* ink on #ec3884 = 4.69:1 (the old #e8347f was 4.49:1) */
.shop-pill:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .shop-pill.is-bump { animation: shop-pill-bump 0.3s ease; }
  @keyframes shop-pill-bump { 50% { transform: scale(1.04); } }
}
/* Room under the page and the footer while the pill is up, so it never sits on the last card or a footer link; the toast moves above it. */
html[data-shop-live][data-shop-view="shop"]:has(.shop-pill:not([hidden])) main { padding-bottom: 120px; }
html[data-shop-live][data-shop-view="shop"]:has(.shop-pill:not([hidden])) .site-footer { padding-bottom: 112px; }
html[data-shop-live][data-shop-view="shop"]:has(.shop-pill:not([hidden])) .shop-toast { bottom: 108px; }

/* ---------- the basket panel: #basket-dialog, rendered by order-flow.js, dressed as the prototype's panel ---------- */
#basket-dialog { width: min(440px, 100vw); border-left: 0; background: var(--white); }
#basket-dialog .dialog-head { padding: 18px 14px 14px 24px; background: var(--white); border-bottom: 1px solid var(--hairline); }
#basket-dialog .dialog-head h2 { font-size: 24px; letter-spacing: -0.02em; }
#basket-dialog .dialog-body { min-height: 0; padding: 6px 24px 16px; }
#basket-dialog .basket-meta { margin: 8px 0 4px; font-size: 16px; font-weight: 600; color: var(--green-text); }
#basket-dialog .basket-line { padding-block: 16px; border-top: 1px solid var(--hairline); }
#basket-dialog .basket-line img { border-radius: 10px; }
#basket-dialog .basket-line-row .money { font-variant-numeric: tabular-nums; }
#basket-dialog .drawer-foot { padding: 18px 24px calc(18px + env(safe-area-inset-bottom, 0px)); border-top: 0; background: var(--mint-light); }
#basket-dialog .basket-totals { margin: 0 0 10px; font-size: 16px; }
#basket-dialog .basket-totals > div { padding-block: 5px; }
#basket-dialog .basket-totals dt { color: var(--green-text); }
#basket-dialog .basket-totals .basket-total { margin-top: 6px; padding-top: 12px; border-top: 1px solid rgba(8, 60, 34, 0.18); font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
#basket-dialog .basket-totals .basket-total dt { color: var(--green-deep); font-weight: 600; }
#basket-dialog .basket-progress { height: 6px; margin: 0 0 12px; border-radius: 999px; background: rgba(8, 60, 34, 0.14); overflow: hidden; }
#basket-dialog .basket-progress i { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--pink); transition: width 0.25s ease; }
#basket-dialog .basket-progress.is-met i { background: var(--green-bright); }
#basket-dialog .basket-note { margin: 0 0 12px; font-size: 16px; font-weight: 600; color: var(--green-text); }
#basket-dialog .basket-note.is-error { color: #a22934; }
#basket-dialog #checkout-start { background: var(--pink); border-color: var(--pink); color: var(--ink); }
#basket-dialog #checkout-start:hover:not(:disabled) { background: #ec3884; border-color: #ec3884; }
#basket-dialog #checkout-start:disabled { opacity: 0.55; transform: none; }
#basket-dialog .text-button.full { color: var(--green-deep); }

/* ---------- tablets and phones ---------- */
@media (max-width: 1023px) {
  .shop-top { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; padding: 22px 22px 20px; }
  .shop-top h2 { font-size: 32px; }
  .shop-top-tools { align-items: flex-start; }
  .shop-top .product-filters { justify-content: flex-start; }
}
@media (max-width: 639px) {
  .shop-top { gap: 16px; padding: 20px 18px 18px; border-radius: 18px; }
  .shop-top h2 { font-size: 26px; }
  .shop-top-tools { width: 100%; }
  .shop-top .product-filters { width: 100%; gap: 8px 6px; }   /* wraps to a second row rather than scrolling sideways (qa overflow-x) */
  .shop-top .product-filters button[data-product-filter] { padding: 8px 14px; }
  .shop-top .chip-toggle { width: 100%; justify-content: space-between; }
  .shop-filter #clear-filters { width: 100%; margin-left: 0; justify-content: center; }
  /* The pill becomes the bottom bar: count and £ on the left, Basket on the right. */
  .shop-pill { right: 0; bottom: 0; left: 0; width: auto; margin: 0; justify-content: space-between; gap: 12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) 16px; border-radius: 0; box-shadow: 0 -8px 24px rgba(7, 26, 16, 0.25); }
  html[data-shop-live][data-shop-view="shop"]:has(.shop-pill:not([hidden])) main { padding-bottom: 96px; }
  html[data-shop-live][data-shop-view="shop"]:has(.shop-pill:not([hidden])) .site-footer { padding-bottom: 96px; }
  html[data-shop-live][data-shop-view="shop"]:has(.shop-pill:not([hidden])) .shop-toast { bottom: 90px; }
  /* The panel becomes a bottom sheet. */
  #basket-dialog { inset: auto 0 0 0; width: 100%; height: auto; max-height: 92dvh; border-radius: var(--r-photo) var(--r-photo) 0 0; }
  #basket-dialog .drawer-layout { height: auto; max-height: 92dvh; }
  @media (prefers-reduced-motion: no-preference) {
    #basket-dialog[open] { animation: basket-sheet-in 0.2s ease-out; }
    @keyframes basket-sheet-in { from { transform: translateY(100%); } }
  }
}
