* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --green: #1e9e57;
  --green-d: #12743f;
  --green-soft: #e9f7ef;
  --bg: #f4f6f4;
  --card: #ffffff;
  --ink: #1c2a22;
  --muted: #7d8b83;
  --line: #e6ebe7;
  --amber: #b7791f;
  --amber-soft: #fdf5e3;
  --blue: #1f6fb2;
  --blue-soft: #e8f2fb;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  line-height: 1.5;
}
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
button, input, textarea, select { font-family: inherit; }

/* ======= أزرار ======= */
.btn-primary {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 800; color: #fff;
  background: var(--green); border: none; border-radius: 12px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(30,158,87,.22);
}
.btn-primary:active { background: var(--green-d); }
.btn-ghost {
  padding: 11px 16px; font-size: 14px; font-weight: 700; color: var(--green-d);
  background: #fff; border: 1px solid var(--green); border-radius: 11px; cursor: pointer;
}
.btn-ghost.wide { width: 100%; border-style: dashed; margin-bottom: 10px; }
.btn-link { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 10px; }
.btn-link.light { color: #fff; }

/* ======= شاشة الكود ======= */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(180deg, #eef8f2 0%, var(--bg) 55%); }
.gate-card { background: var(--card); border-radius: 22px; padding: 30px 22px 24px; width: 100%; text-align: center; box-shadow: 0 10px 30px rgba(20,60,40,.08); }
.gate-logo { width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 18px; background: var(--green-soft); color: var(--green-d); display: grid; place-items: center; }
.gate-logo svg { width: 30px; height: 30px; }
.gate-card h1 { font-size: 26px; color: var(--green-d); }
.gate-sub { color: var(--muted); font-size: 14px; margin: 2px 0 22px; }
.gate-hint { margin-bottom: 10px; font-size: 15px; font-weight: 600; }
.gate-card input {
  width: 100%; padding: 15px; font-size: 22px; text-align: center; letter-spacing: 6px;
  border: 2px solid var(--line); border-radius: 12px; margin-bottom: 12px; background: #fafcfb;
}
#gate-name, #gate-phone { letter-spacing: 0 !important; font-size: 17px !important; text-align: right !important; }
.gate-card input:focus { outline: none; border-color: var(--green); }
.gate-error { color: #c62828; font-size: 13px; margin-bottom: 10px; }
.gate-note { color: var(--muted); font-size: 12px; margin-top: 14px; line-height: 1.6; }

/* ======= الهيدر ======= */
.hdr {
  position: sticky; top: 0; z-index: 12; background: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.hdr-titles { flex: 1; text-align: right; }
.hdr-titles h1 { font-size: 17px; font-weight: 800; color: var(--ink); }
.hdr-titles p { font-size: 11px; color: var(--muted); }
.hdr-cart, .hdr-fav {
  position: relative; width: 40px; height: 40px; border-radius: 12px; border: none;
  background: var(--green-soft); color: var(--green-d); display: grid; place-items: center; cursor: pointer;
}
.hdr-spacer { width: 40px; }
.hdr-logo { width: 38px; height: 38px; border-radius: 12px; background: var(--green); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.hdr-logo svg { width: 21px; height: 21px; }
.badge {
  position: absolute; top: -4px; left: -4px; min-width: 19px; height: 19px; border-radius: 10px;
  background: var(--green); color: #fff; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff;
}

/* ======= البحث ======= */
.search { position: sticky; top: 57px; z-index: 9; display: flex; align-items: center; gap: 8px; margin: 12px; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 4px 4px 4px 12px; }
.search input { flex: 1; border: none; background: none; font-size: 15px; padding: 9px 4px; outline: none; color: var(--ink); }
.search input::placeholder { color: #a8b3ac; }
.search-btn { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--green); color: #fff; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.search-btn svg { width: 19px; height: 19px; }

/* ======= عناوين ======= */
.sec-title { font-size: 16px; font-weight: 800; color: var(--green-d); margin: 16px 14px 10px; }

/* ======= الفئات ======= */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 12px; }
.cat { background: #fff; border-radius: 14px; padding: 6px 6px 8px; box-shadow: 0 1px 3px rgba(20,60,40,.06); cursor: pointer; border: none; text-align: center; font-family: inherit; }
.cat:active { transform: scale(.97); }
.cat .thumb { position: relative; width: 100%; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg, #eef8f2, #dff1e7); color: var(--green-d); }
.cat .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat .thumb svg { width: 32px; height: 32px; stroke-width: 1.5; }
.cat .soon { position: absolute; bottom: 5px; left: 5px; background: rgba(255,255,255,.94); color: var(--green-d); font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 7px; }
.cat .lbl { display: block; font-size: 12px; font-weight: 700; margin-top: 6px; color: var(--ink); line-height: 1.35; }
.cat .cnt { display: block; font-size: 10px; color: var(--muted); font-weight: 600; }

/* ======= شريط أفقي للمنتجات ======= */
.hstrip { display: flex; gap: 10px; overflow-x: auto; padding: 0 12px 4px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.hstrip::-webkit-scrollbar { display: none; }
.hcard { flex: 0 0 128px; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(20,60,40,.06); scroll-snap-align: start; cursor: pointer; border: none; padding: 0; font-family: inherit; text-align: right; }
.hcard img { width: 100%; height: 128px; object-fit: cover; display: block; background: #eef2ef; }
.hcard .hc-body { padding: 7px 8px 9px; }
.hcard .hc-name { font-size: 12px; font-weight: 700; }
.hcard .hc-meta { font-size: 10px; color: var(--muted); margin-top: 1px; }
.strip-foot { padding: 8px 14px 0; text-align: center; }

/* ======= عنوان فرعي / رجوع ======= */
.subhdr { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; position: sticky; top: 56px; background: var(--bg); z-index: 8; }
.subhdr.plain { padding-top: 16px; }
.subhdr h2 { font-size: 17px; font-weight: 800; color: var(--green-d); }
.back { width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.back svg { width: 18px; height: 18px; }

/* ======= شبكة منتجات ======= */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 12px; }
.p-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(20,60,40,.06); position: relative; }
.p-img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #eef2ef; cursor: pointer; }
.p-fav { position: absolute; top: 7px; left: 7px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,.92); color: #98a49d; display: grid; place-items: center; cursor: pointer; }
.p-fav.on { color: #e0245e; }
.p-fav svg { width: 17px; height: 17px; fill: none; }
.p-fav.on svg { fill: currentColor; }
.p-body { padding: 9px 10px 10px; }
.p-name { font-size: 13px; font-weight: 700; }
.p-meta { font-size: 11px; color: var(--muted); margin: 2px 0 8px; }
.p-add { width: 100%; padding: 8px; border: 1px solid var(--green); background: #fff; color: var(--green-d); border-radius: 9px; font-size: 12px; font-weight: 800; cursor: pointer; }
.p-add:active { background: var(--green); color: #fff; }

/* ======= صفحة المنتج ======= */
.det-img { width: 100%; max-height: 62vh; object-fit: contain; background: #fff; display: block; cursor: zoom-in; }
.det-wrap { background: #fff; border-radius: 18px 18px 0 0; margin-top: -14px; position: relative; padding: 18px 16px 150px; }
.det-title { font-size: 19px; font-weight: 800; }
.det-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.det-note { background: var(--green-soft); color: var(--green-d); font-size: 12px; border-radius: 10px; padding: 10px 12px; margin-top: 12px; line-height: 1.6; }
.qty-pick { display: flex; align-items: center; justify-content: space-between; background: #f7faf8; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-top: 16px; }
.qty-pick span { font-size: 14px; font-weight: 700; }
.qty { display: flex; align-items: center; gap: 14px; }
.qty button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 18px; font-weight: 700; color: var(--ink); cursor: pointer; }
.qty b { min-width: 18px; text-align: center; font-size: 15px; }
.det-actions { position: fixed; bottom: 70px; left: 0; right: 0; max-width: 480px; margin: 0 auto; background: #fff; border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; z-index: 14; }

/* ======= السلة ======= */
.cart-lines { padding: 0 12px; }
.cart-line { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 13px; padding: 9px; margin-bottom: 9px; box-shadow: 0 1px 3px rgba(20,60,40,.05); }
.cart-line img { width: 54px; height: 68px; object-fit: cover; border-radius: 9px; background: #eef2ef; }
.cart-line .cl-info { flex: 1; min-width: 0; }
.cart-line .cl-name { font-size: 13px; font-weight: 700; }
.cart-line .cl-meta { font-size: 11px; color: var(--muted); }
.cart-line .cl-del { background: none; border: none; color: #c0392b; font-size: 12px; cursor: pointer; padding: 4px; }
.checkout { background: #fff; border-radius: 14px; padding: 14px; margin: 6px 12px 12px; box-shadow: 0 1px 3px rgba(20,60,40,.05); }
.checkout h3 { font-size: 15px; font-weight: 800; margin-bottom: 10px; color: var(--green-d); }
.checkout label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.checkout input, .checkout textarea {
  width: 100%; padding: 11px; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; background: #fbfcfb;
}
.checkout input:focus, .checkout textarea:focus { outline: none; border-color: var(--green); }

/* ======= الطلبات ======= */
.ord { background: #fff; border-radius: 14px; padding: 13px; margin: 0 12px 10px; box-shadow: 0 1px 3px rgba(20,60,40,.05); cursor: pointer; border: none; width: calc(100% - 24px); text-align: right; font-family: inherit; }
.ord-head { display: flex; justify-content: space-between; align-items: center; }
.ord-num { font-size: 14px; font-weight: 800; }
.ord-date { font-size: 11px; color: var(--muted); }
.ord-items { font-size: 12px; color: #4a5a51; margin-top: 6px; line-height: 1.7; }
.ord-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.ord-count { font-size: 11px; color: var(--muted); }
.chip { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 20px; background: var(--green-soft); color: var(--green-d); }
.chip.s1 { background: var(--amber-soft); color: var(--amber); }
.chip.s2 { background: var(--blue-soft); color: var(--blue); }
.chip.s3 { background: var(--green-soft); color: var(--green-d); }

/* تتبع الطلب */
.track { display: flex; flex-direction: column; gap: 0; margin: 14px 0 4px; }
.track-step { display: flex; gap: 10px; align-items: flex-start; position: relative; padding-bottom: 18px; }
.track-step:last-child { padding-bottom: 0; }
.track-step .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: #fff; flex: 0 0 auto; display: grid; place-items: center; color: transparent; font-size: 12px; }
.track-step .dot svg { width: 12px; height: 12px; stroke-width: 3; }
.track-step:not(:last-child):before { content: ''; position: absolute; top: 22px; right: 10px; width: 2px; height: calc(100% - 22px); background: var(--line); }
.track-step.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.track-step.done:before { background: var(--green); }
.track-step .t-lbl { font-size: 14px; font-weight: 700; }
.track-step .t-sub { font-size: 11px; color: var(--muted); }

/* ======= المزيد ======= */
.more-head { text-align: center; padding: 24px 16px 18px; }
.more-logo { width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 17px; background: var(--green-soft); color: var(--green-d); display: grid; place-items: center; }
.more-logo svg { width: 28px; height: 28px; }
.more-head h2 { font-size: 19px; font-weight: 800; }
.more-head p { font-size: 12px; color: var(--muted); }
.menu { list-style: none; background: #fff; margin: 0 12px; border-radius: 15px; overflow: hidden; box-shadow: 0 1px 3px rgba(20,60,40,.05); }
.menu li { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; cursor: pointer; }
.menu li:last-child { border-bottom: none; }
.menu li:active { background: #f7faf8; }
.menu .mi { width: 34px; height: 34px; border-radius: 11px; background: var(--green-soft); color: var(--green-d); display: grid; place-items: center; flex: 0 0 auto; }
.menu .mi svg { width: 18px; height: 18px; }
.menu .chev { margin-inline-start: auto; color: #bcc7c0; width: 18px; height: 18px; }
.about { margin: 12px 14px; font-size: 13px; color: #4a5a51; line-height: 1.8; background: #fff; border-radius: 13px; padding: 13px; }
.more-foot { text-align: center; font-size: 11px; color: var(--muted); padding: 18px 0 100px; }

/* ======= شريط التنقل السفلي ======= */
.bnav {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  background: #fff; border-top: 1px solid var(--line); display: flex;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 15;
}
.bn-item { flex: 1; background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 1px; color: #93a09a; font-size: 10.5px; font-family: inherit; cursor: pointer; padding: 0; }
.bn-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; transition: transform .16s ease, background .16s ease; }
.bn-ico svg { width: 21px; height: 21px; }
.bn-item.active .bn-ico { background: var(--green); color: #fff; width: 46px; height: 46px; margin-top: -15px; box-shadow: 0 6px 14px rgba(30,158,87,.35); }
.bn-item.active .bn-lbl { color: var(--green-d); font-weight: 800; }
.view { padding-bottom: 96px; }

/* ======= حالات فاضية ======= */
.empty { text-align: center; padding: 40px 26px; color: var(--muted); }
.empty .e-ico { width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 20px; background: var(--green-soft); color: var(--green-d); display: grid; place-items: center; }
.empty .e-ico svg { width: 28px; height: 28px; }
.empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 5px; }
.empty p { font-size: 13px; line-height: 1.7; }

/* ======= عرض الصورة ======= */
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 40; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-x { position: absolute; top: 14px; left: 14px; color: #fff; font-size: 26px; background: none; border: none; cursor: pointer; }

/* ======= لوحة المالك ======= */
.owner-top { background: var(--green-d); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 16px 14px; position: sticky; top: 0; z-index: 12; }
.owner-top h1 { font-size: 17px; }
.owner-ver { font-size: 10px; font-weight: 400; opacity: .6; }
.owner-login { padding: 44px 22px; text-align: center; }
.owner-login input { width: 100%; padding: 13px; font-size: 17px; border: 2px solid var(--line); border-radius: 11px; margin: 12px 0; text-align: center; }
.owner-panel { padding: 14px 12px 110px; }
.card { background: #fff; border-radius: 15px; padding: 15px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(20,60,40,.05); }
.card h2 { font-size: 15px; font-weight: 800; margin-bottom: 8px; color: var(--green-d); }
.big-code { font-size: 38px; font-weight: 800; letter-spacing: 9px; text-align: center; color: var(--green-d); padding: 8px 0 2px; direction: ltr; }
.muted { color: var(--muted); font-size: 12px; margin: 6px 0; line-height: 1.7; }
.used-codes { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 2; }
.used-codes span { display: inline-block; background: #f2f5f3; border-radius: 7px; padding: 1px 7px; margin: 2px; text-decoration: line-through; }
.owner-input { width: 100%; padding: 11px; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fbfcfb; }
.orders-list .order { border: 1px solid var(--line); border-radius: 11px; padding: 10px; margin-bottom: 9px; }
.order-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.order-who { font-weight: 800; margin: 4px 0; font-size: 14px; }
.order-items { font-size: 13px; margin: 4px 0; white-space: pre-line; line-height: 1.7; }
.order select { padding: 7px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; background: #fff; margin-top: 6px; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.6; }
.switch-row input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--green); }
.cat-editor .ce-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.cat-editor input { flex: 1; padding: 10px; font-size: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; }
.cat-editor .ce-del { width: 36px; height: 36px; border-radius: 9px; border: 1px solid #f2d7d4; background: #fdf3f2; color: #c0392b; cursor: pointer; font-size: 15px; flex: 0 0 auto; }

/* ======= بانر المعاينة ======= */
.demo-banner {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  background: #fff8e1; color: #6d5b16; font-size: 11px; text-align: center; padding: 5px 10px;
  border-top: 1px solid #e8d88a; z-index: 30;
}
body.demo .bnav { padding-bottom: 24px; }
body.demo .det-actions { bottom: 94px; }

.flag-warn { color: #c62828; font-size: 12px; font-weight: 800; margin: 4px 0; }
.pay-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.btn-pay { flex: 1; padding: 10px; border-radius: 10px; border: 2px solid #c62828; background: #fdf3f2; color: #c62828; font-weight: 800; font-size: 13px; cursor: pointer; font-family: inherit; }

/* ======= منتجات المالك ======= */
.prod-list .pl-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pl-row img { width: 46px; height: 58px; object-fit: cover; border-radius: 8px; background: #eef2ef; flex: 0 0 auto; }
.pl-row .pl-info { flex: 1; min-width: 0; }
.pl-row .pl-name { font-size: 13px; font-weight: 700; }
.pl-row .pl-meta { font-size: 11px; color: var(--muted); }
.pl-row button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 9px; font-size: 12px; cursor: pointer; }
.pl-row .pl-del { color: #c0392b; border-color: #f2d7d4; }
.prod-form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.prod-form h3 { font-size: 14px; margin-bottom: 8px; color: var(--green-d); }
.pf-photo { display: block; border: 2px dashed var(--green); border-radius: 12px; padding: 16px; text-align: center; color: var(--green-d); font-size: 13px; font-weight: 700; margin-bottom: 8px; cursor: pointer; }
.pf-photo input { display: none; }
.pf-prev { display: block; width: 120px; height: 150px; object-fit: cover; border-radius: 10px; margin: 0 auto 8px; }
.sold { position: absolute; top: 8px; right: 8px; background: #c62828; color: #fff; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 8px; }
.p-add[disabled] { opacity: .45; cursor: default; }
.p-price { font-size: 12px; font-weight: 800; color: var(--green-d); margin-bottom: 6px; }

/* ===== تحسينات الشكل والحركة (إضافية فقط) ===== */
html { -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; }
body { font-feature-settings: "kern" 1; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; line-height: 1.6; }
.hdr { backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); }
@keyframes mfade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes mpop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
.view:not(.hidden) { animation: mfade .28s ease-out; }
.cat, .hcard, .p-card, .ord, .cart-line, .card { transition: transform .18s ease, box-shadow .2s ease; }
.cat, .hcard, .p-card { box-shadow: 0 2px 10px rgba(20,60,40,.07); }
.cat:active, .hcard:active, .p-card:active { transform: scale(.97); }
.cats .cat, .grid .p-card, .hstrip .hcard { animation: mfade .4s ease-out both; }
.cats .cat:nth-child(2), .grid .p-card:nth-child(2), .hstrip .hcard:nth-child(2) { animation-delay: .05s; }
.cats .cat:nth-child(3), .grid .p-card:nth-child(3), .hstrip .hcard:nth-child(3) { animation-delay: .1s; }
.cats .cat:nth-child(4), .grid .p-card:nth-child(4), .hstrip .hcard:nth-child(4) { animation-delay: .15s; }
.cats .cat:nth-child(5), .grid .p-card:nth-child(5), .hstrip .hcard:nth-child(5) { animation-delay: .2s; }
.grid .p-card:nth-child(n+6) { animation-delay: .25s; }
.p-img, .hcard img, .det-img { background: linear-gradient(110deg, #eef2ef 8%, #f7faf8 18%, #eef2ef 33%); background-size: 200% 100%; }
.p-card .p-img { transition: transform .35s ease; }
.p-card:hover .p-img { transform: scale(1.03); }
.btn-primary, .btn-ghost, .p-add { transition: transform .12s ease, box-shadow .2s ease, background .2s; }
.btn-primary { box-shadow: 0 4px 12px rgba(30,158,87,.28); }
.btn-primary:active, .btn-ghost:active, .p-add:active { transform: scale(.97); }
.p-fav.on { animation: mpop .35s ease; }
.bn-item .bn-ico { transition: all .22s cubic-bezier(.3,1.4,.5,1); }
.bn-item { transition: color .2s; }
.bn-item.active { color: var(--green); font-weight: 700; }
.sec-title { letter-spacing: .1px; }
input, textarea, select { transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,158,87,.16); }
.chip { transition: background .2s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.det-img { max-height: 44vh; object-fit: cover; }

.deliv-badge{background:#e3f4e6;color:#1b6e2d;border:1px solid #1b6e2d;border-radius:8px;padding:6px 10px;margin:6px 0;font-weight:700;text-align:center}
.otoast{position:fixed;bottom:80px;left:50%;transform:translateX(-50%);background:#1b6e2d;color:#fff;padding:10px 18px;border-radius:10px;z-index:99999;font-weight:700;box-shadow:0 2px 10px rgba(0,0,0,.3)}

.nbadge{position:absolute;top:2px;right:18%;min-width:20px;height:20px;line-height:20px;padding:0 5px;border-radius:10px;background:#c62828;color:#fff;font-size:12px;font-weight:800;text-align:center}

.wa-fab{position:fixed;left:14px;bottom:86px;z-index:900;height:46px;padding:0 16px;border-radius:23px;background:#25d366;color:#fff;font-size:16px;font-weight:700;display:flex;align-items:center;justify-content:center;text-decoration:none;box-shadow:0 3px 12px rgba(0,0,0,.3)}

.hero-wrap { position: relative; margin: 12px 12px 2px; height: 108px; }
.hero-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.hero-dots .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); }
.hero-dots .dot.on { background: #fff; }
.hero { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .55s ease; }
.hero.on { opacity: 1; pointer-events: auto; }
.hero { background: linear-gradient(160deg,#23b564 0%,#1e9e57 55%,#177a43 100%); border-radius: 18px; padding: 20px 18px; color: #fff; }
.hero-t { font-size: 22px; font-weight: 900; }
.hero-s { font-size: 13px; opacity: .92; margin-top: 4px; }
.sugg { margin: 8px 12px 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 6px 18px rgba(20,60,40,.08); }
.sugg-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; background: none; border: none; border-bottom: 1px solid #eef2ef; font-family: inherit; font-size: 14px; font-weight: 700; text-align: right; cursor: pointer; color: var(--ink); }
.sugg-item:last-child { border-bottom: none; }
.sugg-item svg { width: 16px; height: 16px; color: var(--green-d); flex: 0 0 auto; }

body.no-fab #cs-fab{display:none}

.inv-modal{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:60;overflow-y:auto;padding:14px}
.inv-card{background:#fff;border-radius:16px;max-width:480px;margin:0 auto;padding:16px}
.inv-actions{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;gap:8px}
.inv-h{font-size:18px;font-weight:900;text-align:center}
.inv-sub{text-align:center;font-size:12px;color:#6b7a72;margin-bottom:10px}
.inv-tbl{width:100%;border-collapse:collapse;font-size:13px;margin:10px 0}
.inv-tbl th,.inv-tbl td{border:1px solid #d8e2dc;padding:7px 8px;text-align:right}
.inv-tbl th{background:#f3f6f4}
.inv-line{font-size:13px;margin:3px 0}
.inv-total{font-size:16px;font-weight:900;margin-top:8px;text-align:end}
@media print{body>*{display:none!important}.inv-modal{display:block!important;position:static;background:none;padding:0}.inv-modal .no-print{display:none!important}.inv-card{box-shadow:none;border-radius:0}}

.chips { display: flex; gap: 12px; overflow-x: auto; padding: 4px 12px 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip2 { flex: 0 0 auto; width: 62px; background: none; border: none; cursor: pointer; font-family: inherit; text-align: center; padding: 0; scroll-snap-align: start; }
.ch-thumb { position: relative; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg,#eef8f2,#dff1e7); color: var(--green-d); margin: 0 auto; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(20,60,40,.12); }
.ch-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-thumb svg { width: 24px; height: 24px; stroke-width: 1.5; }
.ch-soon { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.93); color: var(--green-d); font-size: 8px; font-weight: 800; padding: 1px 0; }
.ch-lbl { display: block; font-size: 11px; font-weight: 700; margin-top: 5px; color: var(--ink); }
.p-off { position: absolute; top: 7px; right: 7px; background: #c62828; color: #fff; font-size: 10px; font-weight: 800; border-radius: 8px; padding: 2px 7px; z-index: 2; }
.hc-meta s { opacity: .55; }

/* ===== الثيم الفاخر (Premium v39) — أخضر زمردي عميق + ذهبي ===== */
:root {
  --green: #14a35c;
  --green-d: #0b3d28;
  --green-mid: #11653f;
  --green-soft: #e6f5ec;
  --gold: #d4af37;
  --gold-d: #a8851f;
  --gold-soft: #faf3dd;
  --bg: #eef1ee;
  --ink: #12241a;
  --grad-emerald: linear-gradient(135deg, #082b1c 0%, #0b3d28 42%, #11653f 78%, #178549 100%);
  --grad-gold: linear-gradient(135deg, #f0d878 0%, #d4af37 55%, #b8912a 100%);
  --shadow-soft: 0 2px 14px rgba(11,61,40,.09);
  --shadow-lift: 0 8px 24px rgba(11,61,40,.14);
}
body { font-family: 'Cairo', -apple-system, 'Segoe UI', Tahoma, Arial, sans-serif; background: var(--bg); }

/* أزرار */
.btn-primary {
  background: linear-gradient(135deg, #17b265 0%, #14a35c 45%, #0e7c44 100%);
  border-radius: 14px; box-shadow: 0 6px 18px rgba(20,163,92,.35), inset 0 1px 0 rgba(255,255,255,.25);
  letter-spacing: .2px;
}
.btn-primary:active { background: linear-gradient(135deg, #129052 0%, #0e7c44 100%); }
.btn-ghost { border-color: var(--green-mid); color: var(--green-mid); border-radius: 13px; }

/* شاشة الدخول */
.gate { background: var(--grad-emerald); position: relative; overflow: hidden; }
.gate::before { content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%; top: -130px; left: -110px; background: radial-gradient(circle, rgba(212,175,55,.28), transparent 68%); }
.gate::after { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; bottom: -120px; right: -100px; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%); }
.gate-card { position: relative; z-index: 1; border-radius: 26px; box-shadow: 0 24px 60px rgba(0,0,0,.35); padding-top: 34px; }
.gate-logo { background: var(--grad-emerald); color: var(--gold); border-radius: 20px; box-shadow: 0 8px 20px rgba(11,61,40,.35), inset 0 1px 0 rgba(255,255,255,.18); }
.gate-card h1 { color: var(--green-d); font-weight: 900; }
.gate-card input { border-radius: 14px; background: #f7faf8; }

/* الهيدر */
.hdr { background: var(--grad-emerald); border-bottom: none; box-shadow: 0 4px 18px rgba(8,43,28,.35); padding: 12px 14px; }
.hdr-titles h1 { color: #fff; font-weight: 900; letter-spacing: .2px; }
.hdr-titles p { color: rgba(255,255,255,.75); }
.hdr-cart, .hdr-fav { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(4px); }
.hdr-logo { background: var(--grad-gold); color: #4a3708; box-shadow: 0 0 0 2px rgba(255,255,255,.35), 0 4px 12px rgba(0,0,0,.3); border-radius: 13px; }
.badge { background: var(--grad-gold); color: #4a3708; border-color: #0b3d28; }

/* البحث */
.search { border: none; border-radius: 26px; box-shadow: var(--shadow-lift); padding: 4px 4px 4px 12px; }
.search:focus-within { box-shadow: 0 0 0 3px rgba(212,175,55,.35), var(--shadow-lift); }
.search-btn { background: var(--grad-emerald); box-shadow: 0 3px 10px rgba(11,61,40,.3); }

/* عناوين الأقسام */
.sec-title { color: var(--green-d); font-weight: 900; display: flex; align-items: center; gap: 8px; }
.sec-title::before { content: ''; width: 4px; height: 17px; border-radius: 3px; background: var(--grad-gold); flex: 0 0 auto; }

/* شرائح الأقسام الدائرية */
.ch-thumb { border: 2px solid #fff; box-shadow: 0 3px 10px rgba(11,61,40,.16); }
.chip2:active .ch-thumb { box-shadow: 0 0 0 2.5px var(--gold), 0 3px 10px rgba(11,61,40,.2); }
.ch-lbl { font-weight: 800; }

/* الهيرو */
.hero { background: var(--grad-emerald); border-radius: 20px; box-shadow: var(--shadow-lift); overflow: hidden; }
.hero::after { content: ''; position: absolute; width: 190px; height: 190px; border-radius: 50%; top: -80px; left: -50px; background: radial-gradient(circle, rgba(212,175,55,.35), transparent 70%); pointer-events: none; }
.hero-t { font-weight: 900; text-shadow: 0 2px 8px rgba(0,0,0,.25); }
.hero-wrap { height: 116px; }
.hero-dots .dot.on { background: var(--gold); }

/* كروت المنتجات */
.p-card, .hcard, .cat { border-radius: 16px; box-shadow: var(--shadow-soft); }
.p-card:hover, .hcard:hover { box-shadow: var(--shadow-lift); }
.p-body { padding: 10px 11px 11px; }
.p-name, .hc-name { font-weight: 800; }
.p-price { color: var(--green-mid); font-size: 13px; }
.p-off { background: var(--grad-gold); color: #4a3708; border-radius: 9px; box-shadow: 0 2px 8px rgba(184,145,42,.45); font-size: 10.5px; }
.sold { background: linear-gradient(135deg, #8e1f1f, #c62828); box-shadow: 0 2px 8px rgba(198,40,40,.4); }
.p-add { border-color: var(--green-mid); color: var(--green-mid); border-radius: 11px; background: linear-gradient(180deg, #ffffff, #f2f9f4); }
.p-add:active { background: var(--green); color: #fff; }
.p-fav { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.hc-meta s { color: #b3bdb6; }

/* صفحة المنتج */
.det-wrap { border-radius: 24px 24px 0 0; box-shadow: 0 -8px 24px rgba(11,61,40,.12); }
.det-title { font-weight: 900; }
.det-note { background: var(--gold-soft); color: #6b5310; border: 1px solid rgba(212,175,55,.35); }
.qty button { border-radius: 11px; }
.det-actions { backdrop-filter: blur(10px); background: rgba(255,255,255,.92); }

/* السلة والطلبات */
.cart-line, .checkout, .ord, .card, .about, .menu, .sugg { border-radius: 16px; box-shadow: var(--shadow-soft); }
.chip.s1 { background: var(--gold-soft); color: var(--gold-d); }

/* التتبع */
.track-step.done .dot { background: var(--green-mid); border-color: var(--green-mid); }
.track-step.done:before { background: var(--green-mid); }

/* صفحة المزيد */
.more-logo { background: var(--grad-emerald); color: var(--gold); border-radius: 19px; box-shadow: 0 8px 20px rgba(11,61,40,.3); }
.menu .mi { border-radius: 12px; }

/* شريط التنقل السفلي — زجاجي */
.bnav { background: rgba(255,255,255,.86); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); border-top: 1px solid rgba(11,61,40,.08); box-shadow: 0 -6px 20px rgba(11,61,40,.08); }
.bn-item.active .bn-ico { background: var(--grad-emerald); box-shadow: 0 8px 18px rgba(11,61,40,.4), 0 0 0 2px rgba(212,175,55,.5); }
.bn-item.active .bn-lbl { color: var(--green-d); }

/* لوحة المالك */
.owner-top { background: var(--grad-emerald); border-bottom: 2px solid var(--gold); box-shadow: 0 4px 16px rgba(8,43,28,.35); }
.owner-top h1 { font-weight: 900; }
.card h2 { color: var(--green-d); }
.big-code { color: var(--green-d); }

/* حالات */
.empty .e-ico { background: var(--grad-emerald); color: var(--gold); border-radius: 22px; box-shadow: 0 8px 20px rgba(11,61,40,.28); }

/* تركيز المدخلات */
input:focus, textarea:focus, select:focus { border-color: var(--green) !important; box-shadow: 0 0 0 3px rgba(20,163,92,.18) !important; }

/* FAB واتساب */
.wa-fab { box-shadow: 0 6px 18px rgba(37,211,102,.45); }

/* ===== الفئات زي المرجع (v40): جريد 3 صور ===== */
.cats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px 10px; padding: 2px 14px 8px; }
.ctile { background: none; border: none; cursor: pointer; font-family: inherit; text-align: center; padding: 0; }
.ct-img { position: relative; width: 100%; aspect-ratio: 1/1; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg,#e9f5ee,#d8ecdf); color: var(--green-d); box-shadow: var(--shadow-soft); border: 1px solid rgba(11,61,40,.07); transition: transform .18s ease; }
.ct-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-img svg { width: 34px; height: 34px; stroke-width: 1.5; }
.ct-soon { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(11,61,40,.78); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 0; }
.ct-lbl { display: block; font-size: 13px; font-weight: 800; margin-top: 7px; color: var(--ink); }
.ctile:active .ct-img { transform: scale(.95); }
.cats-grid .ctile { animation: mfade .4s ease-out both; }
.cats-grid .ctile:nth-child(3n+2) { animation-delay: .05s; }
.cats-grid .ctile:nth-child(3n) { animation-delay: .1s; }

/* ===== طلباتي زي المرجع (v40): قائمة بسيطة ===== */
.ord { border-radius: 12px; box-shadow: none; border: none; border-bottom: 1px solid var(--line); margin: 0 14px; padding: 14px 4px; width: calc(100% - 28px); background: #fff; }
#orders-body { background: #fff; margin: 0 12px; border-radius: 16px; box-shadow: var(--shadow-soft); overflow: hidden; padding-bottom: 4px; }
#orders-body .empty { background: transparent; }
.ord-line { display: flex; justify-content: space-between; font-size: 13px; color: #4a5a51; margin-top: 5px; }
.ord-line b { color: var(--green-mid); }

/* إلغاء/إرجاع (v41) */
.chip.sx { background: #f6e3e2; color: #a02525; }


/* زرار الاتصال للكود */
.gate-call { color: var(--green-d); font-weight: 800; text-decoration: none; }
