/* ===== چاپینو — استایل اصلی ===== */
@font-face {
  font-family: "Vazirmatn";
  src: url("../assets/fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --primary: #4b2bd6;
  --primary-2: #6a3df0;
  --primary-soft: #efeaff;
  --primary-line: #d9d0ff;
  --bg: #f6f6fb;
  --card: #ffffff;
  --text: #1b1b2f;
  --muted: #8a8aa0;
  --line: #ececf4;
  --green: #16a34a;
  --green-soft: #e5f7ec;
  --red: #e11d48;
  --red-soft: #ffe8ee;
  --orange: #f59e0b;
  --orange-soft: #fff4de;
  --blue: #2563eb;
  --blue-soft: #e6eeff;
  --radius: 18px;
  --shadow: 0 4px 18px rgba(40, 30, 110, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, #e9e4ff, transparent 40%),
              radial-gradient(circle at 80% 90%, #e2ecff, transparent 40%), #f1f0f8;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1.6;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.lg { width: 28px; height: 28px; }
svg.i.fill { fill: currentColor; stroke: none; }

/* ----- قاب گوشی ----- */
.device {
  position: relative;
  width: 410px; height: min(880px, calc(100vh - 32px));
  background: var(--bg);
  border-radius: 44px;
  box-shadow: 0 0 0 10px #15142a, 0 30px 80px rgba(30, 20, 90, 0.35);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.statusbar {
  height: 40px; flex-shrink: 0; padding: 0 26px;
  display: flex; align-items: center; justify-content: space-between;
  direction: ltr; font-weight: 700; font-size: 15px; background: var(--bg);
}
.statusbar.purple { background: var(--primary); color: #fff; }
.statusbar .sb-icons { display: flex; gap: 6px; align-items: center; }
.statusbar svg { fill: currentColor; }
@media (max-width: 520px) {
  body { display: block; background: var(--bg); }
  .device { width: 100%; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; }
  .statusbar { display: none; }
  .view { padding-top: env(safe-area-inset-top); }
  .nav, .cta, .composer { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

.view { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.view::-webkit-scrollbar { width: 0; }
.page { padding: 8px 16px 24px; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ----- هدر ----- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 12px; }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 800; flex: 1; text-align: center; }
.topbar .sub { text-align: center; color: var(--muted); font-size: 12px; margin-top: -2px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  position: relative; color: var(--text);
}
.icon-btn:hover { background: #ecebf6; }
.icon-btn .dot { position: absolute; top: 8px; left: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.icon-btn .count {
  position: absolute; top: 3px; left: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.brand { display: flex; align-items: center; gap: 8px; }
.logo {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff;
  box-shadow: 0 6px 16px rgba(75, 43, 214, 0.35);
}
.brand-logo { height: 40px; width: auto; display: block; }
.brand-logo.lg { height: 88px; }
.brand-logo.xl { height: 110px; }
.brand small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.city-chip { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 13px; }

/* ----- جستجو ----- */
.search {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 0 14px; height: 50px; margin-bottom: 14px;
}
.search input { border: 0; outline: 0; flex: 1; background: transparent; height: 100%; }
.search svg { color: var(--muted); }

/* ----- بنر ----- */
.hero {
  position: relative; border-radius: 22px; overflow: hidden; color: #fff; min-height: 178px;
  background: linear-gradient(120deg, #6d3cf2 0%, #4b2bd6 45%, #3326c6 100%);
  display: flex; align-items: stretch; margin-bottom: 18px;
}
.hero .txt { position: relative; z-index: 2; padding: 20px 18px; width: 58%; }
.hero h2 { margin: 0 0 6px; font-size: 22px; font-weight: 900; }
.hero p { margin: 0 0 14px; font-size: 12.5px; opacity: .92; }
.hero img { position: absolute; left: 0; bottom: 0; height: 100%; width: 50%; object-fit: cover; object-position: center; -webkit-mask-image: linear-gradient(to left, transparent, #000 30%); mask-image: linear-gradient(to left, transparent, #000 30%); }
.hero .dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; z-index: 3; }
.hero .dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.5); transition: width .2s; }
.hero .dots i.on { width: 18px; background: #fff; }
.btn-white { background: #fff; color: var(--primary); font-weight: 800; padding: 9px 22px; border-radius: 999px; display: inline-block; }

/* ----- عنوان بخش ----- */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; }
.sec-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.sec-head a, .link { color: var(--primary); font-size: 12.5px; font-weight: 700; }

/* ----- گرید خدمات ----- */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tile {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 4px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  font-size: 11.5px; font-weight: 600; transition: transform .12s, box-shadow .12s; min-height: 98px;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.tile .ico svg.i { width: 24px; height: 24px; stroke-width: 2; }
.mini-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; text-align: center; font-weight: 600; }
.mini-tile .ico { width: 54px; height: 54px; border-radius: 16px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.mini-tile .ico img { width: 100%; height: 100%; object-fit: cover; }

/* ----- بنرهای کوچک ----- */
.promo {
  display: flex; align-items: center; gap: 10px; border-radius: 20px; padding: 14px 16px; overflow: hidden;
  position: relative; min-height: 112px; margin-top: 16px;
}
.promo h4 { margin: 0; font-size: 17px; font-weight: 900; }
.promo p { margin: 2px 0 8px; font-size: 12px; color: #4a4a62; }
.promo .txt { flex: 1; position: relative; z-index: 1; }
.promo img { width: 46%; max-height: 110px; object-fit: contain; mix-blend-mode: multiply; }
.promo.green { background: linear-gradient(90deg, #eef9f0, #e3f4e7); }
.promo.violet { background: linear-gradient(90deg, #f3efff, #e9e3ff); }
.pill-btn { display: inline-block; padding: 6px 16px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; }
.pill-btn.green { background: var(--green); }
.pill-btn.violet { background: var(--primary); }

/* ----- کارت‌ها ----- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card + .card { margin-top: 10px; }
.list > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.top { align-items: flex-start; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.bold { font-weight: 800; }
.price { color: var(--green); font-weight: 800; }
.price-lg { color: var(--primary); font-weight: 900; font-size: 18px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb {
  width: 76px; height: 76px; border-radius: 14px; background: #f3f2f9; display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.lg { width: 96px; height: 96px; }
.thumb svg.i { width: 34px; height: 34px; stroke-width: 1.6; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 18px; flex-shrink: 0;
}
.stars { display: inline-flex; align-items: center; gap: 3px; color: #f5a524; font-weight: 700; font-size: 12.5px; }
.stars svg { width: 15px; height: 15px; }
.stars span { color: var(--text); }

/* محصولات افقی */
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.hscroll::-webkit-scrollbar { height: 0; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 10px; width: 150px; flex-shrink: 0; scroll-snap-align: start; }
.pcard .thumb { width: 100%; height: 96px; }
.pcard h5 { margin: 8px 0 0; font-size: 13px; font-weight: 700; }
.pcard .between { margin-top: 6px; }
.cart-btn { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--primary-line); color: var(--primary); display: grid; place-items: center; }
.cart-btn:hover { background: var(--primary-soft); }
.plus-btn { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; }

/* ----- وضعیت‌ها ----- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.violet { background: var(--primary-soft); color: var(--primary); }
.badge.orange { background: var(--orange-soft); color: #b45309; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: #f0f0f5; color: var(--muted); }

/* ----- چیپ‌ها و انتخابگرها ----- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.chips::-webkit-scrollbar { height: 0; }
.chip {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; color: #4a4a62;
}
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opts.two { grid-template-columns: repeat(2, 1fr); }
.opt {
  border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 6px; text-align: center;
  font-size: 12.5px; font-weight: 600; transition: all .12s;
}
.opt.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.opt small { display: block; color: var(--muted); font-weight: 500; font-size: 10.5px; }
.field-label { font-weight: 800; margin: 18px 0 8px; font-size: 14px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 11px 14px; outline: none;
}
.input:focus { border-color: var(--primary); }
textarea.input { resize: vertical; min-height: 90px; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.stepper button { width: 46px; height: 46px; display: grid; place-items: center; color: var(--primary); font-size: 20px; }
.stepper button:hover { background: var(--primary-soft); }
.stepper input { flex: 1; text-align: center; border: 0; outline: 0; font-weight: 800; font-size: 16px; min-width: 0; background: transparent; }
.qty { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; }
.qty button { width: 28px; height: 28px; display: grid; place-items: center; color: var(--primary); font-size: 16px; }
.qty span { min-width: 22px; text-align: center; font-weight: 800; }

/* ----- مراحل ویزارد ----- */
.steps { display: flex; justify-content: space-between; position: relative; margin: 4px 6px 18px; }
.steps::before { content: ""; position: absolute; top: 16px; right: 24px; left: 24px; height: 2px; background: var(--line); }
.step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); width: 25%; }
.step i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line); font-style: normal; font-weight: 800; }
.step.done i { background: var(--green); border-color: var(--green); color: #fff; }
.step.on i { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 5px var(--primary-soft); }
.step.on { color: var(--primary); font-weight: 800; }

/* ----- تایم‌لاین ----- */
.timeline { position: relative; }
.tl { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.tl:not(:last-child)::before { content: ""; position: absolute; right: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.tl.done:not(:last-child)::before { background: var(--green); }
.tl .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: #fff; flex-shrink: 0; color: var(--muted); }
.tl.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.tl.on .dot { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 5px var(--primary-soft); }
.tl.on .t { color: var(--primary); }
.tl .t { font-weight: 700; }

/* ----- دکمه‌ها ----- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; border-radius: 16px;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 15px; transition: filter .12s, transform .08s;
  box-shadow: 0 8px 20px rgba(75, 43, 214, 0.25);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.99); }
.btn:disabled { background: #c9c4e6; box-shadow: none; cursor: not-allowed; }
.btn.outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary-line); box-shadow: none; }
.btn.danger { background: #fff; color: var(--red); border: 1.5px solid #ffc9d6; box-shadow: none; }
.btn.green { background: var(--green); box-shadow: 0 8px 20px rgba(22, 163, 74, .25); }
.btn.sm { height: 40px; font-size: 13px; border-radius: 12px; }
.btn-row { display: flex; gap: 10px; }

/* ----- فوتر / ناوبری ----- */
#footer { flex-shrink: 0; }
.nav {
  display: flex; justify-content: space-around; align-items: flex-end; background: #fff; border-top: 1px solid var(--line);
  padding: 8px 4px 14px; position: relative;
}
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); width: 20%; position: relative; }
.nav a.on { color: var(--primary); font-weight: 800; }
.nav a.on svg.i { fill: var(--primary-soft); }
.nav .fab {
  width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff;
  display: grid; place-items: center; margin-top: -30px; box-shadow: 0 8px 20px rgba(75, 43, 214, .4); border: 4px solid #fff;
}
.nav .fab svg.i { stroke-width: 2.6; }
.nav .count { position: absolute; top: -4px; right: 50%; margin-right: 4px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 3px; }
.cta { background: #fff; border-top: 1px solid var(--line); padding: 12px 16px 16px; }
.cta .between { margin-bottom: 10px; }

/* ----- لیست تنظیمات ----- */
.menu { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; padding: 14px 14px; width: 100%; text-align: right; }
.menu > * + * { border-top: 1px solid var(--line); }
.menu a:hover, .menu button:hover { background: #faf9ff; }
.menu .grow { font-weight: 600; }
.menu svg.chev { color: var(--muted); }
.menu-title { font-weight: 800; margin: 18px 4px 8px; }

/* ----- جدول مشخصات ----- */
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 700; text-align: left; }
.kv.total span:last-child { color: var(--primary); font-size: 16px; font-weight: 900; }

/* ----- پنل بنفش ----- */
.purple-head {
  background: linear-gradient(160deg, var(--primary-2), var(--primary)); color: #fff; padding: 10px 16px 64px;
  border-radius: 0 0 28px 28px; margin: 0 -16px;
}
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-top: -48px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 4px; text-align: center; }
.stat-card > div + div { border-right: 1px solid var(--line); }
.stat-card b { font-size: 22px; display: block; font-weight: 900; }
.stat-card small { color: var(--muted); font-size: 11.5px; }
.wallet-card { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; border-radius: 22px; padding: 22px 18px; text-align: center; box-shadow: 0 12px 28px rgba(75, 43, 214, .3); }
.wallet-card b { font-size: 28px; display: block; margin: 4px 0 14px; font-weight: 900; }

/* ----- چت ----- */
.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.msg { max-width: 78%; padding: 9px 13px; border-radius: 16px; font-size: 13.5px; }
.msg.me { align-self: flex-start; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-end; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg time { display: block; font-size: 10px; opacity: .7; margin-top: 2px; }
.composer { display: flex; gap: 8px; background: #fff; border-top: 1px solid var(--line); padding: 10px 12px 14px; }
.composer input { flex: 1; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 14px; outline: 0; height: 46px; }
.composer button { width: 46px; height: 46px; border-radius: 14px; background: var(--primary); color: #fff; display: grid; place-items: center; }

/* ----- آپلود ----- */
.drop {
  border: 2px dashed var(--primary-line); background: #faf9ff; border-radius: 18px; padding: 24px 14px; text-align: center;
  color: var(--primary); display: block; cursor: pointer;
}
.drop:hover { background: var(--primary-soft); }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-top: 8px; }

/* ----- شیت و توست ----- */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 15, 50, .45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; right: 0; left: 0; bottom: 0; background: #fff; border-radius: 26px 26px 0 0; padding: 10px 18px 20px;
  transform: translateY(105%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); z-index: 21; max-height: 86%; overflow-y: auto;
}
.sheet.open { transform: none; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: #ddd; margin: 0 auto 12px; }
.sheet h3 { margin: 0 0 10px; font-size: 17px; }
.toast {
  position: absolute; bottom: 96px; left: 50%; transform: translate(-50%, 20px); background: #1b1b2f; color: #fff; padding: 10px 18px;
  border-radius: 14px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 30; max-width: 88%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty .thumb { margin: 0 auto 12px; width: 84px; height: 84px; border-radius: 50%; color: var(--primary); background: var(--primary-soft); }
.notice { background: var(--orange-soft); color: #92400e; border-radius: 14px; padding: 10px 12px; font-size: 12.5px; }
.notice.violet { background: var(--primary-soft); color: var(--primary); }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.article p { line-height: 2; text-align: justify; }

/* ----- بارگذاری ----- */
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); margin: 0 auto 10px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
body.busy .btn, body.busy .opt, body.busy .plus-btn { opacity: .6; pointer-events: none; }
body.busy { cursor: progress; }
