/* تطبيق الزبائن — أولوية الجوال، RTL افتراضياً، وضع داكن تلقائي.
   الهوية: أحمر المتجر على رمادي فولاذي بارد وحبر داكن. خط Tajawal نفسه المستعمل في الموقع (ملفات محلية في assets/fonts). */
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/tajawal-400-ar.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/tajawal-400-lat.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2191, U+2193, U+FEFF; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/tajawal-700-ar.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/tajawal-700-lat.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2191, U+2193, U+FEFF; }

:root {
	--primary: #d60000;
	--on-primary: #fff;
	--primary-t: color-mix(in srgb, var(--primary) 8%, var(--card));
	--accent: #0f766e;
	--ink: #16191c;
	--on-ink: #f3f4f5;
	--bg: #f2f3f4;
	--card: #fff;
	--text: #16191c;
	--muted: #5b636a;
	--line: #e3e5e8;
	--star: #f59e0b;
	--danger: #b91c1c;
	--ok: #15803d;
	--warn: #b45309;
	--radius: 16px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(16, 20, 24, .06), 0 6px 18px rgba(16, 20, 24, .07);
	--shadow-up: 0 -6px 18px rgba(16, 20, 24, .08);
	--safe-b: env(safe-area-inset-bottom, 0px);
	--tab-h: 62px;
	--bar-h: 56px;
	--ease: cubic-bezier(.16, 1, .3, 1);
	--font: "Tajawal", "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
	color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
	:root {
		--ink: #23282c;
		--bg: #0f1113;
		--card: #181b1e;
		--text: #f1f3f4;
		--muted: #a2a9af;
		--line: #2a2f34;
		--danger: #f87171;
		--ok: #4ade80;
		--warn: #fbbf24;
		--accent: #2dd4bf;
		--shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 8px 22px rgba(0, 0, 0, .35);
		--shadow-up: 0 -6px 18px rgba(0, 0, 0, .35);
	}
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
body {
	margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
	font-size: 16px; line-height: 1.55; min-height: 100vh; overflow-x: hidden; accent-color: var(--primary); caret-color: var(--primary);
}
::selection { background: color-mix(in srgb, var(--primary) 24%, transparent); }
img { max-width: 100%; display: block; }
svg { width: 1.25em; height: 1.25em; vertical-align: -.2em; flex: 0 0 auto; } /* أيقونة داخل نص؛ المكوّنات تحدد أحجامها أدناه */
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: start; }
.num { font-variant-numeric: tabular-nums; }
html[dir="ltr"] .flip { transform: scaleX(-1); }

/* ---------- الإطار ---------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.boot { flex: 1; display: grid; place-items: center; min-height: 60vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.appbar { position: sticky; top: 0; z-index: 30; background: var(--card); border-bottom: 1px solid var(--line); }
.bar-row { height: var(--bar-h); display: flex; align-items: center; gap: 4px; padding-inline: 14px 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; min-width: 0; }
.brand img { height: 30px; width: auto; max-width: 150px; object-fit: contain; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.iconbtn {
	position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
	background: transparent; border: 0; color: var(--text);
}
.iconbtn:active { background: var(--line); }
.iconbtn svg { width: 24px; height: 24px; }
.badge-dot {
	position: absolute; top: 3px; inset-inline-end: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
	background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 700; display: grid; place-items: center;
	box-shadow: 0 0 0 2px var(--card);
}
.badge-dot.bump { animation: bump .45s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 100% { transform: scale(1); } }
.langbtn { height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 13px; margin-inline-end: 2px; }
.bar-search {
	display: flex; align-items: center; gap: 10px; margin: 0 14px 10px; min-height: 44px; padding: 0 16px; border-radius: 999px;
	background: var(--bg); color: var(--muted); font-size: 15px; border: 1.5px solid transparent; transition: border-color .15s;
}
.bar-search:active { border-color: var(--primary); }
.bar-search svg { width: 20px; height: 20px; color: var(--primary); }
main { flex: 1; padding: 14px 14px calc(var(--tab-h) + var(--safe-b) + 22px); max-width: 780px; width: 100%; margin: 0 auto; outline: none; }
main.nobar { padding-bottom: calc(100px + var(--safe-b)); }
.tabbar {
	position: fixed; inset-inline: 0; bottom: 0; z-index: 30; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
	display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-top: 1px solid var(--line);
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--muted); border: 0; background: none; min-height: 48px; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--primary); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 30px; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
@media (min-width: 900px) {
	.tabbar { max-width: 780px; margin: 0 auto; border-inline: 1px solid var(--line); border-radius: 16px 16px 0 0; }
}

/* ---------- مكوّنات ---------- */
h1 { font-size: 22px; line-height: 1.3; margin: 6px 0 12px; text-wrap: balance; }
h1:focus { outline: none; } /* يُنقل التركيز للعنوان لقارئات الشاشة عند تغيير الصفحة فقط */
h2 { font-size: 18px; margin: 22px 0 10px; text-wrap: balance; }
h3 { font-size: 16px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.card + .card { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px;
	border: 0; font-weight: 700; background: var(--primary); color: var(--on-primary); width: 100%;
	transition: transform .08s ease, opacity .15s, background-color .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.alt { background: var(--card); color: var(--text); border: 1.5px solid var(--line); }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.green { background: var(--accent); }
.btn.danger { background: var(--danger); }
.btn.sm { min-height: 38px; padding: 0 14px; width: auto; font-size: 14px; border-radius: 10px; }
.btn svg { width: 20px; height: 20px; }
.btn .spin { width: 18px; height: 18px; border-width: 2px; }
.chip {
	display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 20px; background: var(--card);
	border: 1.5px solid var(--line); font-weight: 700; font-size: 14px; white-space: nowrap;
}
.chip[aria-pressed="true"], .chip.on { border-color: var(--primary); color: var(--primary); background: var(--primary-t); }
.chip.off { opacity: .45; text-decoration: line-through; }
.scroller { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 10px; margin-inline: -14px; padding-inline: 14px; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; flex: 0 0 auto; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; background: var(--line); }
.badge.ok { background: color-mix(in srgb, var(--ok) 16%, var(--card)); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, var(--card)); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--danger) 14%, var(--card)); color: var(--danger); }
.banner-off { margin: 0 0 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line)); font-size: 14px; }
.linkbtn { background: none; border: 0; color: var(--primary); font-weight: 700; font-size: 14px; padding: 8px 2px; }

/* ---------- نماذج ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); margin-top: 4px; }
.input, textarea.input, select.input {
	width: 100%; min-height: 50px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
	appearance: none; -webkit-appearance: none;
}
textarea.input { min-height: 92px; resize: vertical; }
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: 13.5px; margin-top: 5px; font-weight: 700; }
.err:empty { display: none; }
.codebox { letter-spacing: .6em; text-align: center; font-size: 24px; font-weight: 700; direction: ltr; }

/* ---------- بطاقات المنتجات ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.pcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; position: relative; content-visibility: auto; contain-intrinsic-size: auto 290px; }
.pcard .im { position: relative; aspect-ratio: 1 / 1; background: #fff; }
.pcard .im > a { display: block; width: 100%; height: 100%; }
.pcard .im img { width: 100%; height: 100%; object-fit: cover; }
.pcard .bd { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; color: inherit; }
.pcard .nm { font-size: 14px; font-weight: 400; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.pcard.out .im img { filter: grayscale(.7); opacity: .65; }
.rt { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.rt svg { width: 14px; height: 14px; fill: var(--star); stroke: none; }
.pcard .bd .price { margin-top: auto; }
.price { font-weight: 700; font-size: 18px; line-height: 1.3; }
.price.sale { color: var(--primary); }
.price .cur { font-size: 12px; font-weight: 700; color: var(--muted); margin-inline-start: 3px; }
.price.sale .cur { color: inherit; }
.price s { font-weight: 400; font-size: 13px; color: var(--muted); margin-inline-start: 6px; }
.save-tag { font-size: 12px; font-weight: 700; color: var(--ok); }
.off-tag { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; line-height: 1.4; }
.soldout { position: absolute; inset-inline: 8px; bottom: 8px; padding: 5px 8px; border-radius: 8px; background: rgba(22, 25, 28, .82); color: #fff; font-size: 12.5px; font-weight: 700; text-align: center; }
.qadd {
	position: absolute; inset-inline-end: 8px; bottom: 8px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; padding: 0;
	background: var(--card); color: var(--primary); border: 1.5px solid var(--line); box-shadow: var(--shadow); transition: transform .1s, background-color .15s, color .15s;
}
.qadd::after { content: ""; position: absolute; inset: -5px; }
.qadd:active { transform: scale(.9); background: var(--primary); color: var(--on-primary); }
.qadd svg { width: 20px; height: 20px; }
.skel { background: linear-gradient(90deg, var(--line), color-mix(in srgb, var(--line) 50%, var(--card)), var(--line)); background-size: 200% 100%; animation: sh 1.3s infinite; border-radius: 10px; }
@keyframes sh { to { background-position: -200% 0; } }

/* ---------- الرئيسية ---------- */
.hero-wrap { position: relative; }
.hero { display: flex; scroll-snap-type: x mandatory; overflow-x: auto; gap: 10px; margin-inline: -14px; padding-inline: 14px; scrollbar-width: none; overscroll-behavior-x: contain; }
.hero::-webkit-scrollbar { display: none; }
.hero a { flex: 0 0 92%; scroll-snap-align: center; border-radius: 20px; overflow: hidden; position: relative; aspect-ratio: 1536 / 672; background: var(--line); display: block; box-shadow: var(--shadow); }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 720px) { .hero a { flex-basis: 64%; } }
.dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 2px; }
.dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--line); transition: width .3s var(--ease), background-color .3s; }
.dots i.on { width: 22px; background: var(--primary); }
@media (prefers-reduced-motion: reduce) { .dots i { transition: none; } }
.perkbar { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 14px; }
.perkbar div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.3; }
.perkbar div + div { border-inline-start: 1px solid var(--line); }
.perkbar svg { width: 24px; height: 24px; color: var(--accent); }
.tiles { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 14px -14px 2px; padding: 4px 14px 8px; scroll-snap-type: x proximity; }
.tiles::-webkit-scrollbar { display: none; }
.tile { flex: 0 0 74px; display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; color: var(--text); scroll-snap-align: start; }
.tile .ti { width: 66px; height: 66px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; overflow: hidden; }
.tile .ti img { width: 100%; height: 100%; object-fit: cover; }
.tile .ti.ic { background: var(--primary-t); box-shadow: none; padding: 13px; }
.tile .ti.ic img { object-fit: contain; }
.tile .ti b { font-size: 24px; color: var(--primary); }
.tile .ti svg { width: 28px; height: 28px; color: var(--primary); }
.tile:active .ti { transform: scale(.94); }
.tile .tn { font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.3; max-width: 78px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rail-sec { margin-top: 22px; }
.rail-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rail-h h2 { margin: 0; font-size: 19px; font-weight: 700; }
.rail-all { display: inline-flex; align-items: center; gap: 2px; color: var(--primary); font-weight: 700; font-size: 13.5px; text-decoration: none; padding: 6px 2px; }
.rail-all svg { width: 16px; height: 16px; }
.rail { gap: 12px; }
.rail .pcard { flex: 0 0 156px; max-width: 156px; scroll-snap-align: start; }
@media (min-width: 560px) { .rail .pcard { flex-basis: 184px; max-width: 184px; } }
.band { background: var(--primary); color: var(--on-primary); margin: 22px -14px 0; padding: 16px 0 6px; }
.band .rail-h { padding-inline: 14px; }
.band .rail-h h2 { color: inherit; display: flex; align-items: center; gap: 8px; }
.band .rail-h h2 svg { width: 22px; height: 22px; }
.band .rail-all { color: inherit; }
.band .pcard { box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.how { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: 22px; }
.how h3 { font-size: 18px; margin: 0 0 16px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; }
.steps::before { content: ""; position: absolute; top: 24px; inset-inline: 17%; border-top: 2px dashed var(--line); }
.step { position: relative; text-align: center; font-size: 12.5px; font-weight: 700; line-height: 1.45; }
.step .si { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-t); color: var(--primary); display: grid; place-items: center; margin: 0 auto 8px; position: relative; box-shadow: 0 0 0 5px var(--card); }
.step .si svg { width: 24px; height: 24px; }
.how .btn { margin-top: 16px; }
.promo { background: var(--ink); color: var(--on-ink); border-radius: var(--radius); padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.promo .pi { grid-row: span 2; width: 54px; height: 54px; border-radius: 16px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.promo .pi svg { width: 28px; height: 28px; }
.promo h3 { font-size: 17px; margin: 0; line-height: 1.35; }
.promo .pt { font-size: 14px; color: color-mix(in srgb, var(--on-ink) 78%, transparent); line-height: 1.5; }
.promo .btn { grid-column: 1 / -1; margin-top: 12px; background: var(--primary); color: #fff; }
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; font-size: 12.5px; font-weight: 700; }
.trust div { background: var(--card); border-radius: 12px; padding: 10px 6px; box-shadow: var(--shadow); }
.trust svg { width: 26px; height: 26px; margin: 0 auto 4px; color: var(--accent); }

/* ---------- صفحة المنتج ---------- */
body[data-route="product"] .appbar { display: none; }
#view.pdp { padding-top: 0; }
.gal-wrap { position: relative; margin-inline: -14px; background: #fff; }
.gal { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #fff; }
.gal::-webkit-scrollbar { display: none; }
.gal img { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; }
@media (min-width: 700px) { .gal img { aspect-ratio: 4 / 3; max-height: 460px; } }
.fab {
	position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; padding: 0;
	background: rgba(255, 255, 255, .94); color: #16191c; border: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .18), 0 4px 12px rgba(0, 0, 0, .12); text-decoration: none;
}
.fab:active { transform: scale(.94); }
.fab svg { width: 22px; height: 22px; }
.fab.back { inset-inline-start: 12px; }
.fab.cartf { inset-inline-end: 12px; }
.fab.share { inset-inline-end: 62px; }
.fab .badge-dot { box-shadow: 0 0 0 2px #fff; }
.gal-count { position: absolute; inset-inline-end: 12px; bottom: 12px; background: rgba(22, 25, 28, .78); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.gal-off { inset-inline-start: 12px; top: auto; bottom: 12px; font-size: 14px; padding: 4px 10px; border-radius: 10px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; scrollbar-width: none; margin-inline: -14px; background: #fff; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button { flex: 0 0 58px; height: 58px; border-radius: 10px; border: 2px solid transparent; padding: 0; overflow: hidden; background: #fff; opacity: .65; transition: opacity .15s, border-color .15s; }
.thumbs button.on { border-color: var(--primary); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.blk { background: var(--card); margin-inline: -14px; padding: 16px 14px; margin-top: 8px; }
.thumbs + .blk { margin-top: 0; }
.blk > h2 { margin: 0 0 12px; font-size: 18px; }
.pname { font-size: 20px; line-height: 1.45; margin: 0 0 8px; font-weight: 700; text-wrap: balance; }
.rate-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rate-row a { color: var(--muted); }
.stars { display: inline-flex; gap: 1px; }
.stars svg { width: 16px; height: 16px; fill: var(--star); stroke: none; }
.stars svg.e { fill: var(--line); }
.pbox { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; margin-top: 14px; }
.price-xl { font-size: 32px; font-weight: 700; line-height: 1; color: var(--text); }
.price-xl.sale { color: var(--primary); }
.price-xl .cur { font-size: 14px; font-weight: 700; margin-inline-start: 4px; }
.pbox s { font-size: 16px; color: var(--muted); }
.pill { display: inline-block; padding: 3px 9px; border-radius: 8px; font-size: 13px; font-weight: 700; background: var(--primary); color: var(--on-primary); }
.pnote { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; font-size: 13.5px; }
.pnote .save-tag { font-size: 14px; }
.perks { margin: 0; padding: 0; list-style: none; }
.perks li { display: flex; align-items: center; gap: 12px; padding: 12px 0; font-size: 14.5px; font-weight: 700; border-top: 1px solid var(--line); }
.perks li:first-child { border-top: 0; padding-top: 0; }
.perks li:last-child { padding-bottom: 0; }
.perks .pi { width: 38px; height: 38px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 13%, var(--card)); color: var(--accent); display: grid; place-items: center; flex: none; }
.perks .pi svg { width: 20px; height: 20px; }
.perks small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.opt-grp + .opt-grp { margin-top: 14px; }
.opt-grp > b { font-size: 15px; }
.opt-grp .chip { min-height: 44px; padding: 0 18px; font-size: 15px; }
.opt-grp .chip.on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 22px; font-weight: 700; }
.stepper button:active { background: var(--line); }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; }
.buybar {
	position: fixed; inset-inline: 0; bottom: 0; z-index: 31; background: var(--card); border-top: 1px solid var(--line); box-shadow: var(--shadow-up);
	padding: 10px 14px calc(10px + var(--safe-b)); display: flex; gap: 10px; align-items: center; max-width: 780px; margin: 0 auto;
}
.buybar .tot { min-width: 84px; line-height: 1.25; }
.buybar .tot b { display: block; font-size: 20px; color: var(--primary); }
.buybar .btn { min-height: 50px; }
.prose { font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.prose p { margin: 0 0 10px; }
.prose.clamp { max-height: 9.5em; overflow: hidden; position: relative; }
.prose.clamp::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3.4em; background: linear-gradient(transparent, var(--card)); }
.rsum { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.rsum .big { font-size: 38px; font-weight: 700; line-height: 1; }
.rsum .stars svg { width: 18px; height: 18px; }
.rev { padding: 14px 0; border-top: 1px solid var(--line); }
.rev .rh { display: flex; align-items: center; gap: 10px; }
.rv-av { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-t); color: var(--primary); display: grid; place-items: center; font-weight: 700; flex: none; }
.rev .rh > div { flex: 1; min-width: 0; }
.rev .rh b { display: block; line-height: 1.3; }
.rev p { margin: 8px 0 0; line-height: 1.7; }

/* ---------- السلة والدفع ---------- */
.line { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.line .im { width: 72px; height: 72px; border-radius: 12px; background: var(--line); overflow: hidden; flex: 0 0 auto; }
.line .im img { width: 100%; height: 100%; object-fit: cover; }
.line .nm { font-weight: 700; font-size: 14.5px; line-height: 1.4; }
.sum div { display: flex; justify-content: space-between; padding: 5px 0; }
.sum .total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 18px; }
.cod { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); font-weight: 700; }
.cod svg { width: 26px; height: 26px; color: var(--accent); flex: 0 0 auto; }
.done-ic { width: 84px; height: 84px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 15%, var(--card)); color: var(--ok); display: grid; place-items: center; margin: 14px auto; animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.done-ic svg { width: 46px; height: 46px; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- تتبع الطلب ---------- */
.tl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 14px 0 4px; }
.tl div { text-align: center; position: relative; font-size: 12.5px; font-weight: 700; color: var(--muted); padding-top: 28px; }
.tl div::before { content: ""; position: absolute; top: 8px; inset-inline: 0; height: 4px; background: var(--line); }
.tl div::after { content: ""; position: absolute; top: 0; inset-inline-start: calc(50% - 10px); width: 20px; height: 20px; border-radius: 50%; background: var(--line); border: 3px solid var(--card); }
.tl div.done { color: var(--text); }
.tl div.done::before, .tl div.done::after { background: var(--accent); }
.tl div.now { color: var(--accent); }
.tl.cancelled div::before, .tl.cancelled div::after { background: var(--danger); }

/* ---------- الحساب ---------- */
.bal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.bal div { background: var(--card); border-radius: 12px; padding: 10px 4px; box-shadow: var(--shadow); }
.bal b { display: block; font-size: 20px; }
.bal span { font-size: 12px; color: var(--muted); }
.code { display: inline-block; letter-spacing: .25em; font-weight: 700; font-size: 26px; padding: 8px 16px; border: 2px dashed var(--primary); border-radius: 12px; color: var(--primary); direction: ltr; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.hist li:first-child { border-top: 0; }

/* ---------- الإشعارات (مركز الإشعارات + التنبيهات المنبثقة) ---------- */
.nhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nhead h1 { margin: 6px 0 4px; }
.ngrp { font-size: 14.5px; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
.nitem { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; position: relative; color: inherit; transition: transform .1s; }
.nitem:active { transform: scale(.985); }
.nitem.unread { background: color-mix(in srgb, var(--primary) 5%, var(--card)); }
.nic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--line); color: var(--text); }
.nic svg { width: 22px; height: 22px; }
.nic.t-ok { background: color-mix(in srgb, var(--ok) 15%, var(--card)); color: var(--ok); }
.nic.t-red { background: var(--primary-t); color: var(--primary); }
.nic.t-bad { background: color-mix(in srgb, var(--danger) 14%, var(--card)); color: var(--danger); }
.nic.t-warn { background: color-mix(in srgb, var(--warn) 15%, var(--card)); color: var(--warn); }
.nbody { flex: 1; min-width: 0; }
.nbody b { display: block; font-size: 15px; line-height: 1.4; }
.nbody .nt { display: block; font-size: 13.5px; color: var(--muted); margin-top: 2px; line-height: 1.55; }
.nbody time { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.udot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); flex: none; margin-top: 7px; }
.nempty { text-align: center; padding: 36px 16px 20px; }
.nempty .nic { width: 76px; height: 76px; margin: 0 auto 14px; }
.nempty .nic svg { width: 36px; height: 36px; }
.nempty p { margin: 6px 0 16px; }
.nnote { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 10%, var(--card)); font-size: 13.5px; font-weight: 700; margin-top: 8px; }
.nnote svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.nnote span { flex: 1; }
/* بطاقة تفعيل إشعارات الهاتف (تظهر بعد أول طلب فقط، والإذن لا يُطلب إلا عند الضغط على «تفعيل») */
.pushask { margin: 4px 0 14px; }
.pushask .prow { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 12px; }
.pushask .prow .btn { margin-top: 0; grid-column: auto; flex: 1; }
.pushask .prow .btn.ghost { flex: none; background: transparent; color: var(--on-ink); opacity: .8; }
#pushslot:empty { display: none; }

/* ---------- نافذة سفلية وتنبيهات ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); max-height: 88vh; overflow: auto; animation: up .22s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.toasts { position: fixed; inset-inline: 0; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding-inline: 12px; }
.toast {
	pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--card); color: var(--text); padding: 10px 12px; border-radius: 16px; width: 100%; max-width: 440px;
	box-shadow: 0 2px 6px rgba(16, 20, 24, .12), 0 14px 30px rgba(16, 20, 24, .2); animation: drop .3s var(--ease);
}
.toast .ti { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--line); }
.toast .ti svg { width: 18px; height: 18px; }
.toast.ok .ti { background: color-mix(in srgb, var(--ok) 16%, var(--card)); color: var(--ok); }
.toast.bad .ti { background: color-mix(in srgb, var(--danger) 15%, var(--card)); color: var(--danger); }
.toast .tm { flex: 1; font-size: 14.5px; font-weight: 700; line-height: 1.4; }
.toast .ta { font-size: 14px; font-weight: 700; color: var(--primary); padding: 8px 6px; white-space: nowrap; }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- المدير ---------- */
.tabs2 { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.tabs2 .chip { min-height: 38px; }
.mrow { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.mrow:first-child { border-top: 0; }
.mrow .im { width: 52px; height: 52px; border-radius: 10px; background: var(--line); overflow: hidden; }
.mrow .im img { width: 100%; height: 100%; object-fit: cover; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.mini .input { min-height: 42px; padding: 6px 10px; }
.mini label { font-size: 12px; color: var(--muted); display: block; }
.json { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; direction: ltr; min-height: 280px; }

/* ---------- الطباعة (ملخص الطلب / PDF) ---------- */
.invoice { background: #fff; color: #111; border-radius: 12px; padding: 18px; }
.invoice table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.invoice th, .invoice td { padding: 8px 6px; border-bottom: 1px solid #ddd; text-align: start; font-size: 14px; }
.invoice .note { font-size: 12px; color: #555; margin-top: 12px; }
@media print {
	body { background: #fff; }
	.appbar, .tabbar, .buybar, .toasts, .no-print { display: none !important; }
	main { padding: 0; max-width: none; }
	.invoice { box-shadow: none; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
	* { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}
