/* Tajawal — مستضاف محلياً (SIL OFL) */
/* arabic */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/tajawal-500-arabic.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, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/tajawal-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/tajawal-700-arabic.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, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/tajawal-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/tajawal-800-arabic.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, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/tajawal-800-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* هوية الكباشي — ثيم غامق + ذهبي (من لوحة هوية المصمم v2) */
:root {
  --dark: #1C110A;        /* الخلفية */
  --dark2: #3A2214;       /* البطاقات */
  --brown: #5C3A1E;       /* الحدود والفواصل */
  --gold: #D4A537;
  --gold-deep: #9C6B1D;
  --gold-light: #F3D77E;
  --cream: #F8F0DE;       /* النص الأساسي */
  --sand: #E6D2A6;        /* النص الثانوي */
  --muted: #BFA57A;       /* نص خافت (مقروء على الغامق) */
  --wa: #1FA855;
  --danger: #F08A7E;      /* أحمر فاتح مقروء على الغامق */
  --danger-bg: rgba(240, 138, 126, .14);
  --field: #140C07;       /* خلفية الحقول */
  --radius: 18px;
  --shadow: 0 4px 14px rgba(0, 0, 0, .35);
  color-scheme: dark;
  accent-color: var(--gold);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--dark); }
body {
  margin: 0; font-family: "Tajawal", "Cairo", system-ui, sans-serif; font-weight: 700;
  background: var(--dark); color: var(--cream); font-size: 19px; line-height: 1.6;
  padding-bottom: 96px; /* مساحة شريط الأزرار السفلي */
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-weight: 700; font-size: 1.05rem; }
h1, h2, h3 { color: var(--gold-light); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
#app { display: flow-root; min-height: 100vh; } /* يمنع قفز الفوتر قبل ما يتحمّل المحتوى */
.muted { color: var(--muted); font-weight: 500; }
.lead { margin: -8px 0 12px; color: var(--sand); font-weight: 500; }
::selection { background: var(--gold); color: var(--dark); }

/* الهيدر */
.top {
  background: var(--dark); color: var(--gold-light);
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--gold-deep);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 10px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 54px; width: auto; max-width: min(220px, 58vw); display: block; object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(212,165,55,.25)); }
.logo-sub { font-size: .8rem; color: var(--sand); font-weight: 500; display: block; }
.top-call {
  background: var(--gold); color: var(--dark); border: 0; border-radius: 999px; padding: 8px 16px;
  font-size: .95rem; white-space: nowrap; cursor: pointer;
}
.demo-flag { background: var(--dark2); color: var(--gold-light); border-bottom: 1px solid var(--gold-deep);
  text-align: center; font-size: .8rem; padding: 3px; font-weight: 500; }

/* البانر */
.hero-banner { display: block; margin: 0 -16px; border-bottom: 1px solid var(--gold-deep); }
.sub .hero-wrap { display: none; }
.hero-banner img { width: 100%; height: auto; display: block; aspect-ratio: 810 / 1013; background: var(--dark2); }
@media (min-width: 720px) { .hero-banner img { aspect-ratio: 1440 / 525; } }

.section-title { font-size: 1.35rem; margin: 22px 0 12px; color: var(--gold-light); font-weight: 800; }

/* البطاقات العامة */
.card, .cat, .prod, .detail {
  background: var(--dark2); color: var(--cream); border: 1px solid var(--brown);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card { padding: 18px; margin-top: 14px; }
.card p { color: var(--sand); }

/* بطاقات الأقسام */
.cats { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .cats { grid-template-columns: 1fr 1fr; } }
.cat { display: flex; align-items: center; gap: 14px; padding: 16px; min-height: 96px; transition: border-color .15s; }
.cat:hover, .cat:focus-visible { border-color: var(--gold-deep); }
.cat:active { transform: scale(.99); border-color: var(--gold); }
.cat-icon {
  flex: 0 0 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 2rem;
  background: linear-gradient(135deg, var(--gold-light), var(--gold)); overflow: hidden;
}
.cat-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat h3 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.cat p { margin: 2px 0 0; font-size: .9rem; color: var(--sand); font-weight: 500; }
.cat .arrow { margin-inline-start: auto; color: var(--gold); font-size: 1.6rem; }

/* المنتجات */
.crumbs { margin: 16px 0 0; font-size: .95rem; color: var(--muted); }
.crumbs a { color: var(--gold); }
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 640px) { .products { grid-template-columns: 1fr 1fr 1fr; } }
.prod { overflow: hidden; display: flex; flex-direction: column; }
.prod-img { aspect-ratio: 1; background: radial-gradient(circle at 50% 40%, var(--brown), var(--dark2) 75%);
  display: grid; place-items: center; font-size: 3rem; }
.prod-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prod-name { font-size: 1rem; line-height: 1.4; font-weight: 800; color: var(--cream); }
.price { color: var(--gold); font-size: 1.15rem; font-weight: 800; }
.price small { color: var(--sand); font-size: .8rem; font-weight: 500; }
.price.ask { font-size: .95rem; color: var(--gold-light); }
.prod .btn { margin-top: auto; }
.ad-meta { font-size: .95rem; color: var(--sand); font-weight: 500; }

/* صفحة منتج */
.detail { overflow: hidden; margin-top: 14px; }
.detail .prod-img { aspect-ratio: 4/3; font-size: 5rem; }
@media (min-width: 720px) { .detail .prod-img { aspect-ratio: 16/10; } }
.detail-body { padding: 18px; }
.detail h1 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 800; }
.detail p { color: var(--sand); font-weight: 500; }

/* الأزرار */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 58px; border: 0; border-radius: 14px; cursor: pointer; font-size: 1.15rem; font-weight: 800;
  background: linear-gradient(180deg, var(--gold-light), var(--gold) 55%, var(--gold-deep)); color: var(--dark);
  box-shadow: 0 3px 0 var(--brown); padding: 10px 16px; text-align: center;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--brown); }
.btn:focus-visible, .tab:focus-visible, .mini:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.btn.small { min-height: 48px; font-size: 1rem; }
.btn.dark { background: var(--dark); color: var(--gold-light); border: 1px solid var(--gold); box-shadow: none; }
.btn.wa { background: var(--wa); color: #fff; box-shadow: 0 3px 0 #13703a; }
.btn.outline { background: transparent; color: var(--gold-light); border: 1px solid var(--gold); box-shadow: none; }
.btn[disabled] { opacity: .6; cursor: default; }
.stack { display: grid; gap: 10px; margin-top: 14px; }

/* النموذج */
.order-item { display: flex; gap: 12px; align-items: center; background: var(--dark); border: 1px solid var(--brown);
  border-radius: 14px; padding: 10px; }
.order-item .thumb { width: 64px; height: 64px; border-radius: 12px; background: var(--brown); display: grid; place-items: center;
  font-size: 1.8rem; overflow: hidden; flex: 0 0 64px; }
.order-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
label { display: block; margin: 16px 0 6px; font-size: 1.1rem; font-weight: 800; color: var(--cream); }
label .opt { color: var(--muted); font-weight: 500; font-size: .9rem; }
input, textarea, select {
  width: 100%; min-height: 58px; border: 1px solid var(--brown); border-radius: 14px; padding: 12px 14px;
  background: var(--field); color: var(--cream); font-size: 1.15rem;
}
select { min-height: 54px; padding: 8px 12px; }
select option { background: var(--dark2); color: var(--cream); }
input[type=file] { min-height: 0; padding: 10px; font-size: 1rem; color: var(--sand); }
input[type=file]::file-selector-button { font-family: inherit; font-weight: 700; border: 0; border-radius: 10px;
  padding: 8px 14px; margin-inline-end: 10px; background: var(--gold); color: var(--dark); cursor: pointer; }
textarea { min-height: 90px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #8A7660; opacity: 1; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 165, 55, .25); }
input:-webkit-autofill { -webkit-text-fill-color: var(--cream); -webkit-box-shadow: 0 0 0 100px var(--field) inset; caret-color: var(--cream); }
input[type=tel] { text-align: right; unicode-bidi: plaintext; }
input[aria-invalid=true] { border-color: var(--danger); }
.err { color: var(--danger); font-size: .95rem; margin-top: 4px; min-height: 1em; }
.qty { display: flex; align-items: center; gap: 10px; }
.qty button { width: 58px; height: 58px; border-radius: 14px; border: 1px solid var(--gold); background: var(--dark);
  font-size: 1.6rem; color: var(--gold-light); cursor: pointer; }
.qty input { text-align: center; width: 90px; flex: 0 0 90px; }
.note { background: rgba(212, 165, 55, .1); border: 1px solid var(--gold-deep); border-radius: 14px;
  padding: 12px 14px; margin-top: 14px; font-size: 1rem; color: var(--gold-light); font-weight: 500; }

/* صفحة النجاح */
.done { text-align: center; }
.done .tick { width: 90px; height: 90px; border-radius: 50%; margin: 6px auto 10px; display: grid; place-items: center;
  background: var(--gold); color: var(--dark); font-size: 3rem; }
.done h1 { font-size: 1.5rem; margin: 0 0 6px; }
.done .big { font-size: 1.25rem; color: var(--sand); }
.done b { color: var(--gold-light); }

/* السياسة */
.policy h2 { color: var(--gold); font-size: 1.2rem; margin: 18px 0 4px; }
.policy p, .policy li { font-weight: 500; color: var(--sand); }
.policy b { color: var(--cream); }
.policy a { color: var(--gold-light); }

/* شريط الأزرار الثابت */
.dock {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 30; background: var(--dark);
  border-top: 1px solid var(--gold-deep); padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.dock .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; }
.dock .btn { min-height: 56px; }

footer { text-align: center; color: var(--muted); font-size: .9rem; padding: 24px 0 8px; font-weight: 500; }
footer a { color: var(--gold-light); text-decoration: underline; }
.empty { text-align: center; padding: 30px 10px; color: var(--sand); }
.empty small { color: var(--muted); }
.loading { text-align: center; padding: 40px; color: var(--gold); }
