/* Storefront tokens mirror the dashboard's (apps/web/src/index.css): the paper,
   ink and default azure of decision 0015. The store's own colour overrides --brand. */
@font-face { font-family: 'Thmanyah Sans'; src: url('fonts/thmanyahsans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Thmanyah Sans'; src: url('fonts/thmanyahsans-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --brand: #1f63c8;
  --brand-deep: #1a4f9e;
  --brand-frost: #e6f0fd;
  --ink: #1e2a33;
  --ink-2: #4a5763;
  --ink-3: #5b6875;
  --line: #dfe6ef;
  --star: #f6cb65; /* the identity's butter */
  --canvas: #f6f7f8;
  --surface: #ffffff;
  --raise: #f1f6fd;
  --on-fill: #ffffff;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --radius-chip: 10px;
  --radius-tile: 16px;
  --radius-card: 22px;
  --radius-sheet: 32px;
  --font: 'Thmanyah Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--canvas); color: var(--ink); line-height: 1.6; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
main { max-width: 1080px; margin: 0 auto; padding: 0 16px 96px; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; font-size: 18px; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Checked by Dawzan (O-06): the store's own colour, quiet beside its name. */
.verified { flex-shrink: 0; padding: 2px 8px; border-radius: var(--radius-chip); background: var(--brand-frost); color: var(--brand-deep); font-size: 12px; font-weight: 600; }
.logo { flex: none; width: 36px; height: 36px; border-radius: var(--radius-chip); object-fit: contain; background: var(--surface); }
.cover { margin: 16px 0 0; aspect-ratio: 8 / 3; overflow: hidden; border-radius: var(--radius-card); background: var(--brand-frost); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cart-button { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--brand-frost); color: var(--brand-deep); }
.cart-count { position: absolute; top: -2px; inset-inline-start: -2px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: var(--on-fill); font-size: 12px; line-height: 20px; text-align: center; }

.hero { padding: 28px 4px 12px; }
.hero h1 { margin: 0; font-size: 28px; }
.hero p { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }
.hero .hero-kind { color: var(--brand-deep); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0 16px; }
.chip { min-height: 40px; padding: 6px 16px; border: 1px solid var(--line); border-radius: var(--radius-chip); background: var(--surface); color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand); color: var(--on-fill); }
a.chip { display: inline-flex; align-items: center; text-decoration: none; }
a.chip[aria-current="page"] { border-color: var(--brand); background: var(--brand); color: var(--on-fill); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Finding a product (wave A): a search, filters and the order, from the page's address. */
.finder { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.search input { width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-tile); background: var(--surface); color: var(--ink); font: inherit; }
.search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.filters summary { cursor: pointer; width: fit-content; padding: 6px 2px; color: var(--brand-deep); font-weight: 600; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 8px 0; }
.filter-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.filter-grid select, .filter-grid input { min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-chip); background: var(--surface); color: var(--ink); font: inherit; }
.filter-actions { display: flex; align-items: center; gap: 12px; }
.related { margin-top: 32px; }
.related h2 { margin: 0 0 12px; font-size: 18px; }

.chip:disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 12px; border-radius: var(--radius-card); background: var(--surface); transition: transform .15s ease; }
.card:active { transform: scale(.98); }
.thumb { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-tile); background: var(--raise); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--brand-deep); font-size: 40px; font-weight: 700; background: var(--brand-frost); }
.placeholder.big { aspect-ratio: 1; border-radius: var(--radius-card); font-size: 72px; }
.tag { position: absolute; top: 8px; inset-inline-start: 8px; padding: 2px 10px; border-radius: var(--radius-chip); background: var(--ink); color: var(--on-fill); font-size: 12px; }
.name { padding: 0 4px; font-size: 15px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.price { padding: 0 4px; font-weight: 700; color: var(--brand-deep); }
.price.big { font-size: 24px; margin: 4px 0 12px; padding: 0; }
.was { color: var(--ink-2); font-weight: 400; font-size: .85em; }
.offer-line { display: inline-block; margin: 0; padding: 2px 10px; border-radius: 999px; background: var(--star); color: var(--ink); font-size: 13px; font-weight: 700; }
.tag.offer { background: var(--star); color: var(--ink); }
.empty { padding: 48px 0; text-align: center; color: var(--ink-3); }

.product { display: grid; gap: 20px; padding-top: 16px; }
@media (min-width: 820px) { .product { grid-template-columns: 1fr 1fr; gap: 32px; padding-top: 32px; } }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius-card); }
.gallery img { flex: 0 0 100%; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-card); scroll-snap-align: start; background: var(--raise); }
.details h1 { margin: 0; font-size: 24px; }
.option { border: 0; margin: 0; padding: 0; }
.option legend { padding: 0; margin-bottom: 4px; font-size: 14px; color: var(--ink-2); }
.stock { min-height: 24px; margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.description { margin-top: 20px; color: var(--ink-2); }

.primary { min-height: 52px; padding: 12px 20px; border: 0; border-radius: var(--radius-tile); background: var(--brand); color: var(--on-fill); font-weight: 700; }
.primary:disabled { background: var(--line); color: var(--ink-3); cursor: not-allowed; }
.wide { width: 100%; }
.ghost { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--raise); color: var(--ink); }

.drawer { position: fixed; inset: 0; z-index: 10; }
.drawer[hidden] { display: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(16, 40, 96, .4); }
.drawer-panel { position: absolute; inset-inline: 0; bottom: 0; max-height: 85vh; overflow: auto; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; background: var(--surface); }
@media (min-width: 720px) { .drawer-panel { inset-inline-start: auto; top: 0; bottom: 0; width: 400px; max-height: none; border-radius: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head h2 { margin: 0; font-size: 20px; }
.cart-lines { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 12px; }
.cart-line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; }
.cart-line img, .cart-line .placeholder { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; font-size: 20px; }
.cart-line small { display: block; color: var(--ink-3); }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.cart-empty { color: var(--ink-3); }
.total { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 18px; }
.note { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }
.foot { padding: 24px 16px 40px; text-align: center; font-size: 13px; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Checkout and order tracking */
.button-link { display: grid; place-items: center; text-align: center; }
.checkout, .order-page { max-width: 560px; margin: 0 auto; padding-top: 24px; }
.checkout h1, .order-page h1 { margin: 0 0 12px; font-size: 26px; }
.summary { padding: 12px; border-radius: var(--radius-card); background: var(--surface); }
.cart-line.static { grid-template-columns: 1fr auto auto; }
.form { display: grid; gap: 14px; margin-top: 16px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.form[hidden], .form label[hidden], .card-face[hidden] { display: none; }
/* How the order is collected (com.orders): delivery, the shop, or the car. */
.fields { display: grid; gap: 14px; }
.fields[hidden] { display: none; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.book-link { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.loyalty-earned[hidden] { display: none; }
.ways { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.ways legend { margin-bottom: 6px; font-size: 14px; color: var(--ink-2); }
.way { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-tile); background: var(--surface); }
.way:has(input:checked) { border-color: var(--brand); background: var(--brand-frost); }
.form .way { display: inline-flex; align-items: center; gap: 6px; }
.form .way input { min-height: 0; padding: 0; border: 0; accent-color: var(--brand); }
.form input, .form select, .form textarea { font: inherit; font-size: 16px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-tile); background: var(--surface); color: var(--ink); }
.form textarea { min-height: 72px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.optional { color: var(--ink-3); font-size: 12px; }
.totals { display: grid; gap: 6px; padding: 14px; border-radius: var(--radius-tile); background: var(--raise); }
.totals div { display: flex; justify-content: space-between; }
.totals div[hidden] { display: none; }
.totals .grand { font-size: 18px; font-weight: 700; }
.error { margin: 0; padding: 10px 14px; border-radius: var(--radius-tile); background: var(--danger-soft); color: var(--danger); }
.eyebrow { margin: 0; color: var(--ink-3); }
.steps { list-style: none; display: grid; gap: 8px; margin: 16px 0; padding: 0; counter-reset: step; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--ink-3); }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--raise); font-size: 13px; }
.steps li.current { color: var(--ink); font-weight: 700; }
.steps li.current::before { background: var(--brand); color: var(--on-fill); }
.note-line { color: var(--ink-2); }
.address { margin: 16px 0 0; }
.address dt { color: var(--ink-3); font-size: 14px; }
.address dd { margin: 2px 0 0; }

.coupon-row { display: flex; gap: 8px; }
.locate { display: grid; gap: 6px; justify-items: start; }
.locate .note-line.small { margin: 0; }
.coupon-row input { flex: 1; }
.ghost-button { min-height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-tile); background: var(--surface); color: var(--brand-deep); font-weight: 700; }
.note-line.small { margin: -6px 0 0; font-size: 13px; color: var(--ink-3); }

/* Trust (com.trust): stars, reviews, badges, the return policy, the review form. */
.stars { color: var(--line); letter-spacing: 1px; }
.stars .on { color: var(--star); }
.rating-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--brand-frost); color: var(--brand-deep); font-size: 13px; font-weight: 700; }
.reviews { margin-top: 40px; }
.reviews h2 { margin: 0 0 12px; font-size: 20px; }
.reviews ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.reviews li { padding: 14px; border-radius: var(--radius-card); background: var(--surface); }
.reviews li p { margin: 6px 0; }
.reviews small { color: var(--ink-3); }
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; font-size: 13px; }
.trust li { padding: 6px 12px; border-radius: 999px; background: var(--raise); color: var(--ink-2); }
.policy { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
.review-form { margin-top: 24px; padding: 16px; border-radius: var(--radius-card); background: var(--surface); }
.review-form h2 { margin: 0; font-size: 18px; }
.rate { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; border: 0; margin: 0; padding: 0; }
.rate input { position: absolute; opacity: 0; }
.rate label { font-size: 32px; color: var(--line); cursor: pointer; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: var(--star); }
.rate input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 6px; }
.review-thanks { margin-top: 24px; padding: 16px; border-radius: var(--radius-card); background: var(--brand-frost); text-align: center; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Loyalty: what a buyer earns, said before ordering and after delivery. */
.loyalty-note { color: var(--ink-2); }
.loyalty-note::first-letter, .loyalty-earned::first-letter { color: var(--star); }
.loyalty-earned { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-card); background: var(--raise); font-weight: 700; text-align: center; }
/* The buyer's points card: the store's colour as the card, the balance large on it. */
.card-face { display: grid; gap: 0; }
.card-face .note-line { margin-top: 12px; }
.card-face .card-name, .card-face .card-points { margin: 0; padding: 0 20px; background: var(--brand); color: var(--on-fill); }
.card-face .card-name { padding-top: 20px; border-radius: var(--radius-card) var(--radius-card) 0 0; font-weight: 700; }
.card-face .card-points { padding-bottom: 20px; border-radius: 0 0 var(--radius-card) var(--radius-card); font-size: 40px; font-weight: 700; }
.card-face .card-points::before { content: '★ '; color: var(--star); }
.card-face h2 { margin: 12px 0 0; font-size: 16px; }
/* Gold pieces (com.jewelry): karat, weight, and that the price follows gold. */
.gold-line { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
/* The table menu (restaurants): sections, dishes, and the order tray. */
.menu-sections { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; background: var(--canvas); }
.menu-sections a { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; }
.menu-section h2 { margin: 24px 0 8px; }
.menu-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.menu-item { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-card); background: var(--surface); }
.menu-item img { flex: none; border-radius: 12px; object-fit: cover; }
.menu-text { min-width: 0; flex: 1; }
.menu-text p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.menu-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.choice { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--raise); cursor: pointer; }
.choice:disabled { opacity: .5; cursor: default; }
.tray { position: sticky; bottom: 0; z-index: 3; margin-top: 24px; padding: 12px 16px; border-radius: var(--radius-card) var(--radius-card) 0 0; background: var(--surface); box-shadow: 0 -8px 24px rgb(0 0 0 / 8%); max-height: 75vh; overflow-y: auto; }
.tray details { display: grid; gap: 10px; }
.tray details[open] > :not(summary) { margin-top: 10px; }
.tray-summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.tray-summary::-webkit-details-marker { display: none; }
/* The menu's languages (com.menu): Arabic, Kurdish (Sorani) and English. */
.menu-languages { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.menu-languages a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.menu-languages a[aria-current] { border-color: var(--brand); background: var(--brand); color: var(--on-fill); }
/* The printed menu: one sheet of names and prices. */
.print-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.print-head { display: grid; justify-items: center; gap: 4px; margin-bottom: 20px; text-align: center; }
.print-head img { border-radius: 16px; object-fit: cover; }
.print-head h1 { margin: 0; }
.print-section { break-inside: avoid; margin-bottom: 20px; }
.print-section h2 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--brand); font-size: 20px; }
.print-section ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.print-section li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; break-inside: avoid; }
.print-section li p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
.print-prices { display: grid; justify-items: end; gap: 2px; font-weight: 700; white-space: nowrap; }
@media print {
  .bar, .foot, .print-tools { display: none; }
  body { background: var(--surface); }
  .menu-print { columns: 2; column-gap: 32px; }
  .print-head { column-span: all; }
}
.tray-summary strong { margin-inline-start: auto; }
.tray-open { padding: 8px 14px; border-radius: 999px; background: var(--brand); color: var(--on-fill); font-size: 14px; font-weight: 700; }
.tray details[open] .tray-open { display: none; }
.tray .cart-line { display: flex; align-items: center; gap: 10px; }
.tray .cart-line div { flex: 1; }

/* The merchant's front page sections and own pages (wave A). */
.home-section { margin-top: 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title { margin: 0; font-size: 19px; }
.section-head a { color: var(--brand-deep); font-size: 14px; font-weight: 600; text-decoration: none; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 44%); gap: 12px; overflow-x: auto; padding: 0 0 8px; margin: 0; list-style: none; scroll-snap-type: x mandatory; }
.row > li { scroll-snap-align: start; }
@media (min-width: 720px) { .row { grid-auto-columns: 200px; } }
.home-text { padding: 18px; border-radius: var(--radius-card); background: var(--brand-frost); }
.home-text p { margin: 6px 0 0; color: var(--ink-2); }
.all-title { margin: 28px 0 0; font-size: 19px; }
.store-page { max-width: 720px; padding: 16px 0 32px; }
.store-page h1 { margin: 8px 0 16px; }
.page-body { color: var(--ink-2); line-height: 1.9; }
.foot-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-bottom: 6px; }
.foot-pages a { color: var(--ink-2); }

/* A buyer's account (G-07). */
.account-link { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-inline-start: auto; color: var(--ink); }
.account-gate, .account { max-width: 640px; padding: 16px 0 32px; }
.account-gate h1, .account h1 { margin: 8px 0; }
.account h2 { margin: 28px 0 10px; font-size: 18px; }
.account-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.stack input, .stack select { min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-tile); background: var(--surface); color: var(--ink); font: inherit; }
.problem { padding: 10px 14px; border-radius: var(--radius-tile); background: var(--danger-soft); color: var(--danger); }
.account-orders, .account-addresses, .account-saved { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.account-orders li, .account-addresses li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-tile); background: var(--surface); }
.row-actions { display: flex; gap: 6px; }
.points-line { padding: 10px 14px; border-radius: var(--radius-tile); background: var(--brand-frost); }
.save-later { margin-top: 8px; }
.account .note, .account-gate .note { text-align: start; }

/* Basket deals on a product (decision 0023). */
.deal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.deal-tags li { padding: 4px 10px; border-radius: var(--radius-chip); background: var(--brand-frost); color: var(--brand-deep); font-size: 13px; font-weight: 700; }

/* A buyer's code to bring a friend (decision 0023). */
.referral { margin-top: 20px; padding: 16px; border-radius: var(--radius-card); background: var(--brand-frost); }
.referral h2 { margin: 0 0 6px; font-size: 18px; }
.referral-code { margin: 10px 0; font-size: 22px; font-weight: 700; letter-spacing: 2px; color: var(--brand-deep); }
.referral-link { width: 100%; }
