/* ===== هيكل المتجر ===== */
.app-header {
  position: sticky; top: 0; z-index: 500;
  height: calc(var(--header-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top);
  background: rgba(12, 12, 15, 0.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { max-width: 1200px; height: var(--header-h); margin: 0 auto; padding: 0 var(--s4); display: flex; align-items: center; gap: var(--s3); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img.mark { height: 34px; width: auto; }
.brand .word { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; }
.header-search { flex: 1; max-width: 460px; margin-inline: auto; display: none; }
.header-actions { display: flex; align-items: center; gap: var(--s2); margin-inline-start: auto; }
.wallet-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 12px; border-radius: var(--r-pill); background: var(--ink-2); border: 1px solid var(--line); font-weight: 700; font-size: var(--fs-sm); }
.wallet-pill .plus { width: 28px; height: 28px; border-radius: 50%; background: var(--crimson); display: grid; place-items: center; color: #fff; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--fog); border: 1px solid transparent; }
.icon-btn:hover { color: var(--paper); background: var(--ink-2); }
.dot { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--crimson); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.desk-nav { display: none; }
.desk-only { display: none !important; }

.page { max-width: 1200px; margin: 0 auto; padding: var(--s5) var(--s4) calc(var(--nav-h) + var(--s8) + env(safe-area-inset-bottom)); min-height: 60dvh; }
.page-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s5); }
.page-head h1 { font-size: var(--fs-xl); }
.page-head .back { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ink-2); border: 1px solid var(--line-soft); }
.section { margin-top: var(--s8); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s4); }
.section-head h2 { font-size: var(--fs-lg); }
.section-head a { font-size: var(--fs-sm); color: var(--fog); }

/* الشريط السفلي */
.bottom-nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 600;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(14, 14, 18, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-soft);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.bottom-nav a { position: relative; display: grid; place-items: center; align-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--fog-2); }
.bottom-nav a.active { color: var(--paper); }
.bottom-nav a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--crimson); }
.bottom-nav a.active .icon { color: var(--crimson); }
.bottom-nav .dot { top: 8px; inset-inline-end: calc(50% - 22px); }

/* ===== الرئيسية: الواجهة ===== */
.hero { position: relative; border-radius: 22px; overflow: hidden; border: 1px solid var(--line-soft); background: var(--ink-2); aspect-ratio: 16 / 7; min-height: 170px; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s var(--ease); }
.hero-slide.on { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-dots { position: absolute; bottom: 10px; inset-inline: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.hero-dots button { width: 7px; height: 7px; border-radius: 4px; background: rgba(255,255,255,0.4); transition: width 0.25s; }
.hero-dots button.on { width: 22px; background: var(--crimson); }

/* الواجهة بدون صور: الشريط الأحمر من الشعار */
.hero-brand { position: absolute; inset: 0; display: grid; align-content: center; padding: var(--s6); background: radial-gradient(90% 120% at 0% 100%, rgba(227,18,63,0.28), transparent 60%), url('../assets/pattern.svg'), var(--ink-2); }
.hero-brand h1, .hero-brand p { position: relative; z-index: 1; }
.hero-brand h1 { font-size: clamp(1.35rem, 5vw, 2.4rem); max-width: 13ch; }
.hero-brand p { color: var(--fog); margin-top: var(--s2); max-width: min(36ch, 62%); font-size: var(--fs-sm); }
.ribbon { position: absolute; inset-inline-end: -60px; top: -30px; width: 46%; height: 140%; pointer-events: none; opacity: .95; }

.promise { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-top: var(--s4); }
.promise div { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--ink-2); border: 1px solid var(--line-soft); font-size: var(--fs-xs); font-weight: 600; color: var(--fog); }
.promise .icon { color: var(--crimson); width: 18px; height: 18px; }

.search-bar { margin-top: var(--s5); }
.search-bar .input { min-height: 52px; border-radius: var(--r-lg); background: var(--ink-2); }

/* شبكة الأقسام */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--s3); }
.cat { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 14px 8px 12px; border-radius: var(--r-lg); background: var(--ink-2); border: 1px solid var(--line-soft); transition: border-color 0.2s; }
.cat:hover { border-color: var(--line); }
.cat img, .cat .ph { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; background: var(--ink-3); }
.cat span { font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; }

.products { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }

/* صفحة القسم */
.cat-hero { display: flex; align-items: center; gap: var(--s4); padding: var(--s4); border-radius: var(--r-lg); background: linear-gradient(135deg, var(--ink-3), var(--ink-2)); border: 1px solid var(--line-soft); margin-bottom: var(--s5); }
.cat-hero img { width: 72px; height: 72px; border-radius: 18px; object-fit: cover; }
.cat-hero h1 { font-size: var(--fs-xl); }

/* صفحة المنتج */
.pd { display: grid; gap: var(--s5); }
.pd-art { border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--ink-2); border: 1px solid var(--line-soft); display: grid; place-items: center; }
.pd-art img { width: 100%; height: 100%; object-fit: cover; }
.pd h1 { font-size: var(--fs-2xl); }
.pd .price { font-size: var(--fs-2xl); }
.buy-bar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); padding: var(--s2); background: rgba(19,19,23,0.92); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: var(--r-lg); }
.assure { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); text-align: center; font-size: var(--fs-xs); color: var(--fog); }
.assure div { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: var(--r-md); border: 1px solid var(--line-soft); }

/* المحفظة */
.balance-card { position: relative; overflow: hidden; border-radius: 22px; padding: var(--s6); background: radial-gradient(120% 140% at 100% 0%, rgba(227,18,63,0.35), transparent 55%), var(--ink-2); border: 1px solid var(--line); }
.balance-card .amount { font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 800; line-height: 1.1; margin-top: 4px; }
.methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.method { display: flex; align-items: center; gap: var(--s3); padding: 14px; border-radius: var(--r-lg); background: var(--ink-2); border: 1px solid var(--line-soft); text-align: start; font-weight: 600; }
.method.active { border-color: var(--crimson); background: var(--crimson-wash); }
.method .mi { width: 38px; height: 38px; border-radius: 11px; background: var(--ink-3); display: grid; place-items: center; color: var(--crimson); flex: none; }
.acct { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 12px 14px; border-radius: var(--r-md); background: var(--ink); border: 1px solid var(--line-soft); }
.acct b { font-family: var(--font-display); direction: ltr; letter-spacing: 0.04em; }

.amount-in { color: var(--ok); }
.amount-out { color: var(--paper); }

/* السلة */
.cart-item { display: grid; grid-template-columns: 56px 1fr; gap: var(--s3); padding: var(--s4) 0; border-bottom: 1px solid var(--line-soft); }
.cart-item:last-child { border-bottom: 0; }
.cart-item .thumb { width: 56px; height: 56px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: var(--fs-sm); color: var(--fog); }
.summary-row.total { color: var(--paper); font-weight: 700; font-size: var(--fs-lg); border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 12px; }

/* الطلبات */
.order-card { display: grid; gap: 10px; padding: var(--s4); border-radius: var(--r-lg); background: var(--ink-2); border: 1px solid var(--line-soft); text-align: start; width: 100%; }
.order-card .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-xs); color: var(--fog); }

/* الحساب */
.profile { display: flex; align-items: center; gap: var(--s4); }
.avatar { width: 58px; height: 58px; border-radius: 18px; background: var(--crimson); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl); flex: none; }
.menu-list > a, .menu-list > button { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 14px 4px; border-bottom: 1px solid var(--line-soft); font-weight: 500; text-align: start; }
.menu-list > :last-child { border-bottom: 0; }
.menu-list .icon:first-child { color: var(--fog); }
.menu-list .end { margin-inline-start: auto; color: var(--fog-2); }

.rich { line-height: 1.9; color: #D9D6DE; }
.rich p { margin-bottom: var(--s3); }
.rich b, .rich strong { color: var(--paper); }
.rich ul { padding-inline-start: var(--s5); margin-bottom: var(--s3); }
.rich a { color: var(--crimson); }

.site-foot { border-top: 1px solid var(--line-soft); margin-top: var(--s10); padding: var(--s6) 0 var(--s2); display: grid; gap: var(--s3); justify-items: center; text-align: center; color: var(--fog-2); font-size: var(--fs-xs); }
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: var(--fs-sm); color: var(--fog); }

/* ===== الشاشات الكبيرة ===== */
@media (min-width: 640px) {
  .products { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .bottom-nav { display: none; }
  .page { padding-bottom: var(--s10); }
  .header-search { display: block; }
  .desk-nav { display: flex; gap: 2px; }
  .desk-nav a { padding: 8px 14px; border-radius: 10px; color: var(--fog); font-weight: 600; font-size: var(--fs-sm); }
  .desk-nav a.active, .desk-nav a:hover { color: var(--paper); background: var(--ink-2); }
  .desk-nav a.active { box-shadow: inset 0 -2px 0 var(--crimson); }
  .mob-only { display: none !important; }
  .desk-only { display: grid !important; }
  .products { grid-template-columns: repeat(4, 1fr); }
  .cats { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .pd { grid-template-columns: 1.05fr 1fr; align-items: start; }
  .buy-bar { position: static; }
  .hero { aspect-ratio: 16 / 5; }
  .two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--s5); align-items: start; }
}
