/* Menu page (Clover) — loaded only on /menu. Builds on the original menu styles in site.css
   (menu-hero, menu-rail, menu-section, menu-card, menu-row) and adds ordering controls. */

/* Elements toggled with the hidden attribute must stay hidden even when a rule below sets display. */
.m2 [hidden], .m2-confirm [hidden], .m2-cart [hidden], .m2-cart-backdrop[hidden], .m2-cart-fab[hidden] { display: none !important }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0 }

.m2-badge { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; max-width: 420px; margin: 18px 0 0; padding: 12px 16px; border-radius: 14px; font-size: 13px; line-height: 1.5 }
.m2-badge strong { font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 11px }
.m2-badge-test { background: #fff4d6; border: 1px solid #e9c46a; color: #6b4a00 }

.m2-state { padding-block: 10px 90px }
.m2-state-card { max-width: 640px; padding: 40px; border-radius: 26px }
.m2-state-card p { color: var(--muted) }

/* Category rail: the original sidebar, without artwork; long lists scroll inside the rail. */
.m2 .m2-rail { min-height: 0; padding: 0 }
/* The page already pads anchored scrolling (html scroll-padding-top), so sections need no extra margin. */
.m2 .menu-section { scroll-margin-top: 0 }
.m2 .m2-rail > nav { max-height: calc(100vh - 190px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin }
.m2 .m2-rail .m2-cat-toggle { display: none }

/* Search above the dishes */
.m2-search { display: block; max-width: 360px; margin-bottom: -28px }
.m2-search input { width: 100%; padding: 12px 18px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .75); color: var(--ink); font: inherit; font-size: 15px }

/* Product rows (original menu boxes) with price + Add on the right */
.m2 .m2-product { align-items: center }
.m2-product[hidden] { display: none }
.m2-row-main { min-width: 0 }
.m2 .m2-product .m2-desc { margin: 4px 0 0; color: var(--body); font-size: 14px; line-height: 1.55; letter-spacing: 0 }
.m2 .m2-product .m2-options { margin: 4px 0 0; color: var(--gold-2); font-size: 12px; letter-spacing: .04em }
.m2-row-side { display: flex; align-items: center; justify-content: flex-end; gap: 14px; white-space: nowrap }
.m2-price { color: var(--gold); font-size: 15px; font-weight: 500; letter-spacing: .04em; font-variant-numeric: tabular-nums }
.m2-price small { color: var(--muted); font-weight: 400 }
.m2-add { min-width: 76px; min-height: 42px; padding: 8px 18px; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--gold-3), var(--gold)); color: #fff; font: 500 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; transition: filter .2s, transform .2s }
.m2-add:hover { filter: brightness(1.06); transform: translateY(-1px) }
.m2-add:focus-visible, .m2-cat-toggle:focus-visible { outline: 2px solid var(--gold-3); outline-offset: 2px }
.m2-status { padding: 7px 12px; border-radius: 999px; background: rgba(91, 29, 29, .08); color: var(--maroon); font-size: 12px; letter-spacing: .06em }
.m2-product.is-unavailable h3, .m2-product.is-unavailable .m2-price { opacity: .55 }
.m2-empty-search { color: var(--muted) }

/* Cart drawer (all screen sizes) */
.m2-cart-backdrop { position: fixed; inset: 0; z-index: 59; background: rgba(42, 26, 18, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px) }
.m2-cart { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; display: flex; flex-direction: column; gap: 14px; width: min(420px, 100%); padding: 26px 24px calc(24px + env(safe-area-inset-bottom, 0px)); background: #fffdf8; border-left: 1px solid var(--line); box-shadow: -30px 0 60px -40px rgba(42, 26, 18, .6); transform: translateX(105%); visibility: hidden; transition: transform .32s var(--ease), visibility 0s .32s }
.m2-cart.is-open { transform: none; visibility: visible; transition: transform .32s var(--ease) }
.m2-cart-head { display: flex; align-items: center; justify-content: space-between }
.m2-cart-head h2 { margin: 0; font-size: 26px }
.m2-cart-close { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 22px; cursor: pointer }
.m2-cart-lines { display: grid; gap: 14px; overflow-y: auto; overscroll-behavior: contain }
.m2-cart-empty { margin: 0; color: var(--muted); font-size: 14px }
.m2-line { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line) }
.m2-line-main { display: flex; flex-direction: column; min-width: 0 }
.m2-line-main strong { color: var(--ink); font-weight: 500 }
.m2-line-main small { color: var(--muted); font-size: 12px }
.m2-line-main small:empty { display: none }
.m2-line-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px }
.m2-line-price { font-variant-numeric: tabular-nums; color: var(--ink) }
.m2-cart-foot { display: grid; gap: 10px; margin-top: auto; padding-top: 4px }
.m2-row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums }
.m2-row-total { padding-top: 8px; border-top: 1px solid var(--line); font-size: 18px; color: var(--ink) }
.m2-fine { margin: 0; color: var(--muted); font-size: 12.5px }
.m2-notice { margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(91, 29, 29, .07); color: var(--maroon); font-size: 14px }
.m2-wide { width: 100% }
html.m2-cart-open { overflow: hidden }

.m2-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff }
.m2-qty button { width: 40px; height: 40px; border: 0; background: none; color: var(--ink); font-size: 18px; cursor: pointer }
.m2-qty output { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums }
.m2-qty-sm button { width: 34px; height: 34px; font-size: 16px }

.m2-cart-fab { position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: inline-flex; align-items: center; gap: 12px; padding: 15px 22px; border: 0; border-radius: 999px; background: var(--ink); color: var(--cream); font: 500 14px/1 var(--sans); box-shadow: 0 20px 40px -18px rgba(42, 26, 18, .8); cursor: pointer }
.m2-cart-count { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--gold-3); color: var(--ink); font-size: 12px }
.m2-cart-fab.is-bumped { animation: m2-bump .4s var(--ease) }
@keyframes m2-bump { 40% { transform: scale(1.06) } }

/* Dialogs */
.m2-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(160deg, #fffdf8, var(--cream)); color: var(--ink); box-shadow: 0 40px 90px -30px rgba(42, 26, 18, .7) }
.m2-dialog::backdrop { background: rgba(42, 26, 18, .55); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px) }
.m2-dialog-inner { position: relative; display: grid; gap: 16px; padding: 30px 28px 26px }
.m2-dialog h2 { margin: 0; padding-right: 40px; font-size: 28px }
.m2-dialog-desc { margin: -6px 0 0; color: var(--muted); font-size: 14px }
.m2-dialog-desc:empty { display: none }
.m2-dialog-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, .7); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer }
.m2-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px }

.m2-group { display: grid; gap: 6px; margin: 0; padding: 0; border: 0 }
.m2-group legend { margin-bottom: 6px; padding: 0; color: var(--ink); font-weight: 500 }
.m2-group legend small { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 400 }
.m2-option { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .7); cursor: pointer }
.m2-option:has(input:checked) { border-color: var(--gold); background: rgba(198, 154, 68, .12) }
.m2-option:has(input:disabled) { opacity: .55; cursor: not-allowed }
.m2-option input { accent-color: var(--gold); width: 18px; height: 18px; flex: none }
.m2-option span:first-of-type { flex: 1 }
.m2-option-price { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums }

.m2-field { display: grid; gap: 6px; font-size: 14px }
.m2-field span { color: var(--ink) }
.m2-field small { color: var(--muted) }
.m2-field input, .m2-field textarea, .m2-field select { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-size: 16px }
.m2-field select { min-height: 48px; cursor: pointer }
/* Spice level (item dialog): three choices side by side */
.m2-spice-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.m2-spice .m2-option { justify-content: center; padding-inline: 10px }
.m2-pickup-time .m2-fine { margin-top: -4px }
.m2-field[hidden] { display: none }
.m2-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.m2-span { grid-column: 1 / -1 }
.m2-fulfillment { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; border: 0 }
.m2-fulfillment legend { margin-bottom: 8px; padding: 0; font-weight: 500 }
.m2-fulfillment label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer }
.m2-fulfillment label:has(input:checked) { border-color: var(--gold); background: rgba(198, 154, 68, .12) }
.m2-fulfillment input { accent-color: var(--gold) }
.m2-fulfillment label[hidden] { display: none }
/* Tip choices (checkout, card payments) */
.m2-tip { display: grid; gap: 10px; margin: 0; padding: 0; border: 0 }
.m2-tip legend { margin-bottom: 8px; padding: 0; font-weight: 500 }
.m2-tip legend small { color: var(--muted); font-weight: 400 }
.m2-tip-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px }
.m2-tip-options label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: center; cursor: pointer; transition: border-color .2s, background .2s }
.m2-tip-options label:has(input:checked) { border-color: var(--gold); background: rgba(198, 154, 68, .14) }
.m2-tip-options label:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px }
.m2-tip-options input { position: absolute; opacity: 0; pointer-events: none }
.m2-tip-options span { display: grid; gap: 2px; color: var(--ink); font-weight: 500; line-height: 1.2 }
.m2-tip-options small { color: var(--muted); font-size: 11.5px; font-weight: 400 }
@media (max-width: 520px) { .m2-tip-options { grid-template-columns: repeat(3, minmax(0, 1fr)) } }
.m2-totals { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line) }
.m2-totals[hidden], .m2-card[hidden] { display: none }
.m2-card { display: grid; gap: 10px }
.m2-card-title { margin: 0; font-weight: 500 }
.m2-card-title small { margin-left: 6px; color: var(--muted); font-weight: 400 }
/* Clover card fields: Clover's iframe always fills 100% of its container, so the container sets the size. */
.m2-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.m2-card-field { display: grid; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted) }
.m2-card-field > div { position: relative; width: 100%; max-width: 100%; height: 50px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; transition: border-color .2s, box-shadow .2s }
.m2-card-field > div:focus-within { border-color: var(--gold-3); box-shadow: 0 0 0 3px rgba(198, 154, 68, .2) }
.m2-card-field > div iframe { display: block; width: 100%; height: 100%; border: 0 }
.m2-card-field.has-error > div { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192, 57, 43, .12) }
.m2-card-error { margin: 0; color: #8b2b2b; font-size: 12.5px; line-height: 1.4 }
.m2-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fbe4e1; color: #8b2b2b; font-size: 14px }
.m2-error[hidden] { display: none }

/* Confirmation */
.m2-confirm { padding-block: 64px 90px }
.m2-confirm-card { display: grid; gap: 18px; max-width: 720px; padding: 40px; border-radius: 28px }
.m2-confirm-card h1 { margin: 0; font-size: clamp(32px, 5vw, 46px) }
.m2-confirm-card .lead { margin: 0 }
.m2-confirm-meta { display: grid; gap: 10px; margin: 0 }
.m2-confirm-meta div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px }
.m2-confirm-meta dt { color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase }
.m2-confirm-meta dd { margin: 0; color: var(--ink) }
.m2-confirm-lines { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none }
.m2-confirm-lines li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums }
.m2-confirm-lines small { display: block; color: var(--muted); font-size: 12.5px }

/* Tablets and phones: the rail becomes a compact category selector under the header. */
@media (max-width: 900px) {
    /* Replaces the original phone rail box (overflow hidden would clip the category list). */
    .m2 .m2-rail { position: sticky; top: 78px; z-index: 25; margin-bottom: 28px; padding: 10px 0; overflow: visible; border: 0; border-radius: 0; box-shadow: none; background: rgba(246, 242, 234, .94) }
    .m2 .m2-rail > .eyebrow { display: none }
    .m2 .m2-rail .m2-cat-toggle { display: flex; flex-direction: row; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer }
    .m2 .menu-section { scroll-margin-top: 30px }
    .m2 .m2-rail .m2-cat-label { color: var(--muted); font-size: 11px; letter-spacing: .18em; text-transform: uppercase }
    .m2 .m2-rail .m2-cat-toggle strong { flex: 1; min-width: 0; overflow: hidden; font: 500 17px/1.3 var(--serif); text-overflow: ellipsis; white-space: nowrap }
    .m2-cat-caret { color: var(--gold); transition: transform .2s }
    .m2-cat-toggle[aria-expanded="true"] .m2-cat-caret { transform: rotate(180deg) }
    .m2 .m2-rail > nav { position: absolute; left: 0; right: 0; top: calc(100% - 4px); display: none; flex-direction: column; max-height: 62vh; overflow-x: hidden; overflow-y: auto; padding: 8px; border-radius: 18px; background: rgba(255, 253, 248, .98); box-shadow: 0 26px 50px -24px rgba(42, 26, 18, .6) }
    .m2 .m2-rail > nav.is-open { display: flex }
    .m2 .m2-rail .menu-category-card { flex: none; min-height: 48px }
    .m2-search { max-width: none; margin-bottom: -36px }
}

@media (max-width: 620px) {
    .m2 .m2-rail { top: 72px; padding: 8px 0; border-radius: 0 }
    .m2 .m2-product { grid-template-columns: minmax(0, 1fr); gap: 10px }
    .m2-row-side { justify-content: space-between }
    .m2-add { min-width: 92px }
    .m2-cart { top: auto; left: 0; width: 100%; max-height: 86vh; max-height: 86dvh; padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px)); border-left: 0; border-radius: 26px 26px 0 0; transform: translateY(105%) }
    .m2-cart-fab { left: 16px; right: 16px; justify-content: space-between }
    .m2-dialog { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 26px 26px 0 0 }
    .m2-dialog-inner { padding: 26px 18px calc(22px + env(safe-area-inset-bottom, 0px)) }
    .m2-fields { grid-template-columns: 1fr }
    .m2-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
    .m2-dialog-actions .button { flex: 1 }
    .m2-confirm-card { padding: 26px 20px }
    .m2-confirm-meta div { grid-template-columns: 1fr; gap: 2px }
}

@media (max-width: 400px) {
    .m2-card-grid { grid-template-columns: 1fr }
}

@media (prefers-reduced-motion: reduce) {
    .m2-cart, .m2-cart-fab.is-bumped, .m2-add { transition: none; animation: none }
}
