/* ==========================================================================
   The shop front.

   This is the only part of Emcube Go a stranger sees, so it is the only part
   that has to look good before it is understood. It was built phone-first and
   capped at 760px, which on a laptop left one small card marooned in white
   space — plenty of people order from a desk at work, and that was the first
   impression they got.

   The layout is now a header, an optional filter rail, and a fluid grid of
   cards. Breakpoints are Bootstrap's ladder (576 / 768 / 992 / 1200 / 1400)
   because Bootstrap is already loaded and two ladders is a bug factory. Tokens
   come from app.css; the few that are only the storefront's live on
   .em-store-body rather than in :root, so nothing here leaks into the portal.
   ========================================================================== */

.em-store-body {
    --store-max: 720px;         /* the shell's outer width, per breakpoint */
    --rail-w: 0px;              /* the filter rail; zero until there is room */
    --gutter: var(--sp-4);
    --card-min: 250px;          /* the smallest a shop card may get before it wraps */
    --cover-ratio: 16 / 10;

    background: var(--page-bg);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- the bar ------------------------------------------------------------
   One search box and one location chip, moved around by CSS. Rendering a
   second copy for wide screens means two sets of ids and labels to keep in
   step, and they never stay in step. */

.em-store-bar {
    background: var(--plum-900);
    color: #fff;
    position: sticky;
    z-index: 30;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
    /* On a phone the bar is three rows, and three rows pinned to the top of a
       small screen is a fifth of it gone for good. So it sticks one row high:
       the location strip is the first row and the negative offset lets it
       scroll away, leaving the two rows somebody actually reaches for — search
       and the basket — in place. --where-h is fixed rather than measured
       because the strip is one line by construction: nowrap, with the label
       ellipsed. */
    --where-h: 1.75rem;
    /* --env-h is the striped "this is not the live site" strip, which is
       itself sticky on staging and local. store.js measures it; on the live
       site there is no strip and the fallback of zero is the whole story. */
    top: calc(var(--env-h, 0px) - var(--where-h) - var(--sp-2));
}
.em-store-bar-inner {
    max-width: var(--store-max);
    margin: 0 auto;
    padding: var(--sp-2) var(--gutter) var(--sp-3);
    display: grid;
    gap: var(--sp-2) var(--sp-3);
    align-items: center;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "where  where  where"
        "brand  .      actions"
        "search search search";
}

.em-store-brand { grid-area: brand; display: flex; align-items: center; gap: var(--sp-2); color: #fff; font-weight: 700; }
.em-store-brand img { width: 30px; height: 30px; object-fit: contain; }
.em-store-brand:hover, .em-store-brand:focus { color: #fff; text-decoration: none; }
.em-store-brand span { font-size: var(--fs-md); letter-spacing: -.01em; }

.em-store-actions { grid-area: actions; display: flex; align-items: center; gap: var(--sp-2); }
.em-store-basket {
    position: relative; display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: var(--r-md); background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.15rem;
}
.em-store-basket:hover, .em-store-basket:focus { background: rgba(255, 255, 255, .22); color: #fff; text-decoration: none; }
.em-store-basket .pip {
    position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: var(--r-pill); background: var(--coral-500); color: #fff;
    font-size: var(--fs-xs); font-weight: 700; display: grid; place-items: center;
    box-shadow: 0 0 0 2px var(--plum-900);
}
.em-store-user {
    background: rgba(255, 255, 255, .12); border: 0; color: #fff; border-radius: var(--r-md);
    padding: .5rem .85rem; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.em-store-user:hover, .em-store-user:focus { background: rgba(255, 255, 255, .22); color: #fff; text-decoration: none; }

.em-store-search {
    grid-area: search;
    position: relative; display: flex; align-items: center; gap: var(--sp-2);
    width: 100%; margin: 0;
}
.em-store-search .bi-search {
    position: absolute; left: .9rem; color: var(--text-muted); pointer-events: none; font-size: .95rem;
}
.em-store-search input {
    flex: 1; min-width: 0; border: 1px solid transparent; border-radius: var(--r-pill);
    padding: .65rem 1rem .65rem 2.5rem; font-size: var(--fs-base); background: var(--surface);
    color: var(--text-primary);
}
.em-store-search input::placeholder { color: var(--text-muted); }
.em-store-search input:focus { outline: none; border-color: var(--coral-300); box-shadow: 0 0 0 3px rgba(254, 86, 86, .45); }
.em-store-search button {
    border: 0; background: var(--coral-500); color: #fff; border-radius: var(--r-pill);
    padding: .65rem 1.15rem; font-weight: 700; font-size: var(--fs-base); white-space: nowrap;
}
.em-store-search button:hover { background: var(--coral-400); }

/* The location chip: a button that looks like what it is, a thing you press
   to change where "near you" means. */
.em-store-where {
    grid-area: where;
    display: flex; align-items: center; gap: var(--sp-2); min-width: 0;
    min-height: var(--where-h);
    font-size: var(--fs-xs); color: rgba(255, 255, 255, .82);
}
.em-store-where .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-store-where .link {
    border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600;
    padding: .25rem .7rem; border-radius: var(--r-pill); font-size: var(--fs-xs); white-space: nowrap;
}
.em-store-where .link:hover { background: rgba(255, 255, 255, .24); text-decoration: none; }

/* --- the shell ---------------------------------------------------------- */

.em-store-shell {
    flex: 1;
    width: 100%;
    max-width: var(--store-max);
    margin: 0 auto;
    padding: var(--sp-5) var(--gutter) var(--sp-12);
    display: grid;
    gap: var(--sp-6);
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}
.em-store-rail { display: none; }
.em-store-main { min-width: 0; }

/* Reading pages — checkout, a receipt, tracking one order — stay narrow on
   purpose. A 1300px line of body text is unreadable however big the screen. */
.em-store-main.narrow { max-width: 720px; margin: 0 auto; width: 100%; }

.em-store-foot {
    padding: var(--sp-8) var(--gutter) var(--sp-10);
    color: var(--text-muted); font-size: var(--fs-sm);
    background: var(--surface); border-top: 1px solid var(--border);
}
.em-store-foot-inner { max-width: var(--store-max); margin: 0 auto; display: grid; gap: var(--sp-3); }
.em-store-foot p { margin: 0; }
.em-store-foot nav { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }

/* --- section headings --------------------------------------------------- */

.em-sec { margin-bottom: var(--sp-8); }
.em-sec-head { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.em-sec-head h2, .em-sec-head h1 {
    font-size: var(--fs-lg); font-weight: 700; margin: 0; letter-spacing: -.015em;
}
.em-sec-head .count { color: var(--text-muted); font-size: var(--fs-sm); }
.em-sec-head .more { margin-left: auto; font-size: var(--fs-sm); font-weight: 600; }
.em-sec-note { color: var(--text-secondary); font-size: var(--fs-sm); margin: -.5rem 0 var(--sp-4); }

/* --- the category rail --------------------------------------------------
   A row of tiles on a phone that scrolls sideways, a wrapping row once there
   is width for it. Scroll snapping so a half-tile never sits at the edge. */

.em-cats {
    display: flex; gap: var(--sp-3); margin-bottom: var(--sp-8);
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: var(--sp-2);
    scrollbar-width: thin;
    /* bleed to the screen edge so the row reads as scrollable */
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
}
.em-cat {
    scroll-snap-align: start;
    flex: 0 0 auto; width: 96px;
    display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-2); text-align: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    color: var(--text-primary); font-size: var(--fs-sm); font-weight: 600; line-height: 1.2;
}
.em-cat:hover, .em-cat:focus { text-decoration: none; color: var(--text-primary); border-color: var(--coral-200); box-shadow: var(--shadow-1); }
.em-cat i { font-size: 1.4rem; color: var(--accent); }
.em-cat .n { font-weight: 500; color: var(--text-muted); font-size: var(--fs-xs); }
.em-cat.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.em-cat.on i { color: var(--coral-800); }

/* --- shop cards --------------------------------------------------------- */

.em-shops {
    display: grid; gap: var(--sp-4);
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
}

.em-shop-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    overflow: hidden; box-shadow: var(--shadow-1); color: var(--text-primary);
    transition: box-shadow .15s ease, transform .15s ease;
}
.em-shop-card:hover, .em-shop-card:focus-visible {
    text-decoration: none; color: var(--text-primary); box-shadow: var(--shadow-3); transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
    .em-shop-card { transition: none; }
    .em-shop-card:hover { transform: none; }
}

.em-cover { position: relative; aspect-ratio: var(--cover-ratio); background: var(--gray-100); overflow: hidden; }
.em-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* No photograph yet: a wash in the brand colours with the category mark. It
   should look chosen, not missing. */
.em-cover .wash {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--coral-100), var(--amber-100) 70%, var(--coral-50));
    color: var(--coral-800); font-size: 2rem;
}
.em-cover .badges {
    position: absolute; left: var(--sp-3); top: var(--sp-3);
    display: flex; flex-wrap: wrap; gap: var(--sp-2);
}
.em-pill {
    background: rgba(26, 20, 32, .78); color: #fff; backdrop-filter: blur(4px);
    border-radius: var(--r-pill); padding: .2rem .6rem;
    font-size: var(--fs-xs); font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.em-pill.good { background: var(--good); }
.em-pill.warm { background: var(--amber-700); }

.em-shop-body { padding: var(--sp-4); position: relative; display: flex; flex-direction: column; gap: var(--sp-1); flex: 1; }
.em-shop-logo {
    position: absolute; top: -26px; left: var(--sp-4);
    width: 52px; height: 52px; border-radius: var(--r-md);
    background: var(--surface); border: 2px solid var(--surface); box-shadow: var(--shadow-2);
    object-fit: cover; display: grid; place-items: center;
    color: var(--coral-700); font-size: 1.3rem; overflow: hidden;
}
.em-shop-body.has-logo { padding-top: var(--sp-8); }
.em-shop-name { font-weight: 700; font-size: var(--fs-md); line-height: 1.25; }
.em-shop-branch { color: var(--text-muted); font-size: var(--fs-sm); }
.em-shop-meta {
    color: var(--text-secondary); font-size: var(--fs-sm);
    display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: center;
}
.em-shop-meta .dot::before { content: '·'; margin-right: var(--sp-2); color: var(--gray-400); }
.em-shop-meta .rate { font-weight: 700; color: var(--text-primary); }
.em-shop-meta .rate i { color: var(--amber-600); }
.em-shop-foot {
    margin-top: auto; padding-top: var(--sp-3);
    display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
    font-size: var(--fs-sm); color: var(--text-secondary);
}
.em-shop-foot .fee { font-weight: 600; color: var(--text-primary); }

.em-shop-hits { margin-top: var(--sp-3); display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.em-hit {
    font-size: var(--fs-xs); background: var(--gray-100); border-radius: var(--r-pill);
    padding: .2rem .6rem; color: var(--text-secondary);
}
.em-hit strong { color: var(--text-primary); }

/* A closed shop. The old rule dropped the whole card to 60% opacity, which
   took the body text under contrast minimums to say something a badge says
   better. Grey the picture; leave the words readable. */
.em-closed .em-cover img, .em-closed .em-cover .wash { filter: grayscale(1); opacity: .55; }
.em-closed .em-shop-name { color: var(--text-secondary); }

/* --- products, with photographs -----------------------------------------
   What a search actually answers. People look for jollof, not for kitchens. */

.em-products {
    display: grid; gap: var(--sp-4);
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.em-product {
    display: flex; flex-direction: column; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
    box-shadow: var(--shadow-1); color: var(--text-primary);
}
.em-product:hover, .em-product:focus-visible { text-decoration: none; color: var(--text-primary); box-shadow: var(--shadow-2); }
.em-product .shot { position: relative; aspect-ratio: 1; background: var(--gray-100); }
.em-product .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.em-product .shot .wash {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--coral-50), var(--amber-50));
    color: var(--coral-700); font-size: 1.6rem;
}
.em-product .body { padding: var(--sp-3); display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.em-product .name { font-weight: 600; line-height: 1.3; }
.em-product .from { color: var(--text-muted); font-size: var(--fs-xs); }
.em-product .price { margin-top: auto; padding-top: var(--sp-2); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* A guessed picture is an illustration, not a promise about what arrives. */
.em-illustration { color: var(--text-muted); font-size: var(--fs-xs); font-style: italic; }

/* --- the filter rail ---------------------------------------------------- */

.em-filters { display: grid; gap: var(--sp-5); }
.em-filters fieldset { border: 0; margin: 0; padding: 0; }
.em-filters legend {
    font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary);
    margin-bottom: var(--sp-2); float: none; width: auto; padding: 0;
}
.em-filters .form-check { margin-bottom: .2rem; }
.em-filters .form-check-label { font-size: var(--fs-sm); }
.em-filters .noscript-go { margin-top: var(--sp-2); }

/* On a phone the same fieldset lives in an offcanvas sheet, opened by this. */
.em-filter-button { display: inline-flex; align-items: center; gap: var(--sp-2); }

/* --- the shop page ------------------------------------------------------ */

.em-hero {
    position: relative; border-radius: var(--r-lg); overflow: hidden;
    margin-bottom: var(--sp-5); background: var(--gray-200);
    min-height: 180px; display: flex; align-items: flex-end;
}
.em-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.em-hero .wash {
    position: absolute; inset: 0;
    background: linear-gradient(140deg, var(--plum-700), var(--coral-700));
}
.em-hero .scrim {
    position: relative; width: 100%; padding: var(--sp-10) var(--sp-4) var(--sp-4);
    /* Dark enough that white text clears contrast over a photograph of
       anything, including a plate of rice under a bright light. */
    background: linear-gradient(to top,
        rgba(26, 20, 32, .95) 0%, rgba(26, 20, 32, .88) 40%,
        rgba(26, 20, 32, .55) 75%, rgba(26, 20, 32, .05) 100%);
    color: #fff;
}
.em-hero h1 {
    font-size: var(--fs-xl); font-weight: 800; margin: 0 0 var(--sp-2); letter-spacing: -.02em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.em-hero .meta {
    display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4);
    font-size: var(--fs-sm); color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.em-hero .meta .rate i { color: var(--amber-400); }
.em-hero .em-shop-logo { position: static; margin-bottom: var(--sp-3); }

/* The sticky course list. On a long menu this is the single thing that makes
   the page usable — you can always get back to the top of a section. */
.em-menu-nav {
    /* Under the bar, never behind it. --bar-stick-h is where the pinned bar
       actually ends, measured once by store.js; the fallback is what it comes
       to on a phone when the script has not run. */
    position: sticky; top: var(--bar-stick-h, 7rem); z-index: 20;
    display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none;
    padding: var(--sp-3) var(--gutter); margin-inline: calc(var(--gutter) * -1);
    background: var(--page-bg); border-bottom: 1px solid var(--border);
    margin-bottom: var(--sp-5);
}
.em-menu-nav::-webkit-scrollbar { display: none; }
.em-menu-nav a {
    flex: 0 0 auto; padding: .35rem .85rem; border-radius: var(--r-pill);
    background: var(--surface); border: 1px solid var(--border);
    font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); white-space: nowrap;
}
.em-menu-nav a:hover { text-decoration: none; color: var(--text-primary); }
.em-menu-nav a.on { background: var(--plum-900); border-color: var(--plum-900); color: #fff; }

/* One column until there is genuinely room for three. The middle one is the
   menu; the outer two are where you are in it and what you have chosen. */
.em-shop-layout { display: grid; gap: var(--sp-6); grid-template-columns: minmax(0, 1fr); }
.em-shop-menu { min-width: 0; }
.em-shop-basket { display: none; }

.em-menu-group { margin-bottom: var(--sp-8); scroll-margin-top: 8rem; }
.em-menu-group h2 { font-size: var(--fs-lg); font-weight: 700; margin: 0 0 var(--sp-3); }
.em-menu-list { display: grid; gap: var(--sp-3); }

.em-menu-item {
    display: flex; align-items: center; gap: var(--sp-3);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: var(--sp-3); box-shadow: var(--shadow-1);
}
.em-menu-item .shot {
    flex: 0 0 auto; width: 76px; height: 76px; border-radius: var(--r-md); overflow: hidden;
    background: var(--gray-100); position: relative; display: grid; place-items: center;
    color: var(--coral-700); font-size: 1.4rem;
}
.em-menu-item .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.em-menu-item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.em-menu-item .name { font-weight: 600; }
.em-menu-item .desc {
    color: var(--text-muted); font-size: var(--fs-sm);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.em-menu-item .price { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.em-menu-item form { flex: 0 0 auto; }
.em-add {
    width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid var(--coral-200);
    background: var(--coral-50); color: var(--accent); font-size: 1.15rem; display: grid; place-items: center;
}
.em-add:hover { background: var(--coral-100); }
.em-add[disabled] { opacity: .4; }
.em-in-basket { font-size: var(--fs-xs); color: var(--good); font-weight: 700; }

/* --- basket & checkout -------------------------------------------------- */

.em-line { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--gray-100); }
.em-line:last-of-type { border-bottom: 0; }
.em-line .body { flex: 1; min-width: 0; }
.em-line .amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.em-line input[type="number"] { width: 72px; text-align: center; }
.em-totals { border-top: 1px solid var(--border); margin-top: var(--sp-4); padding-top: var(--sp-4); }
.em-totals .row-line { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--text-secondary); padding: var(--sp-1) 0; }
.em-totals .grand { display: flex; justify-content: space-between; align-items: baseline; margin-top: var(--sp-2); }
.em-totals .grand .value { font-size: var(--fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }

/* The bar that follows you down a shop page with something in your basket.
   It sits above the iPhone home indicator, not under it. */
.em-basket-bar {
    position: sticky; bottom: 0; z-index: 25;
    margin: var(--sp-6) calc(var(--gutter) * -1) 0;
    padding: var(--sp-3) var(--gutter) calc(var(--sp-3) + env(safe-area-inset-bottom));
    background: var(--plum-900); color: #fff;
    display: flex; align-items: center; gap: var(--sp-3);
    box-shadow: 0 -4px 16px rgba(26, 20, 32, .18);
}
.em-basket-bar .what { flex: 1; min-width: 0; font-size: var(--fs-sm); }
.em-basket-bar .what strong { display: block; font-size: var(--fs-md); }
.em-basket-bar .go {
    background: var(--coral-500); color: #fff; border: 0; border-radius: var(--r-pill);
    padding: .6rem 1.2rem; font-weight: 700; white-space: nowrap;
}
.em-basket-bar .go:hover { background: var(--coral-400); color: #fff; text-decoration: none; }

/* --- order tracking ----------------------------------------------------- */

.em-track { list-style: none; margin: 0; padding: 0; }
.em-track li { display: flex; gap: var(--sp-3); padding-bottom: var(--sp-4); position: relative; }
.em-track li::before {
    content: ''; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--gray-200);
}
.em-track li:last-child::before { display: none; }
.em-track .pip {
    width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
    background: var(--gray-200); color: var(--text-muted); font-size: .8rem; z-index: 1;
}
.em-track li.done .pip { background: var(--good); color: #fff; }
.em-track li.now .pip { background: var(--accent); color: #fff; }
.em-track .label { font-weight: 600; }
.em-track li:not(.done):not(.now) .label { color: var(--text-muted); font-weight: 500; }
.em-track .when { color: var(--text-muted); font-size: var(--fs-sm); }

.em-code {
    text-align: center; padding: var(--sp-5); background: var(--amber-50); border: 1px dashed var(--amber-300);
    border-radius: var(--r-lg); margin-bottom: var(--sp-4);
}
.em-code .digits { font-size: 2.25rem; font-weight: 700; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.em-code .what { color: var(--text-secondary); font-size: var(--fs-sm); }

.em-empty-store { text-align: center; padding: var(--sp-10) var(--sp-4); color: var(--text-muted); }
.em-empty-store i { font-size: 2.5rem; color: var(--gray-300); display: block; margin-bottom: var(--sp-3); }
.em-empty-store h1, .em-empty-store h2 { font-size: var(--fs-lg); color: var(--text-primary); }

/* --- a pin on a map ----------------------------------------------------- */

.em-map {
    height: 260px; border-radius: var(--r-lg); border: 1px solid var(--border);
    margin-bottom: var(--sp-3); background: var(--gray-100); z-index: 0;
}
.em-map-small { height: 180px; }

/* --- the rider on the tracking page ------------------------------------- */

.em-rider-strip {
    display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    margin-bottom: var(--sp-3);
}
.em-rider-strip .avatar {
    width: 42px; height: 42px; border-radius: 50%; background: var(--coral-50); color: var(--coral-700);
    display: grid; place-items: center; font-size: 1.2rem; flex: 0 0 auto;
}
.em-rider-strip .who { flex: 1; min-width: 0; }
.em-rider-strip .name { font-weight: 700; }
.em-rider-strip .vehicle { color: var(--text-muted); font-size: var(--fs-sm); }
.em-rider-strip .stage { display: block; color: var(--text-muted); font-size: var(--fs-sm); }

/* --- picking one of several --------------------------------------------- */

.em-choice {
    display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3);
    border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: var(--sp-2);
    cursor: pointer; background: var(--surface);
}
.em-choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.em-choice.muted { opacity: .55; cursor: not-allowed; }
.em-choice input { margin-top: 3px; flex: 0 0 auto; }
.em-choice .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.em-choice .title { font-weight: 600; }
.em-choice .sub { color: var(--text-muted); font-size: var(--fs-sm); }
.em-choice .cost { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.em-choice .cost small { display: block; font-weight: 500; color: var(--text-muted); font-size: var(--fs-xs); }

/* --- the ride landing page: one screen, one promise, one button ---------- */

.em-ride-hero {
    background: linear-gradient(160deg, var(--plum-900), var(--coral-800));
    color: #fff; border-radius: var(--r-lg);
    padding: var(--sp-10) var(--sp-5); text-align: center; margin-bottom: var(--sp-6);
}
.em-ride-hero h1 { font-size: var(--fs-xl); font-weight: 800; margin-bottom: var(--sp-2); }
.em-ride-hero p { opacity: .88; max-width: 34rem; margin: 0 auto var(--sp-5); }
.em-ride-hero .em-soon {
    display: inline-block; background: rgba(255, 255, 255, .14); border-radius: var(--r-pill);
    padding: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); margin: 0;
}
.em-ride-icon { font-size: 1.5rem; color: var(--accent); }

/* ==========================================================================
   Breakpoints. Everything above is the phone; each block below only adds.
   ========================================================================== */

@media (min-width: 576px) {
    .em-store-body { --gutter: var(--sp-5); --card-min: 260px; }
    .em-cat { width: 108px; }
    .em-menu-item .shot { width: 88px; height: 88px; }
}

@media (min-width: 768px) {
    .em-store-body { --store-max: 760px; }
    .em-hero { min-height: 240px; }
    .em-hero h1 { font-size: 1.75rem; }
    .em-products { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (min-width: 992px) {
    .em-store-body { --store-max: 1160px; --rail-w: 232px; }

    /* One row — brand, where, search, account — so the whole bar can pin. */
    .em-store-bar { top: var(--env-h, 0px); }
    .em-store-bar-inner {
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        grid-template-areas: "brand where search actions";
        gap: var(--sp-4);
        padding-block: var(--sp-3);
    }
    .em-store-where { font-size: var(--fs-sm); }
    .em-store-search { max-width: 520px; justify-self: center; }
    .em-store-where { max-width: 260px; }

    .em-store-shell.has-rail { grid-template-columns: var(--rail-w) minmax(0, 1fr); gap: var(--sp-8); }
    .em-store-shell.has-rail .em-store-rail { display: block; position: sticky; top: 6rem; }

    /* The category rail stops scrolling and simply wraps. */
    .em-cats { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }

    .em-store-foot-inner { grid-template-columns: 1fr auto; align-items: center; }

    /* A menu is a list on a phone and two columns on a laptop. One column of
       80-character rows across 1,300 pixels is not a menu, it is a receipt. */
    .em-menu-list { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

    /* The sticky basket bar is a phone answer. On a desktop the basket is a
       drawer you open without leaving the page. */
    .em-basket-bar { display: none; }
}

@media (min-width: 1200px) {
    .em-store-body { --store-max: 1320px; --rail-w: 248px; }
    .em-store-search { max-width: 620px; }
    .em-hero { min-height: 280px; }

    /* The shop page becomes what a wide screen is actually better at: the
       course list, the menu, and the basket, all visible at once and none of
       them making you leave the page to see the others. */
    .em-shop-layout {
        grid-template-columns: 176px minmax(0, 1fr) 300px;
        gap: var(--sp-6);
        align-items: start;
    }
    .em-shop-basket { display: block; position: sticky; top: calc(var(--bar-stick-h, 5rem) + var(--sp-4)); }

    /* The sticky strip turns into a plain vertical list — it has a column of
       its own now, and nothing left to scroll sideways past. */
    .em-menu-nav {
        position: sticky; top: calc(var(--bar-stick-h, 5rem) + var(--sp-4));
        flex-direction: column; align-items: stretch; overflow: visible;
        margin: 0; padding: 0; background: none; border: 0;
    }
    .em-menu-nav a { text-align: left; }

    /* Two columns of menu items would leave each one too narrow beside a
       basket; one is the right answer in a 700px column. */
    .em-menu-list { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1400px) {
    /* A shade narrower than the 576 step, purely so a fourth card fits beside
       the rail rather than three stretching to fill the row. */
    .em-store-body { --store-max: 1400px; --card-min: 244px; }
}

/* Somebody who has asked their system for less motion gets less of it. */
@media (prefers-reduced-motion: reduce) {
    .em-cats { scroll-behavior: auto; }
}
