/* Lulumi mini app. Cream background, the logo's pink, small gold details. One phone-width column. */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn%5Bwght%5D.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --cream: #FFF7F1; --plate: #FDE8E7; --pink-bg: #FECEDE; --pink: #FD91B3;
  --berry: #CC3C76; --berry-dark: #A92B5E; --ink: #4A2B3A; --muted: #86616F;
  --gold: #C79A3E; --gold-soft: #EBCB8B; --line: #F3D9D6; --white: #FFFFFF;
  --ok: #2F8F63; --warn: #B8631B; --bad: #B3261E;
  --font: 'Vazirmatn', Tahoma, system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink); font-family: var(--font);
  font-size: 15px; line-height: 1.7; direction: rtl;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; }
#shell { max-width: 430px; min-height: 100vh; min-height: 100dvh; margin-inline: auto; display: flex; flex-direction: column; }
@media (min-width: 520px) {
  body { background: var(--pink-bg); }
  #shell { background: var(--cream); border-radius: 32px; margin-block: 20px; min-height: calc(100vh - 40px); padding-inline: 16px; box-shadow: 0 18px 50px rgba(204, 60, 118, .18); }
}
#view { display: flex; flex-direction: column; gap: 16px; padding-block: 14px 20px; }

/* hero */
.hero { position: relative; display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 28px; background: linear-gradient(135deg, #FFE6EE, var(--pink-bg)); border: 1.5px solid var(--gold-soft); overflow: hidden; }
.hero img { width: 104px; height: 104px; flex: none; border-radius: 24px; border: 2px solid var(--white); box-shadow: 0 0 0 1.5px var(--gold-soft); }
.hero .tx { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hero h1 { margin: 0; font-size: 28px; font-weight: 800; color: var(--berry); line-height: 1.2; }
.hero .tag { display: block; direction: ltr; text-align: right; font-size: 12px; font-weight: 500; color: #8E4A7E; letter-spacing: .02em; }
.chip-free { align-self: flex-start; margin-top: 4px; background: var(--white); border: 1px solid var(--gold-soft); color: var(--berry-dark); font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.spark { position: absolute; width: 14px; height: 14px; fill: var(--gold); }
.welcome { margin: 0; text-align: center; font-size: 16px; font-weight: 700; color: var(--berry-dark); }
.sec-title { margin: 0; font-size: 17px; font-weight: 800; }
.closed { background: #FFF3E0; border: 1px solid #F2C98B; color: #7A4A0F; border-radius: 16px; padding: 10px 14px; font-size: 14px; }

/* search + categories */
.search { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1.5px solid var(--line); border-radius: 999px; padding: 2px 16px; }
.search:focus-within { border-color: var(--berry); box-shadow: 0 0 0 3px var(--pink-bg); }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 9px 0; outline: none; }
.search input::placeholder { color: var(--muted); }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-block: 2px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; border: 1.5px solid var(--line); background: var(--white); padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); }
.cat.on { background: var(--berry); border-color: var(--berry); color: var(--white); }

/* products */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 8px 8px 10px; min-width: 0; }
.card.out .tile { filter: grayscale(.7); opacity: .65; }
.tile { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; display: grid; place-items: center; font-size: 54px; background: linear-gradient(145deg, var(--a), var(--b)); overflow: hidden; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile::after { content: "✦"; position: absolute; top: 8px; inset-inline-end: 10px; font-size: 14px; color: var(--gold); z-index: 1; text-shadow: 0 0 3px #fff; }
.badge { position: absolute; z-index: 2; top: 8px; inset-inline-start: 8px; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--white); }
.badge.low { color: var(--warn); }
.badge.out { color: var(--muted); }
.card .nm { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3em; padding-inline: 2px; overflow-wrap: anywhere; }
.card .ft { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-inline: 2px; }
.price { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.price b { font-size: 15px; font-weight: 800; }
.price small { font-size: 11px; color: var(--muted); }
.btn-add { width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%; background: var(--berry); color: var(--white); font-size: 22px; line-height: 1; display: grid; place-items: center; }
.btn-add:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; font-size: 11px; width: auto; border-radius: 999px; padding: 4px 10px; }
.stepper { display: flex; align-items: center; gap: 2px; background: var(--plate); border-radius: 999px; padding: 2px; flex: none; }
.stepper button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--white); color: var(--berry-dark); font-size: 18px; line-height: 1; font-weight: 700; }
.stepper span { min-width: 24px; text-align: center; font-weight: 700; }

/* dock */
.dock { position: sticky; bottom: 0; margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-block: 14px 12px; background: linear-gradient(to top, var(--cream) 62%, rgba(255, 247, 241, 0)); }
.cartbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; background: var(--berry); color: var(--white); border-radius: 999px; padding: 10px 18px; font-weight: 600; box-shadow: 0 8px 20px rgba(204, 60, 118, .28); }
.cartbar b { font-weight: 800; }
.nav { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--white); border: 1.5px solid var(--gold-soft); border-radius: 999px; padding: 4px; }
.nav button { position: relative; border: 0; background: none; border-radius: 999px; padding: 6px 4px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; align-items: center; line-height: 1.35; }
.nav button .ic { font-size: 18px; }
.nav button.on { background: var(--pink-bg); color: var(--berry-dark); }
.nav .dot { position: absolute; top: 2px; inset-inline-start: calc(50% + 8px); min-width: 18px; height: 18px; padding-inline: 4px; border-radius: 999px; background: var(--berry); color: var(--white); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* sub screens */
.head { display: flex; align-items: center; gap: 10px; }
.head h2 { margin: 0; font-size: 20px; font-weight: 800; flex: 1; }
.back { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--white); font-size: 18px; color: var(--berry-dark); }
.refresh { border: 1.5px solid var(--line); background: var(--white); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--berry-dark); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row .tile { width: 64px; flex: none; font-size: 30px; border-radius: 14px; }
.row .tile::after { display: none; }
.row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .info .nm { font-weight: 600; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.row .info .pr { font-size: 13px; color: var(--muted); }
.sep { height: 1px; background: var(--line); border: 0; margin: 0; }
.sum { display: flex; justify-content: space-between; gap: 10px; }
.sum.total { font-size: 17px; font-weight: 800; }
.sum .free { color: var(--ok); font-weight: 700; }
.prog { height: 10px; border-radius: 999px; background: var(--plate); overflow: hidden; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold-soft)); border-radius: 999px; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.cta { border: 0; background: var(--berry); color: var(--white); border-radius: 999px; padding: 12px 18px; font-size: 16px; font-weight: 700; width: 100%; box-shadow: 0 8px 20px rgba(204, 60, 118, .25); }
.cta:disabled { background: #D9B7C5; box-shadow: none; cursor: not-allowed; }
.cta.ghost { background: var(--white); color: var(--berry-dark); border: 1.5px solid var(--berry); box-shadow: none; }
.cta.small { padding: 8px 14px; font-size: 14px; }
.empty { text-align: center; padding: 36px 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty .big { font-size: 48px; }
.err { color: var(--bad); font-size: 14px; margin: 0; }
.skeleton { height: 220px; border-radius: 22px; background: linear-gradient(90deg, var(--plate), #FFF0EE, var(--plate)); background-size: 200% 100%; animation: sh 1.2s infinite linear; }
@keyframes sh { to { background-position: -200% 0; } }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .legend { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field textarea { border: 1.5px solid var(--line); background: var(--cream); border-radius: 14px; padding: 10px 12px; width: 100%; }
.field textarea { min-height: 76px; resize: vertical; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 12px; background: var(--cream); cursor: pointer; }
.opt.on { border-color: var(--berry); background: #FFF0F5; box-shadow: 0 0 0 1px var(--berry) inset; }
.opt input { accent-color: var(--berry); width: 18px; height: 18px; flex: none; margin: 0; }
.opt .t { flex: 1; min-width: 0; font-weight: 600; }
.opt .t small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.opt .p { font-size: 13px; font-weight: 700; white-space: nowrap; }

/* done + tracking */
.ok-badge { width: 64px; height: 64px; border-radius: 50%; background: var(--pink-bg); display: grid; place-items: center; font-size: 30px; border: 2px solid var(--gold-soft); margin-inline: auto; }
.center { text-align: center; }
.cardnum { direction: ltr; text-align: center; font-size: 20px; font-weight: 700; letter-spacing: .06em; background: var(--cream); border: 1.5px dashed var(--gold); border-radius: 14px; padding: 10px; user-select: all; }
.order { display: flex; flex-direction: column; gap: 10px; }
.order .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.order .code { font-weight: 800; }
.order .meta { font-size: 13px; color: var(--muted); }
.order ul { margin: 0; padding-inline-start: 18px; font-size: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li { position: relative; display: flex; gap: 10px; align-items: flex-start; padding-bottom: 12px; color: var(--muted); }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 5px; border-radius: 50%; border: 2px solid var(--line); background: var(--white); z-index: 1; }
.steps li::after { content: ""; position: absolute; inset-inline-start: 7px; top: 22px; bottom: -5px; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--pink); border-color: var(--pink); }
.steps li.done::after { background: var(--pink); }
.steps li.now { color: var(--berry-dark); font-weight: 700; }
.steps li.now::before { background: var(--white); border-color: var(--berry); box-shadow: 0 0 0 3px var(--pink-bg); }
.steps small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.cancelled { color: var(--bad); font-weight: 700; }
.toast { position: fixed; inset-inline: 0; bottom: calc(120px + env(safe-area-inset-bottom, 0px)); margin-inline: auto; width: max-content; max-width: calc(100% - 32px); background: var(--ink); color: var(--white); padding: 8px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; text-align: center; }
.toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } .skeleton { animation: none; } }
