/* Floating menu: the turning badge and the blue sheet it opens (menu-sheet.js). */

/* ---------- Badge ---------- */
.menu-fab {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: var(--z-fab);                              /* under the nav overlay and the theme's hamburger (10) */
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--shop-blue);
  color: var(--paper);
  box-shadow: 0 0 0 3px var(--paper), var(--shadow-2);   /* the paper ring keeps it visible on the blue sections too */
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(.7);
  transition: opacity .3s ease, transform .45s var(--ease-out), visibility 0s linear .45s;
}
.menu-fab.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .3s ease, transform .45s var(--ease-out), visibility 0s;
}
body:has(.m-header__menu-mobile.active) .menu-fab,
html.menu-sheet-open .menu-fab {
  opacity: 0;
  visibility: hidden;
}
.menu-fab-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: menu-fab-turn 16s linear infinite;
  animation-play-state: paused; /* the badge (and its ring) is display:none-equivalent (opacity 0 + hidden)
                                    until .is-visible; no point spinning it off screen */
}
.menu-fab.is-visible .menu-fab-ring {
  animation-play-state: running;
}
.menu-fab-ring text {
  fill: currentColor;
  font-family: var(--outfit);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
}
.menu-fab-skewer {
  position: relative;
  width: 62%;
  height: auto;
  transform: rotate(-38deg);
  filter: drop-shadow(0 3px 4px rgba(16, 26, 67, .45));
  transition: transform .45s var(--ease-out);
  pointer-events: none;
}
@keyframes menu-fab-turn {
  to {
    transform: rotate(360deg);
  }
}
@media (hover: hover) {
  .menu-fab:hover .menu-fab-skewer {
    transform: rotate(-18deg) scale(1.08);
  }
  .menu-fab:hover .menu-fab-ring {
    animation-duration: 6s;
  }
}
.menu-fab:active {
  transform: scale(.94);
  transition-duration: .12s;
}
/* Fixed over every section colour as the page scrolls: a single outline colour can't promise 3:1
   against both paper and blue backgrounds, so the focus ring is a paper/blue sandwich instead —
   one of the two rings always contrasts with whatever is behind it (same technique as the fixed
   hamburger button in styles.css). */
.menu-fab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--shop-blue), var(--shadow-2);
}
@media (forced-colors: active) {
  .menu-fab {
    border: 1px solid ButtonText;
  }
  .menu-fab:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 3px;
  }
}

/* ---------- Badge: "what is this?" cue (menu-sheet.js adds .is-new until the menu has been opened once) ---------- */
.menu-fab-cue {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px 11px 16px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--shop-blue);
  box-shadow: 0 0 0 2px var(--shop-blue), 0 10px 24px -10px rgb(16 26 67 / .55);   /* the blue edge reads on blue sections too */
  font-family: var(--outfit), sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(10px, -50%) scale(.92);
  transform-origin: right center;
  transition: opacity .3s ease, transform .45s var(--ease-out);
}
.menu-fab-cue svg {
  width: 15px;
  height: 15px;
}
.menu-fab.is-visible.is-new .menu-fab-cue {
  opacity: 1;
  transform: translate(0, -50%);
  transition-delay: .35s;                           /* after the badge itself has arrived */
}
.menu-fab.is-visible.is-new .menu-fab-cue svg {
  animation: menu-fab-point 1.4s ease-in-out .8s infinite;
}
@media (hover: hover) {
  .menu-fab.is-visible:hover .menu-fab-cue {
    opacity: 1;
    transform: translate(0, -50%);
  }
}
/* pulse: two rings radiate from the badge, blue on paper so one of them shows on any section */
.menu-fab::before,
.menu-fab::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}
.menu-fab::before {
  border: 3px solid var(--shop-blue);
}
.menu-fab::after {
  border: 2px solid var(--paper);
}
.menu-fab.is-visible.is-new::before {
  animation: menu-fab-pulse 2.4s cubic-bezier(.2, .7, .3, 1) .6s infinite;
}
.menu-fab.is-visible.is-new::after {
  animation: menu-fab-pulse 2.4s cubic-bezier(.2, .7, .3, 1) .9s infinite;
}
/* nudge: a small hop every few seconds */
.menu-fab.is-visible.is-new {
  animation: menu-fab-nudge 5s ease-in-out 1.6s infinite;
}
@keyframes menu-fab-pulse {
  0%   { opacity: .9; transform: scale(1); }
  80%  { opacity: 0; transform: scale(1.55); }
  100% { opacity: 0; transform: scale(1.55); }
}
@keyframes menu-fab-nudge {
  0%, 84%, 100% { translate: 0 0; rotate: 0deg; }
  88% { translate: 0 -10px; rotate: -8deg; }
  92% { translate: 0 0; rotate: 6deg; }
  95% { translate: 0 -4px; rotate: -3deg; }
}
@keyframes menu-fab-point {
  0%, 100% { translate: 0 0; }
  50% { translate: 4px 0; }
}
@media (max-width: 899px) {
  .menu-fab-cue {
    right: calc(100% + 10px);
    padding: 10px 12px 10px 14px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .menu-fab.is-visible.is-new,
  .menu-fab.is-visible.is-new::before,
  .menu-fab.is-visible.is-new::after,
  .menu-fab.is-visible.is-new .menu-fab-cue svg {
    animation: none;
  }
  .menu-fab-cue {
    transition: opacity .15s ease;
  }
}
@media (forced-colors: active) {
  .menu-fab-cue {
    border: 1px solid ButtonText;
  }
}

/* ---------- Sheet ---------- */
/* The page scroll lock is Lenis (stopped while the sheet is open) plus overscroll-behavior on the
   sheet's own scroller. Never flip `html` overflow here: it moves the scrolling element and unpins every
   position: sticky section (scroll reel, food show), and Safari keeps them unpinned after the sheet closes. */
.menu-sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--shop-blue);
  color: var(--paper);
  text-align: left;                                  /* the theme centres body text on phones */
  overflow: hidden;
  --focus-ring: var(--paper); /* the whole sheet is blue */
}
.menu-sheet::backdrop {
  background: transparent;                           /* the circle itself is the reveal */
}
.menu-sheet::before {                                /* same paper grain as the page, over the blue */
  content: "";
  position: absolute;
  inset: 0;
  z-index: var(--z-lift);
  pointer-events: none;
  background: url("../assets/paper-grain.webp") repeat 0 0 / 135px 107px;
  opacity: .12;
}
.menu-sheet-scroll {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(28px, 5vw, 72px) clamp(20px, 6vw, 96px) calc(140px + env(safe-area-inset-bottom));
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 240, 230, .35) transparent;
}
.menu-sheet :is(a, button):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Head */
.menu-sheet-head {
  display: grid;
  grid-template-columns: 1fr minmax(0, 34ch);
  align-items: end;
  gap: 8px 48px;
  padding-bottom: clamp(24px, 3vw, 40px);
  border-bottom: 2px solid var(--paper);
}
.menu-sheet-kicker {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .78;
}
.menu-sheet-title {
  margin: 0;
  font-family: var(--veneer);
  font-size: clamp(72px, 11vw, 168px);
  line-height: .86;
  text-transform: uppercase;
  color: var(--paper);
}
.menu-sheet-aside {
  max-width: 34ch;
  padding-bottom: 10px;
  font-size: 16px;
  line-height: 1.5;
}

/* Body: sticky index beside every category */
.menu-sheet-body {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: clamp(32px, 5vw, 80px);
  padding-top: clamp(28px, 4vw, 48px);
}
.menu-sheet-index {
  position: sticky;
  top: 24px;
  align-self: start;
}
.menu-sheet-index ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.menu-sheet-link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-height: 44px;
  padding: 6px 0;
  color: var(--paper);
  text-decoration: none;
  opacity: .58;
  transition: opacity .2s ease, transform .3s var(--ease-out);
}
.menu-sheet-num {
  min-width: 2ch;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.menu-sheet-label {
  font-family: var(--veneer);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1;
  text-transform: uppercase;
}
.menu-sheet-link[aria-current] {
  opacity: 1;
  transform: translateX(10px);
}
@media (hover: hover) {
  .menu-sheet-link:hover {
    opacity: 1;
  }
}

/* Sections */
.menu-sheet-section + .menu-sheet-section {
  margin-top: clamp(40px, 5vw, 72px);
}
.menu-sheet-heading {
  margin: 0;
  font-family: var(--veneer);
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: .95;
  text-transform: uppercase;
  color: var(--paper);
}
.menu-sheet-note {
  max-width: 50ch;
  margin-top: 8px;
  font-size: 15px;
  opacity: .82;
}
.menu-sheet .menu-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0 40px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.menu-sheet .menu-items li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 64px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(244, 240, 230, .22);
}
.menu-sheet .menu-items li.has-photo {
  padding: 0;
}
.menu-sheet .menu-item-name {
  display: block;
  font-size: 17px;
  font-weight: 500;
}
.menu-sheet .menu-item-note {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  opacity: .78;
}
.menu-sheet .menu-item-price {
  color: var(--paper);
  font-size: 16px;
}
.menu-sheet :is(.menu-item-option, .menu-item-grid) {
  background: rgba(244, 240, 230, .12);
}
.menu-sheet :is(.menu-item-option, .menu-item-grid) .menu-item-price {
  font-size: 14px;
}
.menu-sheet .menu-item-button {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 64px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}
.menu-sheet .menu-item-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: transform .25s var(--ease-out);
}
.menu-sheet .menu-item-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s var(--ease-out);
}
.menu-sheet .menu-item-zoom {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: var(--shop-blue);
  color: var(--paper);
}
@media (hover: hover) {
  .menu-sheet .menu-item-button:hover .menu-item-thumb {
    transform: translateY(-2px) rotate(-2deg);
  }
  .menu-sheet .menu-item-button:hover .menu-item-photo {
    transform: scale(1.08);
  }
}
.menu-sheet .menu-item-button:active .menu-item-thumb {
  transform: scale(.96);
}

/* Foot: from browsing to ordering */
.menu-sheet-foot {                                  /* lines up with the index | sections grid above */
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 24px clamp(32px, 5vw, 80px);
  margin-top: clamp(48px, 6vw, 88px);
  padding-top: 28px;
  border-top: 2px solid var(--paper);
}
.menu-sheet-call {
  font-family: var(--veneer);
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: .95;
  text-transform: uppercase;
}
.menu-sheet-shops {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px 40px;
}
.menu-sheet-shop-name {
  margin: 0;
  font-family: var(--veneer);
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--paper);
}
.menu-sheet-address {
  margin-top: 8px;
  font-size: 16px;
  font-style: normal;
  line-height: 1.5;
  opacity: .85;
}
.menu-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 16px;
}
.menu-sheet-phone {                                  /* the one filled button per shop: calling is the main ask */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--shop-blue);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: transform .15s var(--ease-out);
}
.menu-sheet-directions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--paper);
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.menu-sheet-directions svg {
  width: 16px;
  height: 16px;
  transition: transform .25s var(--ease-out);
}
@media (hover: hover) {
  .menu-sheet-directions:hover svg {
    transform: translate(2px, -2px);
  }
}
.menu-sheet-phone:active {
  transform: scale(.97);
}
.menu-sheet-shop .menu-order-apps {
  margin-top: 16px;
}
.menu-sheet .menu-order-app:focus-visible {
  outline-color: var(--focus-ring);
}
.menu-sheet-pay {                                    /* under the two shops, same column */
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding-top: 24px;
  border-top: 1px solid rgba(244, 240, 230, .22);
}
.menu-sheet-pay-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.menu-sheet-fine {
  flex-basis: 100%;
  font-size: 13px;
  opacity: .75;
}

/* Close sits exactly where the badge was, so the circle closes into it */
.menu-sheet-close {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right) + 10px);
  bottom: calc(16px + env(safe-area-inset-bottom) + 10px);
  z-index: var(--z-front);
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--shop-blue);
  box-shadow: var(--shadow-2);
  transition: transform .15s var(--ease-out);
}
.menu-sheet-close svg {
  width: 26px;
  height: 26px;
}
.menu-sheet-close:active {
  transform: scale(.92);
}
.menu-sheet-close:focus-visible {
  outline-color: var(--focus-ring);
  outline-offset: 5px;
}
@media (forced-colors: active) {
  .menu-sheet-close,
  .menu-sheet-phone {
    border: 1px solid ButtonText;
  }
}

/* ---------- Phone ---------- */
@media (max-width: 899px) {
  .menu-fab {
    width: 78px;
    height: 78px;
  }
  .menu-fab-ring text {
    font-size: 11px;
  }
  .menu-sheet-close {
    right: calc(16px + env(safe-area-inset-right) + 7px);
    bottom: calc(16px + env(safe-area-inset-bottom) + 7px);
    width: 64px;
    height: 64px;
  }
  .menu-sheet-scroll {
    padding: 24px 16px calc(112px + env(safe-area-inset-bottom));
  }
  .menu-sheet-head {
    grid-template-columns: 1fr;
  }
  .menu-sheet-title {
    font-size: clamp(64px, 20vw, 104px);
  }
  .menu-sheet-aside {
    font-size: 15px;
  }
  .menu-sheet-body {
    display: block;
    padding-top: 0;
  }
  .menu-sheet-index {                                /* the index becomes a strip stuck to the top of the sheet */
    top: -24px;                                      /* = the scroller's top padding, so rows can't show above the strip */
    z-index: var(--z-raised);
    margin: 0 -16px;
    padding: 12px 0;
    background: var(--shop-blue);
    box-shadow: 0 12px 16px -12px rgba(16, 26, 67, .6);
  }
  .menu-sheet-index ol {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .menu-sheet-index ol::-webkit-scrollbar {
    display: none;
  }
  .menu-sheet-link {
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(244, 240, 230, .4);
    white-space: nowrap;
    opacity: 1;
  }
  .menu-sheet-link[aria-current] {
    transform: none;
    background: var(--paper);
    color: var(--shop-blue);
    box-shadow: none;
  }
  .menu-sheet-num {
    display: none;
  }
  .menu-sheet-label {
    font-family: var(--outfit);
    font-size: 14px;
    font-weight: 500;
    text-transform: none;
  }
  .menu-sheet-sections {
    padding-top: 24px;
  }
  .menu-sheet .menu-items {
    grid-template-columns: 1fr;
  }
  .menu-sheet .menu-item-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
  }
  .menu-sheet-foot {
    grid-template-columns: 1fr;
  }
  .menu-sheet-shops {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .menu-sheet-pay {
    grid-column: 1;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .menu-fab-ring {
    animation: none;
  }
  .menu-fab,
  .menu-fab.is-visible {
    transform: none;
    transition: opacity .15s ease, visibility 0s;
  }
  .menu-fab-skewer,
  .menu-sheet-link,
  .menu-sheet .menu-item-thumb,
  .menu-sheet .menu-item-photo,
  .menu-sheet-directions svg {
    transition: none;
  }
}
