:root {
  --bg: #f6f1ee;
  --card: #ffffff;
  --ink: #2a1d22;
  --muted: #8a7a80;
  --line: #ece2e0;
  --plum: #5b1f37;
  --plum-2: #7a2b4b;
  --gold: #c79a4b;
  --gold-soft: #f3e6cf;
  --green: #2e7d64;
  --red: #c0392b;
  --amber: #b8860b;
  --shadow: 0 8px 30px rgba(60, 20, 35, .10);
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Tahoma, "Noto Kufi Arabic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
img { max-width: 100%; }

/* ---------- App shell (phone frame on desktop) ---------- */
.app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0,0,0,.08);
}

/* ---------- Header ---------- */
.topbar {
  background: linear-gradient(135deg, var(--plum), var(--plum-2));
  color: #fff;
  padding: 18px 18px 40px;
  border-radius: 0 0 26px 26px;
  position: relative;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar .brand .logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--gold); color: var(--plum);
  display: grid; place-items: center; font-weight: 800; font-size: 20px;
}
.brand-logo { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.logo-hero { width: 170px; height: 170px; border-radius: 28px; object-fit: cover; display: block;
  margin: 0 auto 18px; box-shadow: 0 12px 34px rgba(0,0,0,.4); }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.topbar .sub { font-size: 12px; opacity: .8; margin-top: 2px; }
.bell { position: absolute; left: 16px; top: 18px; background: rgba(255,255,255,.15);
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 18px; }
.bell .dot { position: absolute; top: 6px; left: 8px; background: var(--gold); color: var(--plum);
  min-width: 16px; height: 16px; border-radius: 8px; font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 3px; }

/* points banner */
.points-card {
  margin: -26px 16px 0; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 2;
}
.points-card .val { font-size: 26px; font-weight: 800; color: var(--plum); }
.points-card .lbl { font-size: 12px; color: var(--muted); }
.points-card .coin { width: 44px; height: 44px; border-radius: 50%; background: var(--gold-soft);
  color: var(--gold); display: grid; place-items: center; font-size: 22px; }

/* ---------- Content ---------- */
.content { flex: 1; padding: 16px 16px 90px; }
.section-title { font-size: 16px; font-weight: 800; margin: 18px 4px 10px; display: flex; align-items: center; gap: 8px; }
.section-title small { color: var(--muted); font-weight: 500; font-size: 12px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }

/* service list */
.cat { margin-bottom: 16px; }
.cat-head { font-weight: 800; color: var(--plum); font-size: 15px; margin: 6px 4px 8px;
  border-right: 4px solid var(--gold); padding-right: 8px; }
.service {
  background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow);
  border: 2px solid transparent; transition: .15s;
}
.service.sel { border-color: var(--gold); background: #fffdf8; }
.service .info { flex: 1; }
.service .nm { font-weight: 700; font-size: 14px; }
.service .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.service .price { font-weight: 800; color: var(--plum); font-size: 14px; white-space: nowrap; margin-inline-start: 8px; }
.service .meta.desc { color: var(--ink); opacity: .65; margin: 2px 0; line-height: 1.4; }
.qtybox { display: flex; align-items: center; gap: 8px; }
.qtybox button { width: 30px; height: 30px; border-radius: 9px; background: var(--gold-soft); color: var(--plum);
  font-size: 18px; font-weight: 800; display: grid; place-items: center; }
.qtybox .n { min-width: 20px; text-align: center; font-weight: 800; }
.add-btn { background: var(--plum); color: #fff; border-radius: 10px; padding: 7px 14px; font-weight: 700; font-size: 13px; }

/* cart bar */
.cartbar {
  position: fixed; bottom: 74px; left: 0; right: 0; max-width: 460px; margin: 0 auto;
  padding: 0 16px; z-index: 40; transform: translateY(120%); transition: .25s;
}
.cartbar.show { transform: translateY(0); }
.cartbar .inner { background: var(--plum); color: #fff; border-radius: 16px; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; box-shadow: 0 10px 30px rgba(91,31,55,.4); }
.cartbar .cnt { font-size: 12px; opacity: .85; }
.cartbar .tot { font-size: 18px; font-weight: 800; }
.cartbar .go { background: var(--gold); color: var(--plum); padding: 10px 18px; border-radius: 12px; font-weight: 800; }

/* bottom nav */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 460px; margin: 0 auto;
  background: var(--card); display: flex; justify-content: space-around; padding: 8px 6px 10px;
  box-shadow: 0 -6px 20px rgba(60,20,35,.08); z-index: 50; border-radius: 20px 20px 0 0;
}
.tabbar button { background: none; color: var(--muted); font-size: 11px; display: flex; flex-direction: column;
  align-items: center; gap: 3px; flex: 1; padding: 4px; }
.tabbar button .ic { font-size: 20px; }
.tabbar button.active { color: var(--plum); font-weight: 800; }

/* buttons & inputs */
.btn { display: block; width: 100%; background: var(--plum); color: #fff; padding: 14px; border-radius: 14px;
  font-weight: 800; font-size: 15px; text-align: center; }
.btn.gold { background: var(--gold); color: var(--plum); }
.btn.ghost { background: transparent; color: var(--plum); border: 2px solid var(--line); }
.btn:disabled { opacity: .5; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: #fff; font-size: 15px; font-family: inherit; color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); }

/* badges & pills */
.badge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 20px; display: inline-block; }
.b-pending { background: #fef3d7; color: var(--amber); }
.b-active { background: #dff3ec; color: var(--green); }
.b-rejected { background: #fde3e0; color: var(--red); }
.b-completed { background: #e8e4f0; color: #6b4f9e; }
.b-expired { background: #eee; color: #888; }

/* progress */
.prog { height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; margin-top: 8px; }
.prog > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--plum)); }

/* misc */
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .ic { font-size: 46px; margin-bottom: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; }
.chip { font-size: 12px; background: var(--gold-soft); color: var(--plum); padding: 6px 12px; border-radius: 20px; font-weight: 700; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }
.center { text-align: center; }
.mut { color: var(--muted); font-size: 13px; }
.big { font-size: 22px; font-weight: 800; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(30,10,20,.5); z-index: 100; display: none;
  align-items: flex-end; justify-content: center; }
.modal-bg.show { display: flex; }
.modal { background: var(--card); width: 100%; max-width: 460px; border-radius: 22px 22px 0 0; padding: 20px 18px 28px;
  max-height: 88vh; overflow-y: auto; animation: up .25s; }
@keyframes up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal h3 { margin: 0 0 14px; }
.modal .close { float: left; background: var(--line); width: 32px; height: 32px; border-radius: 50%; font-size: 16px; color: var(--muted); }

/* toast */
.toast { position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: 30px; font-size: 14px; z-index: 200; opacity: 0; transition: .3s; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; }

/* auth screen */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 30px 22px;
  background: linear-gradient(160deg, var(--plum), var(--plum-2) 60%, #3d1526); color: #fff; }
.auth .logo-big { width: 76px; height: 76px; border-radius: 22px; background: var(--gold); color: var(--plum);
  display: grid; place-items: center; font-size: 38px; font-weight: 800; margin: 0 auto 16px; }
.auth h1 { text-align: center; margin: 0 0 4px; }
.auth .tag { text-align: center; opacity: .8; margin-bottom: 26px; font-size: 14px; }
.auth .panel { background: rgba(255,255,255,.08); border-radius: 20px; padding: 20px; backdrop-filter: blur(6px); }
.auth .field input { background: rgba(255,255,255,.95); border-color: transparent; }
.auth .field label { color: #fff; }
.auth .switch { text-align: center; margin-top: 16px; font-size: 14px; }
.auth .switch b { color: var(--gold); }
.seg { display: flex; background: rgba(255,255,255,.12); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.seg button { flex: 1; padding: 10px; border-radius: 9px; background: none; color: #fff; font-weight: 700; font-size: 14px; }
.seg button.on { background: var(--gold); color: var(--plum); }
