/* comptoir simulator: Uber Eats vs your own app.
   The restaurant's menu photo fills the background; one white sheet carries the numbers.
   Built on the styles.css tokens (Hanken Grotesk, black and white, comptoir blue). */
.sim { background: #1b1714; color: var(--white); min-height: 100vh; }
.sim [hidden] { display: none !important; }

.bg {
  position: fixed; inset: 0; z-index: 0;
  background: #1b1714 center / cover no-repeat;
}
.bg.remote { filter: none; } /* the restaurant's banner is large enough to show sharp */
.bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,.35) 40%, rgba(0,0,0,.7));
}
.sim[data-step="result"] .bg::after { background: linear-gradient(to bottom, rgba(0,0,0,.45), rgba(0,0,0,.75) 55%); }

.sim-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) var(--gutter) 16px;
}
.sim-top .wordmark { color: var(--white); }
.sim-tag { font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(8px); }
.sim-main { position: relative; z-index: 1; padding-inline: 16px; padding-block: 0 48px; }
.view { max-width: 560px; margin: 0 auto; }

/* 1. Search */
.search-view { min-height: calc(100vh - 160px); display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.search-view h1 { font-size: clamp(40px, 9vw, 64px); text-wrap: balance; text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.search { position: relative; }
.search input {
  width: 100%; height: 62px; padding: 0 20px 0 54px; border: 0; border-radius: 999px;
  background: var(--white); color: var(--black); font: 500 18px var(--sans);
  box-shadow: 0 10px 30px rgba(0,0,0,.3); -webkit-appearance: none; appearance: none;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: 3px solid var(--glaze); outline-offset: 2px; }
.search-icon { position: absolute; left: 20px; top: 31px; width: 22px; height: 22px; transform: translateY(-50%); fill: none; stroke: var(--black); stroke-width: 2.2; stroke-linecap: round; z-index: 1; }
.results {
  list-style: none; margin: 8px 0 0; padding: 6px; border-radius: 20px;
  background: var(--white); color: var(--black); box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.results button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 0; border-radius: 14px;
  background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.results button:hover:not(:disabled) { background: #f3f3f1; }
.results button:disabled { cursor: default; opacity: .4; }
.r-txt { flex: 1; min-width: 0; display: grid; }
.r-txt b { font-weight: 600; font-size: 17px; }
.r-txt span { font-size: 14px; color: var(--grey); }
.r-go { font-size: 26px; color: var(--grey); }
.soon { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: #eeeeee; }
.empty { padding: 14px; color: var(--grey); }
.try {
  align-self: flex-start; border: 1px solid rgba(255,255,255,.5); background: rgba(0,0,0,.2); color: var(--white);
  border-radius: 999px; padding: 10px 16px; font: 500 15px var(--sans); cursor: pointer; backdrop-filter: blur(8px);
}
.try:hover { background: rgba(0,0,0,.4); }
.err { font-weight: 500; padding: 10px 14px; border-radius: 12px; background: rgba(196,54,28,.9); align-self: flex-start; }

/* Loading */
.load-view { min-height: calc(100vh - 160px); display: grid; place-content: center; justify-items: center; gap: 16px; font-weight: 500; font-size: 17px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: var(--white); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* 2. Result */
.result-view { padding-top: clamp(24px, 10vh, 120px); }
.r-head { margin-bottom: 20px; }
.back {
  display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 16px 0 10px; margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,.5); border-radius: 999px; background: rgba(0,0,0,.25); color: var(--white);
  font: 500 14px var(--sans); cursor: pointer; backdrop-filter: blur(8px);
}
.back:hover { background: rgba(255,255,255,.16); }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.r-head h1 { font-size: clamp(38px, 8vw, 56px); text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.r-meta { margin-top: 8px; font-size: 15px; opacity: .85; }

.panel {
  background: var(--white); color: var(--black); border-radius: 24px;
  padding: 8px 20px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.35);
  display: grid; gap: 22px;
}

/* The order, folded by default */
.order { border-bottom: 1px solid var(--rule); }
.order summary, .detail summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 0; cursor: pointer; list-style: none;
}
.order summary::-webkit-details-marker, .detail summary::-webkit-details-marker { display: none; }
.detail { border-bottom: 1px solid var(--rule); }
.detail + .perks { border-top: 0; padding-top: 0; }
.detail .vs { margin-bottom: 14px; }
.detail .fine { margin: 0 0 16px; }
.o-title { font-size: 17px; }
.o-title b { font-weight: 600; }
.o-chev { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.order[open] .o-chev, .detail[open] .o-chev { transform: rotate(180deg); }
.o-note { margin: 0 0 4px; font-size: 13px; line-height: 1.4; color: var(--grey); }
.o-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; padding-top: 12px; border-top: 1px solid var(--rule); }
.o-total { font-size: 15px; color: var(--grey); }
.o-total b { margin-left: 4px; font-size: 17px; font-weight: 700; color: var(--black); font-variant-numeric: tabular-nums; }
.o-edit { display: block; margin: 0; border: 0; font: 600 14px var(--sans); padding: 8px 14px; border-radius: 999px; background: #eeeeee; color: inherit; cursor: pointer; }
.order.editing .o-edit { background: var(--black); color: var(--white); }
/* Read-only receipt until "Modifier": only ordered lines, as qty × name … line total */
.order:not(.editing) .lines li:not(.on), .order:not(.editing) .lines .sec, .order:not(.editing) .step, .order:not(.editing) .l-price { display: none; }
.order:not(.editing) .lines li { grid-template-columns: auto 1fr auto; padding: 6px 0; }
.order.editing .l-qty, .order.editing .l-sum { display: none; }
.l-qty { font-weight: 600; font-variant-numeric: tabular-nums; }
.l-sum { font-variant-numeric: tabular-nums; }
.lines { list-style: none; margin: 0 0 12px; padding: 0 4px 0 0; display: grid; max-height: min(60vh, 520px); overflow-y: auto; overscroll-behavior: contain; }
.lines .sec { display: block; padding: 14px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
.lines .sec:first-child { padding-top: 4px; }
.lines li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 8px 0; }
.lines li:not(.on) .l-name, .lines li:not(.on) .l-price { opacity: .45; }
.l-name { min-width: 0; font-weight: 500; }
.l-price { font-size: 14px; color: var(--grey); font-variant-numeric: tabular-nums; }
.step { display: flex; align-items: center; border-radius: 999px; background: #eeeeee; }
.step button { width: 34px; height: 34px; border: 0; background: none; font: 500 19px var(--sans); cursor: pointer; color: inherit; }
.step output { min-width: 16px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Comparison: one table, two columns */
.vs { display: grid; }
.c-row { display: grid; grid-template-columns: 1fr 96px 112px; align-items: baseline; gap: 8px; padding: 9px 0; font-size: 15px; }
.c-row > b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-row > .mine { color: var(--glaze); font-weight: 600; }
.c-head { padding: 0 0 6px; font-size: 13px; font-weight: 600; }
.c-head span { text-align: right; color: var(--grey); }
.c-head .mine { color: var(--glaze); }
.c-total { font-size: 17px; font-weight: 600; border-top: 1px solid var(--rule); padding-top: 12px; }
.c-total > b { font-weight: 700; }
.c-sep { margin-top: 14px; }
.c-row .neg { color: #c4361c; }

/* The two answers */
.wins { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.win { min-width: 0; border-radius: 18px; padding: 18px 16px; background: #f1f1ee; display: grid; gap: 10px; align-content: space-between; }
.win span { font-size: 14px; color: var(--grey); }
.win strong { font-size: clamp(32px, 8vw, 44px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.win.you { background: var(--glaze); color: var(--white); }
.win.you span { color: rgba(255,255,255,.8); }

/* Monthly: the biggest number on the page */
.month { border-radius: 20px; padding: 22px 20px 18px; background: var(--black); color: var(--white); display: grid; gap: 6px; }
.m-label { font-size: 15px; color: rgba(255,255,255,.7); }
.m-net { font-size: clamp(56px, 16vw, 88px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; color: #8fb0ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-orders { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-top: 14px; font-size: 15px; }
.m-orders b { font-weight: 600; }
.m-note { font-size: 13px; color: rgba(255,255,255,.55); }
.month input { width: 100%; margin: 8px 0 0; accent-color: var(--white); }

/* Owning the customer */
.perks { list-style: none; margin: 0; padding: 18px 0 0; border-top: 1px solid var(--rule); display: grid; gap: 14px; }
.perks li { display: flex; align-items: center; gap: 14px; }
.perks svg { flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: #f1f1ee; fill: none; stroke: var(--black); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.perks span { display: grid; font-size: 14px; color: var(--grey); }
.perks b { font-size: 16px; font-weight: 600; color: var(--black); }

.cta {
  display: flex; align-items: center; justify-content: center; min-height: 58px;
  border-radius: 14px; background: var(--black); color: var(--white);
  font: 600 17px var(--sans); text-decoration: none;
}
.cta:hover { opacity: .88; }
.fine { font-size: 12px; line-height: 1.5; color: var(--grey); margin-top: -8px; display: grid; gap: 4px; }
.c-row > b { position: relative; }
.c-row sup { position: absolute; left: 100%; top: -2px; margin-left: 1px; font-size: 11px; font-weight: 600; line-height: 1; }

.p-col { display: grid; gap: 22px; align-content: start; min-width: 0; }
.panel.empty-cart .vs, .panel.empty-cart .wins, .panel.empty-cart .month { opacity: .35; }

@media (max-width: 400px) {
  .panel { padding-inline: 16px; }
  .c-row { grid-template-columns: 1fr 82px 92px; font-size: 14px; }
  .c-row sup { position: static; margin-left: 1px; }
  .c-total { font-size: 16px; }
}

/* ?embed: inside the home page's "zéro commission" section. No header, no
   full-screen heights (the frame grows to fit the content). */
.embed { min-height: 0; background: transparent; }
.embed .sim-top { display: none; }
.embed .sim-main { padding: 20px 16px 20px; }
.embed .search-view { min-height: 420px; }
.embed .result-view { padding-top: 4px; }
.embed .r-head { margin-bottom: 16px; }
.embed .r-head h1 { font-size: clamp(30px, 6vw, 40px); }
.embed .perks { display: none; }
.embed .view { max-width: none; }
.embed .load-view { min-height: 420px; }
/* Narrow frame: same content, tighter, so the result needs less scrolling. */
@media (max-width: 759px) {
  .embed .sim-main { padding: 16px 12px; }
  .embed .panel { gap: 16px; padding: 4px 16px 18px; }
  .embed .p-col { gap: 16px; }
  .embed .win { padding: 14px; gap: 6px; }
  .embed .win strong { font-size: 30px; }
  .embed .month { padding: 16px 16px 12px; }
  .embed .m-net { font-size: 52px; }
  .embed .m-orders { margin-top: 8px; }
  .embed .fine { margin-top: -4px; }
}

/* The restaurant's app, live, to the right of the numbers on large screens. The column keeps its width:
   the phone sits outside it. */
.result-view { position: relative; }
.mock { position: absolute; top: clamp(24px, 10vh, 120px); left: calc(100% + 56px); width: 284px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.mock-phone { width: 284px; height: 594px; padding: 9px; border-radius: 48px; background: #0d0d0f; box-shadow: 0 0 0 2px #3a3a3e, 0 30px 70px rgba(0,0,0,.55); }
.mock-screen { width: 266px; height: 576px; border-radius: 39px; overflow: hidden; background: #fff; }
.mock-screen iframe { width: 390px; height: 844px; border: 0; transform: scale(.682); transform-origin: top left; }
.mock p { font-size: 14px; line-height: 1.4; color: rgba(255,255,255,.75); max-width: 250px; }
.mock p b { display: block; color: var(--white); font-size: 16px; }
.mock a { color: var(--white); font-weight: 600; font-size: 15px; text-underline-offset: 3px; }
.mock-open { justify-self: center; color: var(--black); font-weight: 600; font-size: 15px; text-underline-offset: 3px; }
@media (max-width: 1259px) { .mock { display: none !important; } }
@media (min-width: 1260px) { .mock-open { display: none !important; } }
