:root {
  --shelf: #e9eeea;
  --paper: #ffffff;
  --ink: #17201c;
  --ink-2: #4c5852;
  --line: #cfd8d2;
  --tag: #ffd43b;
  --save: #0c7a48;
  --miss: #c2362b;
  --focus: #1d5fd1;
  --display: "Secular One", "Assistant", sans-serif;
  --body: "Assistant", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shelf: #151b18; --paper: #222a26; --ink: #e8efea; --ink-2: #a9b6af; --line: #36413b;
    --tag: #f2c94c; --save: #45c486; --miss: #ef6b5f; --focus: #7aa7ff;
  }
}
:root[data-theme="dark"] {
  --shelf: #151b18; --paper: #222a26; --ink: #e8efea; --ink-2: #a9b6af; --line: #36413b;
  --tag: #f2c94c; --save: #45c486; --miss: #ef6b5f; --focus: #7aa7ff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--shelf); color: var(--ink);
  font: 17px/1.5 var(--body); font-variant-numeric: tabular-nums;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--ink); background: var(--paper); }

.top { padding: 28px 16px 8px; max-width: 1180px; margin: 0 auto; }
.brand { font: 400 clamp(44px, 9vw, 72px)/0.95 var(--display); margin: 0; letter-spacing: -0.01em; }
.tagline { margin: 6px 0 0; color: var(--ink-2); font-size: 19px; }

.layout {
  max-width: 1180px; margin: 0 auto; padding: 16px;
  display: grid; gap: 24px; grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 380px 1fr; align-items: start; }
}

.panel { background: var(--paper); border-radius: 14px; padding: 20px 18px; border: 1px solid var(--line); }
.panel h2 { font: 400 24px/1.2 var(--display); margin: 0 0 12px; }
.loc-h { margin-top: 28px !important; }

.search { position: relative; }
.search input, .addr input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
}
.search input:focus, .addr input:focus { border-color: var(--ink); outline: none; }
.suggest {
  position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 5; margin: 0; padding: 4px;
  list-style: none; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 10px;
  max-height: 360px; overflow: auto; box-shadow: 0 10px 30px rgb(0 0 0 / .18);
}
.suggest li { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--shelf); }
.suggest .s-name { font-weight: 600; }
.suggest .s-meta { color: var(--ink-2); font-size: 14px; grid-column: 1; }
.suggest .s-price { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.suggest .s-none { cursor: default; color: var(--ink-2); }

.basket { list-style: none; margin: 14px 0 0; padding: 0; }
.basket li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.basket .b-name { font-weight: 600; line-height: 1.3; }
.basket .b-meta { color: var(--ink-2); font-size: 14px; }
.qty { display: flex; align-items: center; gap: 2px; grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.qty button { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line); background: none; font-size: 20px; line-height: 1; }
.qty output { min-width: 2.2em; text-align: center; font-weight: 700; }
.empty { color: var(--ink-2); margin: 12px 0 0; }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--ink-2); text-decoration: underline; font-size: 15px; }

.loc { display: flex; flex-wrap: wrap; gap: 8px; }
.addr { display: flex; gap: 8px; flex: 1 1 220px; }
.btn-secondary { padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--paper); white-space: nowrap; font-weight: 600; }
.loc-label { margin: 8px 0 0; font-size: 15px; color: var(--ink-2); min-height: 1.5em; }
.radius { display: block; margin-top: 8px; color: var(--ink-2); }
.radius select { padding: 4px 6px; border-radius: 8px; border: 1.5px solid var(--line); }

.btn-primary {
  margin-top: 22px; width: 100%; padding: 15px; border: 0; border-radius: 12px;
  background: var(--tag); color: #17201c; font: 400 22px/1 var(--display);
}
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.status { min-height: 1.5em; margin: 10px 0 0; color: var(--ink-2); }
.status.err { color: var(--miss); }

.intro { max-width: 60ch; color: var(--ink-2); font-size: 18px; }
.fine { font-size: 14px; color: var(--ink-2); }
.disclaimer { max-width: 75ch; margin-top: 28px; }

/* ── the receipts ───────────────────────────── */
.receipts { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); align-items: start; }
.receipt {
  --tear: 10px;
  position: relative; background: var(--paper); padding: 22px 18px calc(18px + var(--tear));
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / .08)) drop-shadow(0 8px 16px rgb(0 0 0 / .07));
  -webkit-mask: conic-gradient(from 135deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--tear)) var(--tear) repeat-x,
                linear-gradient(#000 0 0) top / 100% calc(100% - var(--tear)) no-repeat;
          mask: conic-gradient(from 135deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--tear)) var(--tear) repeat-x,
                linear-gradient(#000 0 0) top / 100% calc(100% - var(--tear)) no-repeat;
}
.receipt.win { outline: 0; }
.r-kind {
  display: inline-block; background: var(--tag); color: #17201c; font: 400 17px/1 var(--display);
  padding: 7px 12px 6px; border-radius: 4px; transform: rotate(-1.5deg); margin-bottom: 12px;
}
.r-kind.delivery { background: #bfe3d0; }
.r-kind.split, .r-kind.split_mixed, .r-kind.split_online { background: #d6ccff; }
.r-fees { margin-top: -6px; padding-top: 8px; border-top-style: dotted; color: var(--ink-2); }
.r-chain { font: 400 24px/1.15 var(--display); margin: 0; }
.r-chain .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-inline-end: 8px; vertical-align: 2px; }
.r-store { color: var(--ink-2); font-size: 15px; margin: 2px 0 0; }
.r-lines { list-style: none; margin: 14px 0; padding: 12px 0 0; border-top: 2px dashed var(--line); font-size: 15px; }
.r-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.r-lines .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-lines .pr { white-space: nowrap; }
.r-lines .promo { color: var(--save); font-size: 13px; display: block; white-space: normal; }
.r-lines .miss { color: var(--miss); }
.r-lines .sub { font-weight: 700; margin-top: 6px; }
.r-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--ink); padding-top: 10px; }
.r-total span:first-child { font-weight: 700; }
.r-total strong { font: 400 34px/1 var(--display); }
.r-total .cur { font: 700 26px/1 var(--body); margin-inline-start: 2px; } /* Secular One has no proper ₪ glyph */
.r-notes { margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.r-notes li { margin-top: 3px; }
.r-notes .good { color: var(--save); font-weight: 600; }
.r-notes .bad { color: var(--miss); font-weight: 600; }
.r-more { margin-top: 10px; background: none; border: 0; padding: 0; text-decoration: underline; color: var(--ink-2); font-size: 14px; }

/* ── delivery first ─────────────────────────── */
.group + .group { margin-top: 34px; }
.group-h { font: 400 26px/1.2 var(--display); margin: 0 0 14px; }
.deliv { background: #bfe3d0; border-radius: 16px; padding: 18px 16px 20px; color: #17201c; }
.deliv .receipt { color: var(--ink); }
.receipt.featured { border-top: 6px solid var(--save); }
.deliv-sites { margin-top: 18px; }
@media (min-width: 1100px) {
  .deliv { display: grid; grid-template-columns: minmax(270px, 1fr) minmax(260px, 1fr); gap: 0 22px; align-items: start; }
  .deliv .group-h { grid-column: 1 / -1; }
  .deliv .receipts { grid-template-columns: 1fr; }
  .deliv-sites { margin-top: 0; }
}
.deliv-sites h4 { font: 400 19px/1.2 var(--display); margin: 0 0 8px; }
.deliv-sites ol { list-style: none; margin: 0; padding: 0; background: var(--paper); color: var(--ink); border-radius: 12px; }
.deliv-sites li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.deliv-sites li:last-child { border-bottom: 0; }
.deliv-sites .d-name { font-weight: 700; }
.deliv-sites .d-name .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 7px; }
.deliv-sites .d-meta { font-size: 14px; color: var(--ink-2); }
.deliv-sites .d-meta .bad { color: var(--miss); font-weight: 600; }
.deliv-sites .d-total { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 700; font-size: 19px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .deliv { background: #1f3a2d; color: var(--ink); } }
:root[data-theme="dark"] .deliv { background: #1f3a2d; color: var(--ink); }

/* ── all stores list ────────────────────────── */
.all { margin-top: 34px; }
.all-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.all-head h3 { font: 400 22px/1.2 var(--display); margin: 0; }
.sort { display: flex; border: 1.5px solid var(--ink); border-radius: 10px; overflow: hidden; }
.sort button { border: 0; background: var(--paper); padding: 7px 12px; font-weight: 600; }
.sort button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.all-list { list-style: none; margin: 12px 0 0; padding: 0; background: var(--paper); border-radius: 12px; border: 1px solid var(--line); }
.all-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.all-list li:last-child { border-bottom: 0; }
.all-list .a-name { font-weight: 600; }
.all-list .a-name .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 7px; }
.all-list .a-meta { font-size: 14px; color: var(--ink-2); }
.all-list .a-total { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 700; font-size: 19px; text-align: start; }
.all-list .a-total small { display: block; font-weight: 400; font-size: 13px; color: var(--miss); }

@media (prefers-reduced-motion: no-preference) {
  .receipt { animation: print .45s cubic-bezier(.2, .7, .2, 1) both; }
  .receipt:nth-child(2) { animation-delay: .07s; }
  .receipt:nth-child(3) { animation-delay: .14s; }
  .receipt:nth-child(4) { animation-delay: .21s; }
  @keyframes print { from { clip-path: inset(0 0 100% 0); transform: translateY(-8px); } to { clip-path: inset(0 0 0 0); transform: none; } }
}
