/* ===== الغسق ستور — نظام التصميم ===== */
:root {
  --green-950: #06321B;
  --green-900: #0B4D2A;
  --green-800: #0E5E33;
  --green-700: #12703D;
  --green-600: #1A8A4C;
  --green-100: #DCEFE3;
  --green-50: #EEF7F1;
  --gold-600: #A9831A;
  --gold-500: #C9A227;
  --gold-400: #DDBB52;
  --gold-100: #FBF3DC;

  --bg: #F4F7F5;
  --card: #FFFFFF;
  --text: #11241A;
  --text-2: #3D5246;
  --muted: #5E6F65;
  --border: #E1E9E4;
  --danger: #C62828;
  --danger-bg: #FDECEC;
  --warn: #8A5A00;
  --warn-bg: #FFF6E0;
  --info: #0B5C8A;
  --info-bg: #E6F2FA;

  --primary: var(--green-700);
  --primary-press: var(--green-800);
  --on-primary: #fff;
  --accent: var(--gold-500);
  --ring: var(--gold-500);

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --shadow-1: 0 1px 2px rgba(11, 77, 42, .06), 0 2px 8px rgba(11, 77, 42, .06);
  --shadow-2: 0 8px 24px rgba(11, 77, 42, .14);

  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --content-w: 1180px;
  /* هامش جانبي يكبر على الشاشات العريضة ليبقى محتوى الهيدر محاذياً للصفحة */
  --edge: max(16px, calc((100vw - var(--content-w)) / 2 + 16px));
}
:root { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
bdi { unicode-bidi: isolate; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; top: -60px; right: 8px; z-index: 100; background: var(--primary); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 0 16px; }
.pad-x { padding: 8px 16px; }
.mx { margin-inline: 16px; }

/* ===== الهيكل ===== */
/* التطبيق يملأ الشاشة بالكامل على كل الأجهزة، والمحتوى يتوسّط بعرض أقصى مريح للقراءة */
#app {
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
}
main {
  max-width: var(--content-w);
  margin-inline: auto;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 32px);
  outline: none;
}
body.no-tabbar main { padding-bottom: calc(96px + var(--safe-b)); }
main:has(.buy-bar.above-tabs) { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 100px); }
main.enter { animation: enter .28s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

/* شريط حالة الهاتف داخل تطبيق الـ APK (ارتفاعه صفر في المتصفح) */
body::before {
  content: ''; position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  height: var(--safe-t); background: var(--green-900); pointer-events: none;
}

/* ===== الهيدر ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: var(--safe-t);
}
.topbar.inner {
  display: flex; align-items: center; gap: 8px;
  min-height: calc(60px + var(--safe-t));
  padding-inline: max(8px, calc(var(--edge) - 8px));
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar.inner h1 { flex: 1; text-align: center; font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-spacer { width: 44px; flex: none; }

.topbar.home {
  position: relative;
  padding: calc(14px + var(--safe-t)) var(--edge) 18px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(221,187,82,.28), transparent 55%),
    linear-gradient(160deg, var(--green-800), var(--green-950));
  color: #fff;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.topbar.home::after {
  content: ''; position: absolute; inset-inline: 16px; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent); opacity: .7;
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 46px; height: 46px; border-radius: 13px; object-fit: cover; box-shadow: 0 0 0 2px rgba(221,187,82,.6); }
.brand-text { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 19px; font-weight: 800; }
.brand-text span { font-size: 13px; color: #CFE3D6; }
.search-fake {
  margin-top: 14px;
  display: flex; align-items: center; gap: 10px;
  min-height: 50px; padding: 0 16px;
  background: #fff; color: var(--muted);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  font-size: 15px;
}
.search-fake .ico { color: var(--green-700); }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--text);
  transition: background .15s, transform .1s;
}
.icon-btn:active { transform: scale(.94); background: var(--green-50); }
.icon-btn.on-dark { color: #fff; background: rgba(255,255,255,.12); }
.icon-btn.on-dark:active { background: rgba(255,255,255,.22); }
.icon-btn.subtle { color: var(--muted); width: 36px; height: 36px; }
.fav-head.on { color: var(--danger); }
.fav-head.on svg { fill: currentColor; }

/* ===== شريط التبويب ===== */
/* شريط سفلي عائم بزوايا دائرية ومؤشر ذهبي فوق التبويب النشط */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 30;
  padding: 0 10px calc(8px + var(--safe-b));
  pointer-events: none;
  transition: transform .25s var(--ease);
}
.tabbar-inner {
  pointer-events: auto;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: var(--tabbar-h);
  /* زجاج شفاف: خلفية نصف شفافة مع تمويه لما خلفها وحافة بيضاء خفيفة */
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.42));
  backdrop-filter: blur(18px) saturate(1.8); -webkit-backdrop-filter: blur(18px) saturate(1.8);
  border: 1px solid rgba(255,255,255,.7); border-radius: 22px;
  box-shadow: 0 10px 30px rgba(11,77,42,.16), inset 0 1px 0 rgba(255,255,255,.8);
  overflow: hidden;
}
/* عند عدم دعم التمويه نرجع لخلفية شبه معتمة حتى تبقى الأيقونات مقروءة */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar-inner { background: rgba(255,255,255,.95); }
}
.tab { text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.tab.active .tab-ico { background: rgba(18,112,61,.14); }
body.no-tabbar .tabbar { transform: translate(-50%, 120%); }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 12px; font-weight: 500; position: relative;
}
.tab::before {
  content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--gold-500); transform: scaleX(0); transition: transform .25s var(--ease);
}
.tab-ico { position: relative; display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px; transition: background .2s; }
.tab.active { color: var(--green-800); font-weight: 700; }
.tab.active::before { transform: scaleX(1); }
.tab.active .tab-ico { background: var(--green-100); }
.tab:active .tab-ico { transform: scale(.92); }
.tab-badge {
  position: absolute; top: -4px; inset-inline-start: 26px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--gold-500); color: var(--green-950);
  font-size: 11px; font-weight: 800; border-radius: 10px;
  border: 2px solid #fff;
}
.tab-badge.bump { animation: bump .35s var(--ease); }
@keyframes bump { 50% { transform: scale(1.35); } }

/* ===== الأزرار ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px;
  border-radius: 14px; font-weight: 700; font-size: 16px;
  transition: background .15s, transform .1s, opacity .15s;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:active { background: var(--primary-press); }
.btn-outline { border-color: var(--green-700); color: var(--green-800); background: #fff; }
.btn-ghost { color: var(--green-800); }
.btn.wide { width: 100%; }
.btn.grow { flex: 1; }
.btn:disabled { opacity: .6; pointer-events: none; }
.btn.loading { position: relative; color: transparent; }
.btn.loading::after {
  content: ''; position: absolute; width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { color: var(--green-700); font-weight: 700; font-size: 14px; min-height: 44px; padding: 0 8px; }

/* ===== الأقسام العامة ===== */
.sec { margin-top: 22px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; margin-bottom: 10px; }
.sec-head h2 { font-size: 18px; font-weight: 800; }
.sec-head a { display: inline-flex; align-items: center; gap: 2px; color: var(--green-700); font-size: 14px; font-weight: 700; min-height: 44px; }

/* ===== السلايدر ===== */
.slider-wrap { margin: 16px 16px 0; }
.slider {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  border-radius: var(--r-lg); scrollbar-width: none;
}
.slider::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%; scroll-snap-align: start;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 150px; padding: 20px;
  color: #fff;
}
.slide.theme-green { background: linear-gradient(135deg, var(--green-600), var(--green-900)); }
.slide.theme-gold { background: linear-gradient(135deg, #E7C766, var(--gold-600)); color: var(--green-950); }
.slide.theme-dark { background: linear-gradient(135deg, var(--green-900), #031B0E); }
.slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-text { position: relative; max-width: 66%; }
.slide h2 { font-size: 22px; font-weight: 800; line-height: 1.25; }
.slide p { font-size: 14px; margin-top: 4px; opacity: .92; }
.slide-cta {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 12px;
  background: #fff; color: var(--green-900);
  padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 700;
}
.theme-gold .slide-cta { background: var(--green-900); color: #fff; }
.slide-art { position: relative; opacity: .9; }
.slide-art .ico { stroke-width: 1.4; }
.theme-green .slide-art, .theme-dark .slide-art { color: var(--gold-400); }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dot { width: 24px; height: 24px; display: grid; place-items: center; }
.dot::before { content: ''; width: 7px; height: 7px; border-radius: 4px; background: #C6D5CC; transition: width .25s var(--ease), background .25s; }
.dot.on::before { width: 20px; background: var(--green-700); }

/* ===== شريط الثقة ===== */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 16px 0; }
.trust li {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; background: var(--card); border-radius: var(--r);
  font-size: 12.5px; font-weight: 700; color: var(--text-2); text-align: center;
  box-shadow: var(--shadow-1);
}
.trust .ico { color: var(--gold-600); }

/* ===== الأقسام ===== */
.cat-scroll, .h-scroll, .chips {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 8px;
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar, .h-scroll::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 82px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.3; color: var(--text-2);
}
.cat-ico {
  width: 64px; height: 64px; display: grid; place-items: center;
  border-radius: 20px; color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--c) 18%, #fff);
  transition: transform .15s;
}
.cat-chip:active .cat-ico, .cat-tile:active .cat-ico { transform: scale(.94); }

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 16px; }
.cat-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px; min-height: 130px;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1);
}
.cat-tile .cat-ico { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 6px; }
.cat-tile strong { font-size: 15px; }
.cat-tile small { color: var(--muted); font-size: 13px; }
.cat-tile.sk { background: #E9EFEB; box-shadow: none; animation: pulse 1.2s infinite; }
.offers-tile {
  display: flex; align-items: center; gap: 12px; margin: 16px;
  padding: 16px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--gold-100), #F6E7B5);
  color: var(--green-950); border: 1px solid #EBD592;
}
.offers-tile > span { flex: 1; display: flex; flex-direction: column; }
.offers-tile small { color: #6B5410; }
.offers-tile .ico:first-child { color: var(--gold-600); }

.chips { padding-top: 12px; }
.chip {
  flex: none; display: inline-flex; align-items: center;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 14px; font-weight: 700; color: var(--text-2); white-space: nowrap;
}
.chip.on { background: var(--green-800); border-color: var(--green-800); color: #fff; }

.toolbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px 12px; font-size: 14px; }
.select { position: relative; display: inline-block; }
.select select {
  appearance: none; -webkit-appearance: none;
  min-height: 44px; padding: 0 14px 0 36px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card);
  font-size: 14px; font-weight: 700; color: var(--text);
}
.select::after {
  content: ''; position: absolute; left: 14px; top: 50%; width: 8px; height: 8px;
  border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.select.full { display: block; }
.select.full select { width: 100%; min-height: 50px; font-weight: 500; font-size: 16px; }

/* ===== بطاقة المنتج ===== */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px; }
.pad .grid { padding: 0; }
@media (min-width: 480px) { .grid { gap: 14px; } }

.pcard {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow-1);
}
.h-scroll .pcard { flex: 0 0 158px; scroll-snap-align: start; }
.pcard-media { position: relative; display: block; padding: 8px 8px 0; }
.art {
  aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tint, #12703D) 9%, #fff);
  overflow: hidden;
}
.art svg { width: 78%; height: 78%; }
.art img { width: 100%; height: 100%; object-fit: contain; }
.art.lg { border-radius: 0; }
.art.lg svg { width: 62%; height: 62%; }
.art.sm { border-radius: 10px; }
.badge {
  position: absolute; top: 14px; padding: 2px 8px; border-radius: 8px;
  font-size: 12px; font-weight: 800;
}
.badge-sale { inset-inline-start: 14px; background: var(--danger); color: #fff; }
.badge-rx { inset-inline-start: 14px; top: auto; bottom: 6px; background: var(--warn-bg); color: var(--warn); border: 1px solid #F1D79A; }
.fav-btn {
  position: absolute; top: 12px; inset-inline-end: 12px;
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(255,255,255,.92); color: var(--muted);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  transition: transform .15s, color .15s;
}
.fav-btn .ico { width: 19px; height: 19px; }
.fav-btn:active { transform: scale(.88); }
.fav-btn.on { color: var(--danger); }
.fav-btn.on svg, .fav-head.on svg { fill: currentColor; }
.pcard-body { display: flex; flex-direction: column; padding: 10px 12px 0; flex: 1; }
.pcard-brand { font-size: 12px; color: var(--muted); }
.pcard-name {
  font-size: 14.5px; font-weight: 700; line-height: 1.4; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em;
}
.pcard-unit { font-size: 12.5px; color: var(--muted); }
.pcard-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; padding: 8px 12px 12px; }
.price { display: flex; flex-direction: column; font-weight: 800; font-size: 15.5px; color: var(--green-900); line-height: 1.25; }
.price .cur { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.price s { font-size: 12px; color: var(--muted); font-weight: 500; }
.is-oos .art { filter: grayscale(.7); opacity: .7; }
.oos { font-size: 12.5px; font-weight: 700; color: var(--muted); background: #EEF1EF; padding: 6px 10px; border-radius: 10px; }

.add-btn {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  border-radius: 12px; background: var(--primary); color: #fff;
  transition: transform .1s, background .15s;
}
.add-btn:active { transform: scale(.9); background: var(--primary-press); }
.mini-stepper {
  display: flex; align-items: center; height: 40px;
  border-radius: 12px; background: var(--green-50); border: 1px solid var(--green-100);
}
.mini-stepper button { width: 34px; height: 40px; display: grid; place-items: center; color: var(--green-800); }
.mini-stepper span { min-width: 18px; text-align: center; font-weight: 800; font-size: 15px; }

/* ===== السكيليتون ===== */
.sk { box-shadow: none; }
.sk-media, .sk-line, .sk-banner {
  background: linear-gradient(90deg, #E7EEEA 25%, #F3F7F5 50%, #E7EEEA 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite;
}
.sk-media { aspect-ratio: 1; margin: 8px; border-radius: 12px; }
.sk-media.big { margin: 0; border-radius: 0; aspect-ratio: 4/3; }
.sk-line { height: 14px; margin: 12px; border-radius: 7px; }
.sk-line.short { width: 50%; }
.sk-banner { height: 150px; margin: 16px; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 50% { opacity: .6; } }

/* ===== وصفة CTA ===== */
.rx-cta {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 16px 0; padding: 16px;
  border-radius: var(--r); background: var(--card);
  border: 1.5px dashed var(--gold-500);
  color: var(--green-900);
}
.rx-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--gold-100); color: var(--gold-600); flex: none; }
.rx-text { flex: 1; display: flex; flex-direction: column; }
.rx-text strong { font-size: 16px; }
.rx-text small { color: var(--muted); font-size: 13px; }

/* ===== البحث ===== */
.search-box { padding: 12px 16px; position: sticky; top: calc(60px + var(--safe-t)); z-index: 10; background: var(--bg); }
.search-input {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 14px;
  background: var(--card); border: 1.5px solid var(--border); border-radius: 14px;
  color: var(--muted); transition: border-color .15s;
}
.search-input:focus-within { border-color: var(--green-700); }
.search-input input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; color: var(--text); min-width: 0; }
.search-input input::-webkit-search-cancel-button { display: none; }
.clear-q { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 14px; color: var(--text-2);
}
.tag .ico { color: var(--muted); }

/* ===== تفاصيل المنتج ===== */
.pd-media { position: relative; background: #fff; }
.pd-media .art { aspect-ratio: 4/3; }
.pd-media .badge-sale { top: 16px; inset-inline-start: 16px; font-size: 14px; padding: 4px 10px; }
.pd-info {
  position: relative; margin-top: -16px; padding: 20px 16px 4px;
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.pd-brand { color: var(--gold-600); font-weight: 700; font-size: 14px; }
.pd-name { font-size: 22px; font-weight: 800; line-height: 1.35; margin-top: 2px; }
.pd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.rating { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 700; }
.rating .ico { color: var(--gold-500); fill: var(--gold-500); }
.stock { font-weight: 700; color: var(--green-700); }
.stock.low { color: var(--warn); }
.stock.out { color: var(--danger); }
.pd-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 14px 0; font-size: 26px; font-weight: 800; color: var(--green-900); }
.pd-price .cur { font-size: 15px; color: var(--muted); }
.pd-price s { font-size: 15px; color: var(--muted); font-weight: 500; }
.save { font-size: 13px; font-weight: 700; color: var(--danger); background: var(--danger-bg); padding: 3px 8px; border-radius: 8px; }
.pd-sec { margin-top: 18px; }
.pd-sec h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.pd-sec p { color: var(--text-2); }

.notice {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  background: var(--info-bg); color: var(--info); font-size: 14px;
}
.notice .ico { flex: none; margin-top: 1px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice strong { display: block; }
.notice p { color: inherit; }

/* ===== شريط الشراء السفلي ===== */
.buy-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 760px; z-index: 25;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(11,77,42,.06);
}
.buy-bar.above-tabs { bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); padding-bottom: 10px; border-top: 0; box-shadow: none; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.stepper {
  display: flex; align-items: center; height: 50px;
  border: 1.5px solid var(--border); border-radius: 14px; background: #fff;
}
.stepper button { width: 44px; height: 48px; display: grid; place-items: center; color: var(--green-800); }
.stepper button:disabled { color: #B8C5BD; }
.stepper output { min-width: 26px; text-align: center; font-weight: 800; font-size: 17px; }

/* ===== السلة ===== */
.free-ship { margin: 14px 16px 0; padding: 12px 14px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1); font-size: 14px; }
.free-ship p { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.free-ship .ico { color: var(--green-700); flex: none; }
.free-ship .bar { height: 6px; margin-top: 8px; border-radius: 3px; background: var(--green-100); overflow: hidden; }
.free-ship .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-500), var(--green-600)); border-radius: 3px; transition: width .4s var(--ease); }
.free-ship.done p { color: var(--green-800); }
.cart-list { margin: 14px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.cart-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1);
}
.cart-media { width: 84px; flex: none; }
.cart-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.cart-name { font-size: 15px; font-weight: 700; line-height: 1.35; }
.cart-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.cart-bottom .price { flex-direction: row; align-items: baseline; gap: 4px; }
.rx-mini { color: var(--warn); font-weight: 700; }

.summary { margin: 16px; padding: 14px 16px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1); }
.card-box .summary { margin: 10px 0 0; padding: 0; box-shadow: none; }
.summary > div { display: flex; justify-content: space-between; padding: 6px 0; color: var(--text-2); }
.summary dd { margin: 0; font-weight: 700; color: var(--text); }
.summary .cur { font-size: 12px; color: var(--muted); }
.summary .total { border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 12px; font-size: 18px; font-weight: 800; color: var(--text); }
.summary .total dd { color: var(--green-900); }
.free { color: var(--green-700); font-weight: 800; }

/* ===== النماذج ===== */
.form { display: flex; flex-direction: column; gap: 12px; padding: 14px 0 0; }
.card-box {
  margin: 0 16px; padding: 16px; border: 0;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1);
  min-width: 0;
}
.card-box.mx { margin-top: 12px; }
.form .card-box.mx { margin-top: 0; }
.card-box legend {
  float: right; width: 100%;
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 16px; margin-bottom: 12px; padding: 0;
}
.card-box legend .ico { color: var(--gold-600); }
.card-box legend + * { clear: both; }
.box-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.label { font-size: 14px; font-weight: 700; color: var(--text-2); }
.req { color: var(--danger); font-style: normal; }
.opt { color: var(--muted); font-style: normal; font-weight: 500; font-size: 13px; }
.field input, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 12px; background: #FBFCFB;
  font-size: 16px; transition: border-color .15s, background .15s;
}
.field textarea { resize: vertical; min-height: 80px; }
.field input[dir="ltr"] { text-align: right; }
.field input:focus, .field textarea:focus, .select select:focus { outline: 0; border-color: var(--green-700); background: #fff; box-shadow: 0 0 0 3px rgba(18,112,61,.12); }
.hint { font-size: 13px; color: var(--muted); }
.err { font-size: 13px; color: var(--danger); font-weight: 700; min-height: 0; }
.err:empty { display: none; }
.has-err input, .has-err textarea, .has-err select, .has-err .upload { border-color: var(--danger) !important; background: #FFF8F8; }

.upload {
  position: relative; display: block; cursor: pointer;
  border: 1.5px dashed #BFD3C6; border-radius: 14px; background: var(--green-50);
  overflow: hidden; transition: border-color .15s;
}
.upload:focus-within { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(18,112,61,.12); }
.upload input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.upload-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; text-align: center; color: var(--green-800); pointer-events: none; }
.upload-empty small { color: var(--muted); }
.upload-preview { position: relative; display: block; }
.upload-preview[hidden], .upload-empty[hidden] { display: none; }
.upload-preview img { width: 100%; max-height: 260px; object-fit: contain; background: #111; }
.upload-preview .icon-btn { position: absolute; top: 8px; inset-inline-end: 8px; background: rgba(0,0,0,.55); z-index: 2; }

.radio-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer;
}
.radio-card.on { border-color: var(--green-700); background: var(--green-50); }
.radio-card input { position: absolute; opacity: 0; }
.radio-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--green-700); display: grid; place-items: center; flex: none; }
.radio-card input:checked + .radio-dot::after { content: ''; width: 11px; height: 11px; border-radius: 50%; background: var(--green-700); }
.radio-card input:focus-visible + .radio-dot { outline: 3px solid var(--ring); outline-offset: 2px; }
.radio-card span:last-child { display: flex; flex-direction: column; }
.radio-card small { color: var(--muted); font-size: 13px; }

.mini-items li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; color: var(--text-2); }
.mini-items b { color: var(--muted); font-weight: 700; }
.mini-items li span:last-child { white-space: nowrap; font-weight: 700; color: var(--text); }

/* ===== الطلب ===== */
.success { text-align: center; padding: 28px 24px 8px; }
.success-ico {
  width: 88px; height: 88px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 30%, var(--green-600), var(--green-900));
  box-shadow: 0 0 0 8px var(--green-100), 0 0 0 10px rgba(201,162,39,.35);
  animation: pop .5s var(--ease);
}
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.success h2 { font-size: 22px; font-weight: 800; }
.success p { color: var(--muted); margin-top: 6px; }
.success .actions { margin-top: 20px; }
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-head > div { display: flex; flex-direction: column; }
.order-head strong { font-size: 18px; }
.pill { font-size: 12.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.ok { background: var(--green-100); color: var(--green-800); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.track { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px; text-align: center; font-size: 12px; color: var(--muted); }
.track li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.track li span { width: 16px; height: 16px; border-radius: 50%; background: #D8E2DC; position: relative; z-index: 1; }
.track li + li::before { content: ''; position: absolute; top: 7px; right: -50%; width: 100%; height: 2px; background: #D8E2DC; }
.track li.done { color: var(--green-800); font-weight: 700; }
.track li.done span { background: var(--green-700); box-shadow: 0 0 0 3px var(--green-100); }
.track li.done + li.done::before { background: var(--green-700); }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.orders { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.order-card { display: block; padding: 14px 16px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1); }
.order-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; color: var(--muted); }
.order-foot .price { flex-direction: row; gap: 4px; align-items: baseline; }

/* ===== الوصفة ===== */
.intro { padding: 16px 16px 0; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.how li {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 12px 6px; background: var(--card); border-radius: var(--r); font-size: 13px; font-weight: 700; color: var(--text-2);
  box-shadow: var(--shadow-1);
}
.how span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-100); color: var(--gold-600); font-weight: 800; }

/* ===== الحساب ===== */
.profile {
  display: flex; align-items: center; gap: 14px; margin: 16px; padding: 16px;
  border-radius: var(--r); color: #fff;
  background: linear-gradient(150deg, var(--green-700), var(--green-950));
}
.profile > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.profile strong { font-size: 18px; }
.profile span[dir] { color: #CFE3D6; font-size: 14px; text-align: right; }
.profile .icon-btn { color: #fff; background: rgba(255,255,255,.12); }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-500); color: var(--green-950); font-size: 24px; font-weight: 800; flex: none; }
.menu { margin: 12px 16px 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.menu > a, .menu-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; }
.menu > * + * { border-top: 1px solid var(--border); }
.menu > a:active { background: var(--green-50); }
.menu > a > .ico:first-child, .menu-row > .ico:first-child { color: var(--green-700); }
.menu > a > span, .menu-row > span { flex: 1; display: flex; flex-direction: column; font-weight: 700; }
.menu small { color: var(--muted); font-weight: 500; font-size: 13px; text-align: right; }
.menu > a > .ico:last-child { color: var(--muted); }
.foot-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 24px 0 8px; font-size: 13px; color: var(--muted); }
.foot-note img { border-radius: 8px; }

/* ===== حالة فارغة ===== */
.empty { text-align: center; padding: 56px 28px; display: flex; flex-direction: column; align-items: center; }
.empty-ico { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); margin-bottom: 16px; box-shadow: 0 0 0 10px rgba(220,239,227,.5); }
.empty h2 { font-size: 19px; font-weight: 800; }
.empty p { color: var(--muted); margin: 6px 0 20px; max-width: 300px; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 60;
  display: flex; align-items: center; gap: 8px;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px;
  background: var(--green-950); color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-2);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease);
}
body.no-tabbar .toast { bottom: calc(96px + var(--safe-b)); }
body:has(.buy-bar.above-tabs) .toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + 90px); }
.toast .ico { color: var(--gold-400); flex: none; }
.toast.error { background: var(--danger); }
.toast.error .ico { color: #fff; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Splash ===== */
#splash {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: #fff; transition: opacity .35s;
}
#splash img { border-radius: 28px; animation: breathe 1.4s ease-in-out infinite; }
#splash.hide { opacity: 0; pointer-events: none; }
@keyframes breathe { 50% { transform: scale(1.04); } }

/* ===== هيدر الرئيسية: بحث + كاميرا + تبويبات الجمهور ===== */
.topbar.home { padding-bottom: 12px; }
.search-row { display: flex; align-items: center; gap: 10px; }
.search-row .brand-logo { width: 42px; height: 42px; border-radius: 12px; }
.search-wrap {
  flex: 1; min-width: 0; display: flex; align-items: center;
  min-height: 48px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-2);
}
.search-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; color: var(--muted); font-size: 14.5px; }
.search-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-link .ico { color: var(--green-700); flex: none; }
.search-cam {
  width: 44px; height: 40px; margin-inline-end: 4px; flex: none;
  display: grid; place-items: center; border-radius: 10px;
  color: var(--green-800); border-inline-start: 1px solid var(--border);
}
.search-cam:active { background: var(--green-50); }
.greet { margin-top: 8px; font-size: 13px; color: #CFE3D6; }
.segments {
  display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-block: 2px;
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.segments::-webkit-scrollbar { display: none; }
.seg {
  flex: none; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: rgba(255,255,255,.1); color: #E3EFE7; border: 1px solid rgba(255,255,255,.18);
  font-size: 14px; font-weight: 700; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.seg.on { background: var(--gold-500); border-color: var(--gold-500); color: var(--green-950); }
.seg:active { transform: scale(.96); }

/* ===== شبكة الأقسام (الرئيسية) ===== */
.cat-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; padding: 0 16px; }
.cat-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12.5px; font-weight: 700; line-height: 1.3; color: var(--text-2); }
.cat-cell .cat-ico { width: 62px; height: 62px; }

/* ===== العلامات التجارية ===== */
.brand-card {
  flex: 0 0 104px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1);
  font-size: 13px; font-weight: 700; text-align: center; line-height: 1.3;
}
.brand-logo-c, .brand-circle {
  display: grid; place-items: center; flex: none; overflow: hidden;
  font-weight: 800; color: var(--c, var(--green-700));
  background: color-mix(in srgb, var(--c, #12703D) 11%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--c, #12703D) 25%, #fff);
}
.brand-logo-c { width: 56px; height: 56px; border-radius: 16px; font-size: 24px; }
.brand-circle { width: 60px; height: 60px; border-radius: 50%; font-size: 24px; }
.brand-circle.lg { width: 76px; height: 76px; font-size: 32px; }
.brand-logo-c img, .brand-circle img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* ===== شريط الخصم المائل على البطاقة ===== */
.ribbon {
  position: absolute; z-index: 2; top: 16px; right: -34px; width: 132px;
  transform: rotate(45deg); text-align: center; pointer-events: none;
  padding: 4px 0; background: var(--danger); color: #fff;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0;
  box-shadow: 0 2px 6px rgba(198,40,40,.3);
}
.ribbon.warn { background: #E07B00; box-shadow: 0 2px 6px rgba(224,123,0,.3); font-size: 10.5px; }
.pcard .badge-rx { inset-inline-start: auto; inset-inline-end: 14px; }

/* ===== بانر الهدية ===== */
.promo {
  display: flex; align-items: center; gap: 12px; margin: 22px 16px 0; padding: 16px;
  border-radius: var(--r); color: var(--green-950);
  background: linear-gradient(135deg, var(--gold-100), #F2DC97);
  border: 1px solid #E7CF84;
}
.promo-ico { width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center; background: #fff; color: var(--gold-600); }
.promo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.promo-text strong { font-size: 16px; }
.promo-text small { font-size: 13px; color: #6B5410; }
.promo-text b { margin-top: 2px; color: var(--green-900); }
.promo-text .cur { font-size: 12px; color: #6B5410; }

/* ===== نصائح وتجارب ===== */
.story {
  flex: 0 0 240px; scroll-snap-align: start; display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden;
}
.story-media {
  height: 104px; display: grid; place-items: center; color: var(--c);
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--c) 22%, #fff), color-mix(in srgb, var(--c) 8%, #fff));
}
.story-media img { width: 100%; height: 100%; object-fit: cover; }
.story-media .ico { stroke-width: 1.5; }
.story-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; flex: 1; }
.story-body em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--gold-600); }
.story-body strong { font-size: 15px; line-height: 1.4; }
.story-body small { font-size: 13px; color: var(--muted); flex: 1; }
.story-cta {
  align-self: flex-start; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px; background: var(--green-800); color: #fff; font-size: 13px; font-weight: 700;
}
.article-hero { height: 180px; display: grid; place-items: center; color: var(--c); background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--c) 22%, #fff), color-mix(in srgb, var(--c) 8%, #fff)); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.article-hero .ico { stroke-width: 1.4; }
.article-body { margin-top: -16px; position: relative; padding: 20px 16px 4px; background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.article-type { font-style: normal; font-size: 13px; font-weight: 700; color: var(--gold-600); }
.article-body h2 { font-size: 22px; font-weight: 800; line-height: 1.35; margin: 2px 0 10px; }
.article-body > p { color: var(--text-2); margin-bottom: 10px; }
.actions-row { margin-top: 18px; }

/* ===== الأقسام: عرض منقسم ===== */
.split { display: grid; grid-template-columns: 96px minmax(0, 1fr); min-height: calc(100dvh - 60px - var(--tabbar-h)); }
.split-side {
  position: sticky; top: calc(60px + var(--safe-t)); align-self: start;
  max-height: calc(100dvh - 60px - var(--safe-t) - var(--tabbar-h) - var(--safe-b) - 16px);
  overflow-y: auto; scrollbar-width: none;
  background: #E9F0EC; border-radius: 0 0 0 18px; padding: 6px 0 12px;
}
.split-side::-webkit-scrollbar { display: none; }
.side-item {
  position: relative; width: 100%; min-height: 78px; padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; font-weight: 700; line-height: 1.3; text-align: center; color: var(--text-2);
  transition: background .15s, color .15s;
}
.side-item .ico { color: var(--muted); }
.side-item.on { background: var(--bg); color: var(--green-900); }
.side-item.on::before { content: ''; position: absolute; right: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px 0 0 4px; background: var(--green-700); }
.side-item.on .ico { color: var(--c, var(--green-700)); }
.side-item.offers { color: var(--danger); }
.side-item.offers .ico { color: var(--danger); }
.side-sk { display: block; height: 64px; margin: 8px; border-radius: 12px; background: #DCE6E0; animation: pulse 1.2s infinite; }
.split-main { padding: 12px 12px 0; min-width: 0; }
.split-hero {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r);
  background: var(--card); box-shadow: var(--shadow-1);
}
.split-hero .cat-ico { width: 46px; height: 46px; border-radius: 14px; }
.split-hero > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.split-hero small { color: var(--muted); font-size: 12.5px; }
.split-hero > .ico { color: var(--muted); }
.acc { margin-top: 12px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden; }
.acc-item + .acc-item { border-top: 1px solid var(--border); }
.acc-item summary {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px;
  font-weight: 700; font-size: 14.5px; cursor: pointer; list-style: none;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary span { flex: 1; }
.acc-item summary small { min-width: 24px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: var(--green-50); color: var(--green-800); font-size: 12px; }
.acc-item summary .ico { color: var(--muted); transition: transform .2s var(--ease); }
.acc-item[open] summary .ico { transform: rotate(180deg); }
.acc-item[open] summary { color: var(--green-900); }
.acc-list { padding: 0 10px; }
.acc-list a { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; font-size: 13.5px; font-weight: 500; }
.acc-list a:active { background: var(--green-50); }
.acc-list a > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.acc-list small { color: var(--green-800); font-weight: 700; font-size: 12.5px; }
.art.xs { width: 46px; flex: none; border-radius: 10px; }
.acc-all { display: flex; align-items: center; justify-content: flex-end; gap: 2px; min-height: 40px; padding: 0 14px 6px; color: var(--green-700); font-weight: 700; font-size: 13px; }
.split-title { font-size: 15px; font-weight: 800; margin: 18px 2px 10px; }
.brand-circles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 6px; padding-bottom: 8px; }
.brand-circles a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-align: center; line-height: 1.3; }

/* ===== رؤوس صفحات العروض والعلامة ===== */
.offers-hero, .brand-hero {
  display: flex; align-items: center; gap: 12px; margin: 14px 16px 6px; padding: 16px; border-radius: var(--r);
}
.offers-hero { background: linear-gradient(135deg, #C62828, #8E1B1B); color: #fff; }
.offers-hero > div, .brand-hero > div { display: flex; flex-direction: column; }
.offers-hero small { color: #FFD9D9; font-size: 13px; }
.brand-hero { background: var(--card); box-shadow: var(--shadow-1); }
.brand-hero strong { font-size: 18px; }
.brand-hero small { color: var(--muted); }
.pd-brand { display: inline-flex; align-items: center; gap: 2px; }

/* ===== المحادثة مع الصيدلاني ===== */
.chat-btn { position: relative; }
.chat-badge, .menu-badge {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--gold-500); color: var(--green-950);
}
.chat-badge { position: absolute; top: -4px; inset-inline-end: -4px; border: 2px solid var(--green-900); }
.menu-badge { background: var(--danger); color: #fff; }
.ask-btn {
  display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px;
  border-radius: var(--r); background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-900);
}
.ask-btn > span { flex: 1; display: flex; flex-direction: column; }
.ask-btn small { color: var(--muted); font-size: 13px; }
.ask-btn > .ico:first-child { color: var(--green-700); }

.topbar.chat-head { justify-content: flex-start; }
.chat-avatar { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 1.5px var(--gold-400); }
.chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.chat-title strong { font-size: 16px; }
.chat-title small { font-size: 12px; color: var(--green-700); font-weight: 700; }
body.is-chat main { padding-bottom: 0; }
.chat { display: flex; flex-direction: column; height: calc(100dvh - 60px - var(--safe-t)); }
.chat-msgs {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 6px; padding: 16px 14px 10px;
  background:
    radial-gradient(circle at 20% 10%, rgba(201,162,39,.06), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(18,112,61,.06), transparent 45%);
}
#msgList { display: flex; flex-direction: column; gap: 6px; }
.bubble {
  max-width: min(78%, 520px); padding: 8px 12px 6px; border-radius: 18px;
  font-size: 15px; line-height: 1.55; box-shadow: 0 1px 2px rgba(0,0,0,.06);
  word-break: break-word;
}
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble time { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 2px; font-size: 11px; opacity: .75; }
/* رسائل الزبون على اليسار (نهاية السطر في RTL) ورسائل الصيدلية على اليمين */
.bubble.me { align-self: flex-end; background: var(--green-700); color: #fff; border-end-end-radius: 6px; }
.bubble.them { align-self: flex-start; background: #fff; color: var(--text); border-end-start-radius: 6px; }
.bubble.pending { opacity: .7; }
.bubble.welcome { border: 1px dashed var(--gold-400); }
.bubble-img { display: block; margin: 2px -6px 6px; border-radius: 12px; overflow: hidden; min-width: 160px; min-height: 120px; background: rgba(0,0,0,.08); }
.bubble-img img { display: block; max-width: 260px; max-height: 300px; width: 100%; object-fit: cover; }
.spinner-sm { display: block; width: 22px; height: 22px; margin: 48px auto; border: 3px solid rgba(255,255,255,.4); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
.day-sep { display: flex; justify-content: center; margin: 8px 0 4px; }
.day-sep span { font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(255,255,255,.85); padding: 3px 12px; border-radius: 999px; box-shadow: var(--shadow-1); }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 10px calc(8px + var(--safe-b));
  background: rgba(255,255,255,.96); border-top: 1px solid var(--border);
}
.composer .attach { color: var(--green-800); cursor: pointer; }
.composer-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.composer textarea {
  width: 100%; min-height: 44px; max-height: 120px; resize: none;
  padding: 10px 14px; border-radius: 22px; border: 1.5px solid var(--border); background: #F3F6F4;
  font-size: 16px; line-height: 1.45; outline: none;
}
.composer textarea:focus { border-color: var(--green-700); background: #fff; }
.composer-preview { position: relative; align-self: flex-start; }
.composer-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.composer-preview .icon-btn { position: absolute; top: -10px; inset-inline-end: -10px; width: 28px; height: 28px; background: #fff; box-shadow: var(--shadow-1); border-radius: 50%; }
.send-btn { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; }
.send-btn:active { transform: scale(.92); }
.send-btn svg { transform: scaleX(-1); }
.chat-intro { text-align: center; padding: 24px 0 12px; }
.chat-intro > img { margin: 0 auto 10px; border-radius: 22px; }
.chat-intro h2 { font-size: 21px; font-weight: 800; }
.chat-intro > p { color: var(--muted); margin: 6px 24px 14px; }
.chat-intro .notice { margin: 0 16px 12px; }
.chat-intro .form { text-align: start; }
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 90dvh; object-fit: contain; border-radius: 8px; }
.lightbox .icon-btn { position: absolute; top: calc(12px + var(--safe-t)); inset-inline-end: 12px; }

/* ===== الشاشات الكبيرة: تابلت / آيباد / كمبيوتر ===== */
main[data-layout="narrow"] { max-width: 760px; }
.segments { margin-inline: calc(-1 * var(--edge)); padding-inline: var(--edge); }

@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .cat-grid4 { grid-template-columns: repeat(8, 1fr); }
  .slide { min-height: 190px; padding: 28px 32px; }
  .slide h2 { font-size: 28px; }
  .slide p { font-size: 16px; }
  .h-scroll .pcard { flex-basis: 190px; }
  .story { flex-basis: 280px; }
  .trust li { flex-direction: row; justify-content: center; gap: 8px; font-size: 14px; }
  .split { grid-template-columns: 132px minmax(0, 1fr); }
  .split-main { padding: 16px 20px 0; }
  .brand-circles { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .how li { font-size: 14px; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .slider-wrap { margin-top: 20px; }
  .slide { min-height: 230px; }
  .acc { display: grid; grid-template-columns: 1fr 1fr; }
  .acc-item + .acc-item { border-top: 0; }
  .acc-item { border-bottom: 1px solid var(--border); }
  .acc-item:nth-child(odd) { border-inline-end: 1px solid var(--border); }
  /* تفاصيل المنتج: الصورة بجانب المعلومات */
  .pd-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding: 20px 16px 0; align-items: start; }
  .pd-layout .pd-media { position: sticky; top: 80px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
  .pd-layout .pd-info { margin-top: 0; padding-top: 4px; }
  .article { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; padding: 20px 16px 0; align-items: start; }
  .article-hero { border-radius: var(--r-lg); height: 240px; }
  .article-body { margin-top: 0; padding-top: 0; }
}
@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (hover: hover) {
  .pcard:hover { box-shadow: var(--shadow-2); }
  .btn-primary:hover { background: var(--primary-press); }
  .chip:hover:not(.on), .tag:hover { border-color: var(--green-600); }
}

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