/* Customer PWA application shell (Delivery + Menu). Loaded ONLY by pages rendered with $yzAppShell = true.
   Tenant colours: --yz-accent comes from the restaurant's own base colour (set inline by menu.blade.php);
   nothing restaurant-specific is hard-coded here. */
:root { --yz-app-bg: #0f1624; --yz-app-bg-2: #172036; --yz-accent: #F04400; --yz-price: #d4161c; --yz-ink: #101828; --yz-muted: #667085; }

body.yz-app-shell { background: #fff; color: var(--yz-ink); margin: 0; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain;
    padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }

/* ---- Veg / Non-Veg pills ---- */
.yz-app-main #yz-results.is-loading { opacity: .55; pointer-events: none; transition: opacity .12s; }
.yz-food { display: flex; gap: 10px; padding: 6px 2px 12px; }
.yz-pill { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; border-radius: 999px;
    background: #fff; border: 1.5px solid #d9dde3; color: var(--yz-ink); font-size: 15px; font-weight: 600; text-decoration: none; }
.yz-pill.is-on { border-color: var(--yz-ink); box-shadow: 0 0 0 1px var(--yz-ink) inset; font-weight: 700; }
.yz-mark { display: inline-block; flex: 0 0 auto; width: 14px; height: 14px; border-radius: 3px; border: 2px solid; position: relative; vertical-align: -2px; margin-right: 6px; }
.yz-pill .yz-mark { margin-right: 0; }
.yz-mark::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: currentColor; }
.yz-mark--veg { color: #16a34a; }
.yz-mark--non { color: #dc2626; }

/* ---- Categories: heading + horizontally scrolling circular images ---- */
.yz-section-title { margin: 4px 2px 10px; font-size: 20px; font-weight: 800; color: var(--yz-ink); }
.yz-cats__row { display: flex; flex-wrap: nowrap; gap: 14px; overflow-x: auto; overflow-y: hidden; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); width: 100vw; max-width: 100vw; box-sizing: border-box; padding: 6px 14px 14px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; }
.yz-cats__row::-webkit-scrollbar { display: none; }
.yz-cat { flex: 0 0 78px; width: 78px; scroll-snap-align: start; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--yz-ink); }
.yz-cat__img { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: #f2f4f7; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 10px rgba(16,24,40,.12); border: 3px solid #fff; outline: 2px solid transparent; }
.yz-cat__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yz-cat__img--all { color: var(--yz-accent); }
.yz-cat__init { font-size: 26px; font-weight: 800; color: var(--yz-accent); }
.yz-cat__name { width: 100%; text-align: center; font-size: 13px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yz-cat.is-active .yz-cat__img { outline-color: var(--yz-accent); }
.yz-cat.is-active .yz-cat__name { color: var(--yz-accent); font-weight: 800; }
.yz-results-note { margin: 0 2px 8px; color: var(--yz-muted); font-size: 14px; }

/* ---- Delivery state banner ---- */
.yz-delivery-state { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; background: #fff4ed; color: #9a3412; border: 1px solid #fed7aa; }
.yz-delivery-state.is-bad { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.yz-delivery-state button { all: unset; cursor: pointer; text-decoration: underline; margin-left: 6px; }

/* ---- Food grid: two columns ---- */
.yz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.yz-card { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden;
    box-shadow: 0 6px 20px rgba(16,24,40,.08); border: 1px solid #f1f2f4; min-width: 0; }
.yz-card__img { display: block; padding: 8px 8px 0; }
.yz-card__img img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 14px; display: block; background: #fff; }
.yz-card__body { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 10px 12px 12px; flex: 1; }
.yz-card__title { color: var(--yz-ink); font-weight: 700; font-size: 16px; line-height: 1.3; text-decoration: none;
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yz-card__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.yz-card__now { color: var(--yz-price); font-weight: 800; font-size: 18px; }
.yz-card__was { color: var(--yz-muted); font-size: 12px; margin-left: 4px; }
.yz-card__price { min-width: 0; }
.yz-add { flex: 0 0 auto; width: 44px; height: 44px; /* touch target */ display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid var(--yz-accent); color: var(--yz-accent); border-radius: 10px; background: #fff; text-decoration: none; }
.yz-add:active { background: var(--yz-accent); color: #fff; }
.yz-badge { position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700; background: #ffe9e3; color: #c2410c; }
.yz-badge.is-popular { background: #fff1de; color: #b45309; }
.yz-badge.is-veg { background: #e7f7ec; color: #15803d; }

/* ---- Empty / pager / top button ---- */
.yz-empty { text-align: center; padding: 48px 16px; color: var(--yz-muted); }
.yz-empty__art { font-size: 48px; }
.yz-empty h2 { color: var(--yz-ink); font-size: 18px; margin: 8px 0 4px; }
.yz-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 12px; background: var(--yz-accent); color: #fff; font-weight: 700; text-decoration: none; border: 0; }
.yz-btn--ghost { background: #f2f4f7; color: var(--yz-ink); }
.yz-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 0; color: var(--yz-muted); }
.yz-top { position: fixed; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 1035; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff;
    background: var(--yz-accent); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.yz-top[hidden] { display: none; }

/* ---- Footer: never shown in the app shell (none is rendered) and never in any installed-app page ---- */

/* ---- Keyboard open: hide the fixed bottom nav so it never covers inputs ---- */
body.yz-kbd-open .pwa-bottom-nav, body.yz-kbd-open .yz-top { display: none !important; }
body.yz-kbd-open { padding-bottom: 0; }

@media (max-width: 340px) { .yz-grid { gap: 10px; } .yz-card__title { font-size: 14px; } .yz-card__now { font-size: 15px; } }
@media (prefers-reduced-motion: no-preference) { .yz-card { transition: transform .12s ease; } .yz-card:active { transform: scale(.985); } }

/* ---- Offline bar + update bar ---- */
.yz-offline-bar { position: fixed; left: 12px; right: 12px; top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 2000; padding: 10px 14px; border-radius: 12px;
    background: #7a271a; color: #fff; font-size: 14px; font-weight: 600; text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.yz-offline-bar.is-online { background: #067647; }
.yz-offline-bar[hidden] { display: none; }
.yz-update-bar { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 2000; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px 10px 16px; border-radius: 14px; background: #101828; color: #fff; font-size: 14px; box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.yz-update-bar button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--yz-accent); color: #fff; font-weight: 700; }

/* Hardening against theme CSS (theme stylesheets load on the same page and style bare h2/section/a) */
body.pwa-standalone .yz-app-main { font-family: inherit; }
.yz-app-main .yz-cats { display: block; width: 100%; float: none; }
.yz-app-main .yz-section-title { font-family: inherit; font-size: 20px; font-weight: 800; letter-spacing: 0; text-transform: none; line-height: 1.25; }

/* ==========================================================================================
   Home polish: horizontal categories, "Popular Right Now" rail (2.5 cards visible), richer cards
   ========================================================================================== */
.yz-app-main .yz-section-title { margin: 18px 2px 8px; color: var(--yz-ink); }
.yz-app-main .yz-section-title--grid { margin-top: 8px; }
.yz-food { padding: 10px 2px 4px; }
.yz-pill { background: #fff; border: 1.5px solid #e4e7ec; font-weight: 600; box-shadow: 0 2px 8px rgba(16,24,40,.05); transition: transform .12s ease, box-shadow .12s ease; }
.yz-pill:active { transform: scale(.96); }
.yz-pill.is-on { background: #fff7f2; border-color: var(--yz-accent); box-shadow: 0 0 0 1px var(--yz-accent) inset, 0 4px 12px rgba(240,68,0,.15); color: var(--yz-accent); }
.yz-cat__img { box-shadow: 0 4px 12px rgba(16,24,40,.12); border: 2px solid #fff; transition: transform .15s ease, box-shadow .15s ease; }
.yz-cat:active .yz-cat__img { transform: scale(.94); }
.yz-cat.is-active .yz-cat__img { box-shadow: 0 0 0 2.5px var(--yz-accent), 0 6px 16px rgba(240,68,0,.28); }
.yz-cat__name { font-weight: 600; }

.yz-popular { margin-top: 2px; }
.yz-popular__head .yz-section-title { margin-bottom: 4px; }
.yz-rail { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); width: 100vw; max-width: 100vw; box-sizing: border-box; padding: 8px 14px 18px; scroll-snap-type: x mandatory; scroll-padding-left: 14px; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; }
.yz-rail::-webkit-scrollbar { display: none; }
/* 14px left padding + 2 gaps of 12px => (100vw - 38px) / 2.5 puts exactly 2 full cards + half of the 3rd on screen */
.yz-rail .yz-card--rail { flex: 0 0 min(calc((100vw - 38px) / 2.5), 190px); margin: 0; scroll-snap-align: start; display: flex; flex-direction: column; position: relative; border-radius: 18px; box-shadow: 0 8px 22px rgba(16,24,40,.10); }
.yz-rail .yz-card--rail .yz-card__img { padding: 8px 8px 0; }
.yz-rail .yz-card--rail .yz-card__img img { width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover; border-radius: 14px; display: block; background: #f4f5f7; }
.yz-rail .yz-card--rail .yz-card__img--empty { display: flex; }
.yz-rail .yz-card--rail .yz-card__img--empty span { width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; background: linear-gradient(135deg, #fff1e8, #ffe0cf); display: flex; align-items: center; justify-content: center; font-size: 34px; }
.yz-rail .yz-card--rail .yz-card__body { padding: 8px 10px 10px; }
.yz-rail .yz-card--rail .yz-card__title { font-size: 14px; padding: 0; }
.yz-rail .yz-card--rail .yz-card__now { font-size: 16px; }
.yz-rail .yz-card--rail .yz-card__was { font-size: 11px; }
.yz-rail .yz-card--rail .yz-add { width: 36px; height: 36px; border-radius: 10px; }
.yz-rail .yz-card--rail .yz-badge { top: 14px; left: 14px; font-size: 11px; padding: 3px 8px; }

.yz-card { transition: transform .12s ease, box-shadow .12s ease; }
.yz-card:active { transform: scale(.985); }
.yz-add { transition: background .12s ease, color .12s ease, transform .12s ease; }
.yz-add:active { background: var(--yz-accent); color: #fff; transform: scale(.92); }
@media (min-width: 768px) { .yz-rail, .yz-cats__row { margin-left: 0; margin-right: 0; width: auto; max-width: none; padding-left: 2px; } }
.yz-cats__row { scroll-padding-left: 14px; }
