/* Foona web app. The result cards come from ui/panel.css (shared with the
 * extension); this file is the page around them. Colours follow SnappFood's
 * Bonyan palette so a card looks the same in both places. */

@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-Bold.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(/fonts/Vazirmatn-Black.woff2) format("woff2"); font-weight: 800 900; font-display: swap; }

:root {
  --pink: #EE1D89;
  --pink-ink: #B8106A;
  --ink: #1f1f1f;
  --muted: #6b6b6b;
  --line: #ececec;
  --surface: #ffffff;
  --page: #f7f7f8;
  --chip: #fff0f7;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2f2f2; --muted: #a8a8a8; --line: #2c2c2e; --surface: #1c1c1e; --page: #111113; --chip: #3a1529; --pink-ink: #ff7ab8;
  }
}
:root[data-theme="dark"] {
  --ink: #f2f2f2; --muted: #a8a8a8; --line: #2c2c2e; --surface: #1c1c1e; --page: #111113; --chip: #3a1529; --pink-ink: #ff7ab8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Vazirmatn, iranSansX, Tahoma, system-ui, sans-serif;
  background: var(--page); color: var(--ink);
  line-height: 1.7; -webkit-text-size-adjust: 100%;
}
/* The shared cards ask for iranSansX, which only snappfood.ir ships. */
.foona-root, .foona-root * { font-family: Vazirmatn, iranSansX, Tahoma, system-ui, sans-serif; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.app-logo { width: 44px; height: 44px; object-fit: contain; }
.app-brand h1 { margin: 0; font-size: 18px; font-weight: 900; color: var(--pink); line-height: 1.2; }
.app-brand p { margin: 0; font-size: 12px; color: var(--muted); }
.app-where {
  margin-inline-start: auto; max-width: 48%;
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
}
.app-where-label { font-size: 11px; color: var(--muted); }
.app-where-name { font-size: 13px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-main { max-width: 720px; margin: 0 auto; padding: 14px 16px 24px; }

.app-search { display: flex; gap: 8px; }
.app-search input {
  flex: 1; min-width: 0; padding: 12px 14px; font: inherit; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
}
.app-search input:focus { outline: none; border-color: var(--pink); }
.app-search button {
  padding: 0 20px; border: 0; border-radius: 14px; font: inherit; font-weight: 800; font-size: 15px;
  color: #fff; background: var(--pink); cursor: pointer;
}
.app-search button:disabled { opacity: .55; cursor: default; }

.app-chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.app-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap;
}
.chip-soft { background: var(--chip); border-color: transparent; color: var(--pink-ink); font-weight: 700; }

.app-results { margin-top: 10px; }
/* The shared panel styles assume a white floating panel; give cards a surface here. */
.app-results .foona-card, .app-results .foona-basket { background: var(--surface); }

.app-busy { padding: 28px 8px; text-align: center; color: var(--muted); }
.app-busy-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 14px; }
.app-busy-bar span { display: block; height: 100%; width: 35%; background: var(--pink); border-radius: 4px; animation: app-slide 1.1s ease-in-out infinite; }
@keyframes app-slide { 0% { transform: translateX(200%); } 100% { transform: translateX(-300%); } }
@media (prefers-reduced-motion: reduce) { .app-busy-bar span { animation: none; width: 100%; opacity: .5; } }
.app-busy-msg { font-weight: 700; color: var(--ink); }
.app-busy-time { font-size: 12px; margin-top: 4px; }

.app-sheet {
  width: min(560px, calc(100vw - 24px)); max-height: 82vh; padding: 0;
  border: 0; border-radius: 18px; background: var(--surface); color: var(--ink);
}
.app-sheet::backdrop { background: rgba(0, 0, 0, .45); }
.app-sheet-body { padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.app-sheet h2 { margin: 0; font-size: 17px; font-weight: 900; }
.app-hint { margin: 0; font-size: 12px; color: var(--muted); }
.app-sheet input, .app-sheet select {
  width: 100%; padding: 11px 12px; font: inherit; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink);
}
.app-sheet input:focus { outline: none; border-color: var(--pink); }
.app-places { list-style: none; margin: 0; padding: 0; max-height: 40vh; overflow-y: auto; }
.app-places button {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: right;
  padding: 10px 8px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; cursor: pointer;
}
.app-places button span { font-size: 12px; color: var(--muted); }
.app-places-msg { padding: 10px 8px; font-size: 13px; color: var(--muted); }
.app-sheet-actions { display: flex; gap: 8px; justify-content: flex-end; }

.app-foot { max-width: 720px; margin: 0 auto; padding: 8px 16px 28px; font-size: 11px; color: var(--muted); text-align: center; }
.app-chips[hidden] { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-results .foona-allin { background: #26262a; color: var(--muted); }
  :root:not([data-theme="light"]) .app-results .foona-allin b { color: var(--ink); }
}

/* «آدرس‌های من در اسنپ‌فود», shown only when the Foona extension said hello. */
.app-sf { width: 100%; padding: 11px 14px; border-color: var(--pink, #EE1D89); color: var(--pink, #EE1D89); font-weight: 700; }
.app-sf[hidden], .app-sf-hint[hidden] { display: none; }
.app-sf-hint { font-size: 11.5px; }

/* UX v2 landing (ui/flags.js). The shared .foona-v2-* rules live in ui/panel.css. */
.app-v2-hero { margin-bottom: 12px; }
.app-v2-hero h3 { font-size: 19px; color: var(--ink); }
.app-v2-hero p { color: var(--muted); }
.app-v2-landing { margin-top: 10px; }
.app-v2-landing .foona-v2-intent, .app-v2-landing .foona-v2-example { font-family: inherit; color: var(--ink); background: var(--surface); }
