/* منسوخ من تنسيقات التطبيق (www/css/styles.css + store.css) عشان الموقع يبقى بنفس الشكل */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #FFF6EE;
  --ink: #4A3B32;
  --ink-soft: #8A7566;
  --card: #FFFFFF;
  --line: #F0E4D8;
  --topbar: rgba(255, 246, 238, .88);
  --glow1: #FFE3D0;
  --glow2: #FFE9EF;
  --chipbg: #FAF3EC;
  --time-bg: #FFF3E4;   --time-ink: #B4713A;  --time-border: #F5DFC8;
  --all-bg: #FDEEEE;    --all-ink: #C05656;   --all-border: #F5D5D5;
  --note-bg: #FFF7EC;   --note-ink: #B4713A;
  --bluet-bg: #F0F6FF;  --bluet-ink: #4A78B5; --bluet-border: #DBE8F8;
  --daynote-a: #FFF3E4; --daynote-b: #FFE9EF;
  --inputbg: #FFFBF7;
  --progtrack: #F3E7DB;
  --btn-border: #EADCCF;
  --done-a: #E7F7EE;    --done-b: #F2FBF6;
  --prep-border: #FFE0D1;
  --accent-a: #FFB88C;  --accent-b: #FF8FA3;
  --accent-ink: #D4738A;
  --accent-glow: rgba(255, 143, 163, .35);
  --ok: #5FBF8A;
  --shadow: 0 8px 24px rgba(120, 80, 40, .08);
}

[data-theme="dark"] {
  --bg: #201913;
  --ink: #F1E7DC;
  --ink-soft: #B49F8C;
  --card: #2B221B;
  --line: #3D3128;
  --topbar: rgba(32, 25, 19, .88);
  --glow1: #38281C;
  --glow2: #362430;
  --chipbg: #332A22;
  --time-bg: #3A2E20;   --time-ink: #E0B183;  --time-border: #4A3A26;
  --all-bg: #3E2727;    --all-ink: #F0A2A2;   --all-border: #4E3333;
  --note-bg: #3A2E20;   --note-ink: #E0B183;
  --bluet-bg: #24303E;  --bluet-ink: #9FC2E8; --bluet-border: #31404F;
  --daynote-a: #332A1E; --daynote-b: #38242E;
  --inputbg: #241D17;
  --progtrack: #3D3128;
  --btn-border: #4A3B30;
  --done-a: #243828;    --done-b: #223028;
  --prep-border: #4A3527;
  --accent-glow: rgba(255, 143, 163, .18);
  --ok: #5FBF8A;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  transition: background .35s ease, color .35s ease;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 300px at 85% -50px, var(--glow1) 0%, transparent 70%),
    radial-gradient(500px 300px at 0% 30%, var(--glow2) 0%, transparent 70%);
  transition: background .35s ease;
}

.wrap { max-width: 480px; margin: 0 auto; padding: 0 16px calc(40px + env(safe-area-inset-bottom)); }

/* ---------- الأنيميشن ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes pop {
  0%   { transform: scale(.6); }
  55%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-7px) rotate(2deg); }
}
@keyframes toastIn {
  0%   { transform: translateX(-50%) translateY(80px) scale(.9); opacity: 0; }
  60%  { transform: translateX(-50%) translateY(-4px) scale(1.02); opacity: 1; }
  100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}
.rise { animation: rise .5s cubic-bezier(.2, .8, .3, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- الهيدر ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex; align-items: center; gap: 10px; min-height: 56px;
}
.topbar .logo { font-size: 22px; }
.topbar h1 { font-size: 18px; font-weight: 800; }
.topbar h1 small { display: block; font-size: 10.5px; font-weight: 600; color: var(--ink-soft); }
.backbtn {
  width: 40px; height: 40px; border: none; border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow); cursor: pointer;
  font-size: 18px; color: var(--ink); display: grid; place-items: center;
  text-decoration: none; flex-shrink: 0; transition: transform .15s;
}
.backbtn:active { transform: scale(.9); }
[dir="ltr"] .backbtn { transform: scaleX(-1); }
[dir="ltr"] .backbtn:active { transform: scaleX(-1) scale(.9); }
.toggles { margin-inline-start: auto; display: flex; gap: 8px; }
.tbtn {
  width: 40px; height: 40px; border: none; border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow); cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 800; color: var(--ink);
  display: grid; place-items: center; transition: transform .15s;
}
.tbtn:active { transform: scale(.88) rotate(-8deg); }

/* ---------- الغلاف ---------- */
.hero { text-align: center; padding: 18px 8px 6px; }
.hero .mascot {
  width: 88px; height: 88px; margin: 0 auto 10px; border-radius: 30px;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); display: grid; place-items: center;
  font-size: 46px; box-shadow: 0 12px 28px var(--accent-glow);
  animation: floaty 3.2s ease-in-out infinite;
}
.hero h2 { font-size: 24px; font-weight: 900; }
.hero p { color: var(--ink-soft); font-size: 14px; font-weight: 600; margin-top: 2px; }
.home-toggles { display: flex; justify-content: flex-end; gap: 8px; padding-top: calc(12px + env(safe-area-inset-top)); }
.week-chips { display: flex; gap: 7px; overflow-x: auto; padding: 12px 2px; scrollbar-width: none; }
.week-chips::-webkit-scrollbar { display: none; }
.wk-chip {
  flex-shrink: 0; border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink-soft); font-family: inherit; font-weight: 800; font-size: 12px;
  padding: 8px 14px; border-radius: 30px; cursor: pointer; transition: all .2s;
}
.wk-chip.sel { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* صفحة المتجر */
.shp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; margin: 4px 0 20px; }
.shp-card { display: flex; flex-direction: column; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.shp-img { aspect-ratio: 1 / 1; display: grid; place-content: center; justify-items: center; gap: 4px; background: linear-gradient(160deg, #EEF5FF, #FFF0F4); color: var(--ink-soft); }
.shp-img span { font-size: 30px; opacity: .6; }
.shp-img small { font-size: 11px; font-weight: 800; }
.shp-img img { width: 100%; height: 100%; object-fit: cover; }
[data-theme="dark"] .shp-img { background: linear-gradient(160deg, #26364D, #3D2933); }
.shp-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 11px 12px; }
.shp-name { font-size: 13.5px; font-weight: 900; }
.shp-desc { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.shp-price { margin-top: 4px; font-size: 13.5px; font-weight: 900; color: var(--accent-ink); }
.shp-add { width: 100%; margin-top: 8px; padding: 10px 6px; border: none; border-radius: 12px; cursor: pointer; background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); color: #fff; font-family: inherit; font-size: 12.5px; font-weight: 900; }
.shp-add:active { transform: scale(.96); }
.shp-step { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; padding: 4px; border-radius: 12px; background: var(--chipbg); }
.shp-step button { width: 34px; height: 32px; border: none; border-radius: 10px; cursor: pointer; background: var(--card); box-shadow: var(--shadow); color: var(--ink); font-family: inherit; font-size: 16px; font-weight: 900; }
.shp-step b { min-width: 22px; text-align: center; font-size: 14px; font-weight: 900; }

/* موبايلات صغيرة: العنوان يفضل في سطر واحد جنب زرار السلة */
@media (max-width: 360px) { .shp-top .logo { display: none; } .shp-top h1 { font-size: 16px; } }

/* زرار السلة فوق + شريط "عرض السلة" تحت */
.shp-cartbtn { position: relative; margin-inline-start: auto; flex-shrink: 0; text-decoration: none; }
.shp-cartbtn + .toggles { margin-inline-start: 0; }
.shp-badge { position: absolute; top: -6px; inset-inline-end: -6px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); color: #fff; font-size: 11px; font-weight: 900; }
.shp-grid.has-bar { margin-bottom: 90px; }
.shp-bar { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); width: calc(100% - 32px); max-width: 448px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px; border-radius: 20px; background: var(--ink); color: var(--bg); box-shadow: 0 12px 30px rgba(0, 0, 0, .25); text-decoration: none; font-size: 14px; font-weight: 900; }
/* شريط السلة فوق البار اللي تحت، وينزل مكانه لما البار يستخبى */
body.has-nav .shp-bar { bottom: calc(var(--nav-h) + var(--nav-b) + 10px); transition: bottom .3s ease; }
body.has-nav.nav-away .shp-bar { bottom: var(--nav-b); }

/* صفحة السلة */
.shp-lines { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.shp-line { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.shp-thumb { width: 56px; height: 56px; flex-shrink: 0; display: grid; place-items: center; overflow: hidden; border-radius: 14px; font-size: 20px; background: linear-gradient(160deg, #EEF5FF, #FFF0F4); }
.shp-thumb img { width: 100%; height: 100%; object-fit: cover; }
[data-theme="dark"] .shp-thumb { background: linear-gradient(160deg, #26364D, #3D2933); }
.shp-line-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shp-line-info b { font-size: 13.5px; font-weight: 900; }
.shp-line-info small { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.shp-line-end { display: flex; flex-direction: column; align-items: flex-end; }
.shp-line-sum { font-size: 13px; font-weight: 900; color: var(--accent-ink); }
.shp-line .shp-step { margin-top: 5px; }
.shp-total { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding: 14px 16px; background: var(--card); border: 1.5px dashed var(--line); border-radius: 18px; font-size: 15px; font-weight: 900; }
.shp-total b { font-size: 18px; color: var(--accent-ink); }
.shp-checkout { display: block; width: 100%; margin-top: 16px; padding: 15px; border: none; border-radius: 18px; cursor: pointer; text-align: center; text-decoration: none; background: #1FAF55; color: #fff; box-shadow: 0 5px 0 #158442, 0 12px 20px rgba(31, 175, 85, .25); font-family: inherit; font-size: 15.5px; font-weight: 900; }
.shp-checkout:active { transform: translateY(3px); box-shadow: 0 2px 0 #158442; }
.shp-note { margin: 14px 6px 0; text-align: center; font-size: 12px; font-weight: 700; line-height: 1.9; color: var(--ink-soft); }
.shp-clear { display: block; margin: 12px auto 24px; padding: 6px 10px; border: none; background: none; cursor: pointer; text-decoration: underline; color: var(--ink-soft); font-family: inherit; font-size: 12.5px; font-weight: 800; }
.shp-empty { padding: 48px 12px; text-align: center; }
.shp-empty div { font-size: 48px; opacity: .55; }
.shp-empty h2 { margin: 8px 0 4px; font-size: 17px; font-weight: 900; }
.shp-shop { max-width: 260px; margin-inline: auto; }
.shp-msg { margin-bottom: 6px; padding: 12px 14px; white-space: pre-line; border-radius: 16px 16px 4px 16px; background: #E3FBD4; color: #1D2B14; font-size: 13.5px; font-weight: 700; line-height: 1.9; }

/* 🛍️ ٤ تابات في البار اللي تحت: الأيقونة فوق الكلمة ولازقة فيها (اختيارها ٥ ديسمبر) */
.bb-nav:has(.bb-nav-item:nth-child(4)) { gap: 3px; }
.bb-nav:has(.bb-nav-item:nth-child(4)) .bb-nav-item { flex-direction: column; gap: 1px; font-size: 11.5px; }
.bb-nav:has(.bb-nav-item:nth-child(4)) .bb-nav-item svg { width: 23px; height: 23px; }

/* 🖼️ صورة الكارت لينك لصفحة المنتج + عدد الصور */
.shp-img { position: relative; text-decoration: none; }
.shp-img img { background: #fff; }
.shp-npics { position: absolute; bottom: 7px; inset-inline-start: 7px; padding: 2px 7px; border-radius: 10px; background: rgba(0, 0, 0, .5); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; }
a.shp-name { color: var(--ink); text-decoration: none; }

/* صفحة المنتج */
.shp-item { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.shp-item.has-bar { margin-bottom: 90px; }
.shp-gal { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #fff; aspect-ratio: 1 / 1; }
.shp-gal::-webkit-scrollbar { display: none; }
.shp-gal img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.shp-gal > span { margin: auto; font-size: 40px; opacity: .5; }
.shp-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 0; }
.shp-dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--line); transition: width .2s; }
.shp-dots i.on { width: 18px; background: var(--accent-ink); }
.shp-item-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 16px; }
.shp-item-body h2 { margin: 0; font-size: 19px; font-weight: 900; }
.shp-item-desc { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.shp-info { margin: 4px 0 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; font-weight: 700; }
.shp-item-price { font-size: 17px; }
