/* المتجر: صفحة المنتج + السلّة + خطوات الشراء. يُحمَّل في صفحات المتجر فقط. */

/* ── صفحة المنتج ─────────────────────────────────────────────────────────── */
.pdp { padding:28px 0 90px; background:linear-gradient(180deg,#ffffff 0, var(--brand-50) 520px, #ffffff 900px); }
.pdp-crumb { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:13.5px; color:var(--muted); margin-bottom:22px; }
.pdp-crumb a:hover { color:var(--brand-900); }
.pdp-crumb b { color:var(--brand-900); font-weight:600; max-width:min(40ch,100%); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* RTL: العمودُ الأوّل يمينًا (التفاصيل) والثاني يسارًا (الصورة) */
.pdp-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.08fr); gap:48px; align-items:start; }
.pdp-media figure { margin:0; position:relative; border-radius:24px; overflow:hidden; background:#ffffff; box-shadow:var(--shadow-lg); aspect-ratio:4/3; }
.pdp-media img { width:100%; height:100%; object-fit:cover; display:block; }
.pdp-badge { position:absolute; top:18px; inset-inline-start:18px; background:var(--flame); color:#ffffff; font-weight:800; font-size:14px; padding:7px 14px; border-radius:999px; box-shadow:0 6px 18px rgba(217, 69, 58,.35); }

.pdp-tags { display:flex; gap:8px; margin-bottom:12px; }
.pdp-kind, .pdp-tag { font-size:12.5px; font-weight:700; padding:5px 12px; border-radius:999px; }
.pdp-kind { background:var(--brand-900); color:#ffffff; }
.pdp-tag { background:var(--gold-100); color:var(--gold-700); }
.pdp-info h1 { font-size:clamp(28px,3.2vw,42px); color:var(--brand-900); margin:0 0 12px; }
.pdp-lead { font-size:17px; color:var(--ink-soft); line-height:1.85; margin:0 0 22px; }

.pdp-price { display:flex; align-items:baseline; gap:14px; flex-wrap:wrap; padding:18px 0; border-block:1px solid var(--line); }
.pdp-price .now { font-size:34px; font-weight:900; color:var(--brand-900); }
.pdp-price .now .sar { font-size:16px; font-weight:700; color:var(--muted); }
.pdp-price .was { font-size:18px; color:var(--muted); text-decoration:line-through; }
.pdp-price .off { background:#fdecea; color:var(--flame); font-weight:800; font-size:13.5px; padding:5px 12px; border-radius:999px; }
.pdp-price .ask { font-size:22px; font-weight:800; color:var(--brand-900); }
.pdp-split { margin:12px 0 0; font-size:14px; color:var(--ink-soft); display:flex; align-items:center; gap:6px; flex-wrap:wrap; }

.pdp-actions { display:flex; gap:12px; margin:22px 0; }
.pdp-actions .btn { flex:1; padding:16px 22px; font-size:16px; }
.pdp-add.in-cart { background:#0f6b3a; box-shadow:0 8px 22px rgba(15, 107, 58,.25); }

.pdp-meta { list-style:none; padding:0; margin:0 0 20px; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.pdp-meta li { display:flex; align-items:center; gap:12px; background:#ffffff; border:1px solid var(--line); border-radius:14px; padding:12px 14px; }
.pdp-meta svg { color:var(--gold-500); flex:none; }
.pdp-meta small { display:block; font-size:12px; color:var(--muted); }
.pdp-meta b { font-size:14.5px; color:var(--brand-900); }

.pdp-trainer { display:flex; align-items:center; gap:12px; margin-bottom:20px; }
.pdp-trainer .av { width:46px; height:46px; border-radius:50%; display:grid; place-items:center; color:#ffffff; font-weight:800; }
.pdp-trainer small { display:block; font-size:12px; color:var(--muted); }
.pdp-trainer b { display:block; color:var(--brand-900); }
.pdp-trainer em { font-style:normal; font-size:13px; color:var(--muted); }

.pdp-trust { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; font-size:13.5px; color:var(--muted); padding-top:16px; border-top:1px dashed var(--line); }
.pdp-trust > span:first-child { display:inline-flex; align-items:center; gap:6px; color:#0f6b3a; font-weight:700; }
.pdp-pms { display:flex; flex-wrap:wrap; gap:6px; }

/* شاراتُ طرق الدفع */
.pm { font-style:normal; display:inline-flex; align-items:center; height:24px; padding:0 9px; border-radius:6px; font-size:11.5px; font-weight:800; white-space:nowrap; border:1px solid rgba(0, 0, 0,.06); }
.pm-stcpay { background:#f3ecfb; color:#4f008c; }
/* الشعاراتُ الرسميّة: بطاقةٌ بيضاء كأيقونات بوّابات الدفع، وتابي على أخضرها، وتمارا شارتُها المتدرّجة كما هي */
.pm.has-logo { background:#ffffff; border:1px solid #c4d4f3; padding:0 8px; justify-content:center; min-width:46px; }
.pm.has-logo img { height:13px; width:auto; display:block; }
.pm-applepay.has-logo { border-color:#000000; }
.pm-applepay.has-logo img { height:15px; }
.pm-mada.has-logo img { height:15px; }
.pm-tabby.has-logo { background:#3bffc1; border-color:#3bffc1; }
.pm-tamara.has-logo { padding:0; border:0; background:none; min-width:0; }
.pm-tamara.has-logo img { height:24px; }
.pdp-split .pm { vertical-align:middle; }

.pdp-more { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin-top:56px; }
.pdp-card { background:#ffffff; border:1px solid var(--line); border-radius:var(--radius); padding:26px; box-shadow:var(--shadow-sm); }
.pdp-card:only-child, .pdp-wide { grid-column:1 / -1; }
.pdp-card h2 { font-size:20px; color:var(--brand-900); margin:0 0 14px; }
.pdp-details { white-space:pre-line; line-height:1.95; color:var(--ink-soft); min-height:1.5em; }
.pdp-feats { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.pdp-feats li { display:flex; gap:10px; align-items:flex-start; line-height:1.7; }
.pdp-feats svg { flex:none; margin-top:4px; color:#ffffff; background:var(--gold-500); border-radius:50%; padding:2px; width:18px; height:18px; }
.pdp-incl { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
.pdp-incl a { display:flex; gap:12px; align-items:center; padding:10px; border:1px solid var(--line); border-radius:14px; transition:border-color .16s, background .16s; }
.pdp-incl a:hover { border-color:var(--brand-300); background:var(--brand-50); }
.pdp-incl img { width:64px; height:52px; object-fit:cover; border-radius:10px; flex:none; }
.pdp-incl b { display:block; font-size:14.5px; color:var(--brand-900); }
.pdp-incl small { color:var(--muted); font-size:12.5px; }

.pdp-related { margin-top:64px; }
.pdp-related h2 { font-size:clamp(22px,2.4vw,30px); color:var(--brand-900); margin:0 0 20px; }
.pdp-rel { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.pdp-rel-card { background:#ffffff; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-sm); transition:transform .18s, box-shadow .18s; }
.pdp-rel-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-md); }
.pdp-rel-card img { width:100%; aspect-ratio:16/10; object-fit:cover; display:block; }
.pdp-rel-card > span { display:block; padding:14px 16px 16px; }
.pdp-rel-card b { display:block; color:var(--brand-900); margin-bottom:4px; }
.pdp-rel-card em { font-style:normal; color:var(--gold-500); font-weight:800; }

.pdp-sticky { display:none; }

/* ── السلّة وإتمام الطلب ─────────────────────────────────────────────────── */
.co { padding:34px 0 90px; background:var(--paper-soft); min-height:60vh; }
.co-wrap { max-width:1080px; }
.co-steps { list-style:none; margin:0 auto 30px; padding:0; display:flex; justify-content:center; gap:0; max-width:640px; }
.co-steps li { flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; position:relative; font-size:13.5px; color:var(--muted); font-weight:600; }
.co-steps li + li::before { content:""; position:absolute; top:17px; inset-inline-end:calc(50% + 22px); width:calc(100% - 44px); height:2px; background:var(--line); }
.co-steps li.done + li::before, .co-steps li.done + li.on::before { background:var(--gold-500); }
.co-steps i { font-style:normal; width:36px; height:36px; border-radius:50%; display:grid; place-items:center; background:#ffffff; border:2px solid var(--line); font-weight:800; color:var(--muted); position:relative; z-index:1; }
.co-steps li.on { color:var(--brand-900); }
.co-steps li.on i { border-color:var(--brand-900); background:var(--brand-900); color:#ffffff; box-shadow:0 0 0 5px var(--brand-100); }
.co-steps li.done { color:var(--gold-500); }
.co-steps li.done i { border-color:var(--gold-500); background:var(--gold-500); color:#ffffff; }

.co-grid { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:22px; align-items:start; }
.co-card { background:#ffffff; border:1px solid var(--line); border-radius:var(--radius); padding:26px; box-shadow:var(--shadow-sm); }
.co-card h1 { font-size:22px; color:var(--brand-900); margin:0 0 18px; }
.co-sum { position:sticky; top:100px; }
.co-sum h2 { font-size:17px; color:var(--brand-900); margin:0 0 14px; }
.co-sumlist { list-style:none; margin:0 0 12px; padding:0 0 12px; border-bottom:1px solid var(--line); display:grid; gap:10px; }
.co-sumlist li { display:flex; justify-content:space-between; gap:12px; font-size:14px; }
.co-sumlist li span { color:var(--ink-soft); }
.co-sumlist li b { white-space:nowrap; }
.co-row { display:flex; justify-content:space-between; margin:8px 0; font-size:14.5px; }
.co-row.save { color:#0f6b3a; font-weight:700; }
.co-row.total { font-size:19px; font-weight:900; color:var(--brand-900); }
.co-vat { font-size:12.5px; color:var(--muted); margin:4px 0 16px; }
.co-sum .btn-block { padding:15px; }
.co-more { display:block; text-align:center; margin-top:12px; font-size:14px; color:var(--muted); }
.co-more:hover { color:var(--brand-900); }

.co-list { display:grid; gap:12px; }
.co-item { display:grid; grid-template-columns:96px minmax(0,1fr) auto; gap:14px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:14px; }
.co-item img { width:96px; height:72px; object-fit:cover; border-radius:10px; display:block; }
.co-kind { font-size:11.5px; font-weight:700; color:var(--gold-600); }
.co-item b { display:block; color:var(--brand-900); margin:2px 0 4px; line-height:1.5; }
.co-price { margin:0; font-weight:800; color:var(--brand-900); }
.co-price s { color:var(--muted); font-weight:500; font-size:13px; margin-inline-start:6px; }
.co-rm { font-size:13px; color:var(--muted); padding:8px 12px; border-radius:999px; border:1px solid var(--line); background:#ffffff; cursor:pointer; }
.co-rm:hover { color:var(--flame); border-color:#f4c6c2; background:#fdecea; }
.co-empty { display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; padding:40px 10px; color:var(--muted); }
.co-empty svg { color:var(--brand-300); }
.co-empty b { color:var(--brand-900); font-size:18px; }
.co-empty .btn { margin-top:10px; }

.co-note { font-size:14px; color:var(--muted); margin:-8px 0 18px; }
.co-fields { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.co-fields label { display:grid; gap:6px; font-size:14px; font-weight:600; color:var(--brand-900); }
.co-fields label.wide { grid-column:1 / -1; }
.co-fields em { font-style:normal; font-weight:400; color:var(--muted); font-size:12.5px; }
.co-fields input, .co-fields textarea { font:inherit; font-size:16px; padding:12px 14px; border:1.5px solid var(--line); border-radius:12px; background:#ffffff; width:100%; transition:border-color .16s, box-shadow .16s; }
.co-fields input[dir="ltr"] { text-align:left; }
.co-fields input:focus, .co-fields textarea:focus { outline:0; border-color:var(--brand-500); box-shadow:0 0 0 4px var(--brand-100); }
.co-fields .bad { border-color:var(--flame); box-shadow:0 0 0 4px #fdecea; }
.co-err { color:var(--flame); font-size:14px; font-weight:600; min-height:1.4em; margin:12px 0 0; }
.co-nav { display:flex; justify-content:space-between; gap:12px; margin-top:16px; }
.co-nav.center { justify-content:center; flex-wrap:wrap; }

.co-methods { display:grid; gap:10px; }
.co-method { display:flex; align-items:center; gap:14px; padding:14px 16px; border:1.5px solid var(--line); border-radius:14px; cursor:pointer; transition:border-color .16s, background .16s; }
.co-method:hover { border-color:var(--brand-300); }
.co-method:has(input:checked) { border-color:var(--brand-900); background:var(--brand-50); box-shadow:0 0 0 3px var(--brand-100); }
.co-method input { width:20px; height:20px; accent-color:var(--brand-900); flex:none; margin:0; }
.co-method .pm { min-width:84px; justify-content:center; height:30px; font-size:12.5px; }
.co-method b { display:block; color:var(--brand-900); font-size:15px; }
.co-method small { color:var(--muted); font-size:13px; }
.co-paynote { margin:16px 0 0; padding:12px 14px; background:#fff7e1; border:1px solid var(--gold-100); border-radius:12px; color:var(--gold-700); }
.co-terms { font-size:12.5px; color:var(--muted); margin:12px 0 0; }

.co-done { text-align:center; padding:20px 0; }
.co-ok { width:72px; height:72px; border-radius:50%; display:grid; place-items:center; margin:0 auto 16px; background:#e8f4ee; color:#0f6b3a; box-shadow:0 0 0 10px #f3faf6; }
.co-done p { color:var(--ink-soft); max-width:46ch; margin:0 auto; line-height:1.85; }
/* نتيجةُ الدفع (‎/pay/result) */
.co-result { max-width:620px; margin:0 auto; padding:34px 26px; }
.co-ok.co-fail { background:#fdecec; color:#b42318; box-shadow:0 0 0 10px #fef5f5; }
.co-result-items { list-style:none; margin:18px auto 0; padding:12px 16px; max-width:440px; border:1px solid var(--line, #e3ddce); border-radius:14px; text-align:start; }
.co-result-items li { display:flex; justify-content:space-between; gap:12px; padding:7px 0; border-bottom:1px dashed var(--line, #e3ddce); font-size:14px; }
.co-result-items li:last-child { border-bottom:0; }
.co-result-items li.tot { font-weight:800; }
.co-result .co-nav { flex-wrap:wrap; gap:10px; margin-top:22px; }
.co-order { display:inline-flex; gap:10px; align-items:center; margin:18px 0 6px; padding:10px 18px; border:1.5px dashed var(--brand-200); border-radius:12px; }
.co-order span { color:var(--muted); font-size:13.5px; }
.co-order b { font-size:20px; color:var(--brand-900); direction:ltr; }

/* إشعار الإضافة */
.cart-toast { position:fixed; z-index:120; bottom:calc(24px + env(safe-area-inset-bottom,0px)); left:50%; transform:translateX(-50%); display:flex; gap:16px; align-items:center; background:var(--brand-900); color:#ffffff; padding:13px 20px; border-radius:999px; box-shadow:var(--shadow-lg); font-size:14.5px; animation:cartIn .28s ease; transition:opacity .4s, transform .4s; }
.cart-toast a { color:var(--gold-200); font-weight:700; }
.cart-toast.out { opacity:0; transform:translate(-50%,12px); }
@keyframes cartIn { from { opacity:0; transform:translate(-50%,14px); } }

/* ── الجوّال ──────────────────────────────────────────────────────────────── */
@media (max-width:960px) {
  .pdp-grid { grid-template-columns:minmax(0,1fr); gap:24px; }
  .pdp-media { order:-1; }          /* الصورةُ أوّلًا على الجوّال */
  .pdp-more { grid-template-columns:minmax(0,1fr); margin-top:32px; }
  .pdp-rel { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .co-grid { grid-template-columns:minmax(0,1fr); }
  .co-sum { position:static; }
}
@media (max-width:620px) {
  .pdp { padding:14px 0 110px; }
  .pdp-media figure { border-radius:18px; margin-inline:-8px; }
  .pdp-actions { flex-direction:column; }
  .pdp-meta { grid-template-columns:minmax(0,1fr); }
  .pdp-rel { grid-template-columns:minmax(0,1fr); }
  .pdp-card { padding:20px; }
  .pdp-sticky { display:flex; align-items:center; justify-content:space-between; gap:12px; position:fixed; z-index:70; inset-inline:0; bottom:0;
    padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px)); background:rgba(255, 255, 255,.94); backdrop-filter:saturate(180%) blur(14px);
    border-top:1px solid var(--line); box-shadow:0 -8px 24px rgba(0, 12, 36,.08); }
  .pdp-sticky > span { font-size:20px; font-weight:900; color:var(--brand-900); }
  .pdp-sticky .btn { flex:1; max-width:220px; padding:13px; }
  .co { padding:18px 0 70px; }
  .co-card { padding:18px; }
  .co-steps span { font-size:11.5px; }
  .co-fields { grid-template-columns:1fr; }
  .co-item { grid-template-columns:72px minmax(0,1fr); }
  .co-item img { width:72px; height:58px; }
  .co-rm { grid-column:1 / -1; justify-self:start; }
  .co-nav { flex-direction:column-reverse; }
  .co-nav .btn { width:100%; }
  /* الأزرار العائمة (واتساب/المساعد/الدعم) تعلو شريطَ السعر اللاصق */
  body:has(.pdp-sticky):not(.ed-on) { --fab-b:calc(84px + env(safe-area-inset-bottom,0px)); }
}

/* وضع التعديل: صفحة المنتج تُحرَّر كما تُرى */
.ed-on .pdp-details:empty::before { content:"اضغط هنا وأضف وصفًا تفصيليًّا للبرنامج…"; color:var(--muted); }
.ed-on .pdp-sticky { display:none; }
/* the payment-step list has room for larger marks */
.co-method .pm.has-logo img { height:17px; }
.co-method .pm-applepay.has-logo img, .co-method .pm-mada.has-logo img { height:20px; }
.co-method .pm-tamara.has-logo img { height:30px; }

/* cart: who is checking out (signed in) / how sign-in works (guest) */
.co-aside { display:grid; gap:12px; align-content:start; position:sticky; top:100px; }
.co-aside .co-sum { position:static; }
.co-who { display:flex; align-items:center; gap:12px; margin:0; padding:12px 14px; border-radius:14px; background:#ffffff; border:1px solid var(--line); font-size:13.5px; color:var(--ink-soft); line-height:1.6; }
.co-who b { color:var(--brand-900); }
.co-who small { display:block; color:var(--muted); font-size:12.5px; text-align:right; }
.co-who.guest { background:var(--brand-50); border-color:var(--brand-100); }
.co-who.guest svg { flex:none; color:var(--brand-600); }
.co-who a { color:var(--brand-700); font-weight:800; text-decoration:underline; text-underline-offset:3px; }
.co-who .nav-acct-av { flex:none; }
.co-fields input[readonly] { background:var(--paper-soft); color:var(--brand-900); font-weight:700; cursor:default; }
.co-verified { font-style:normal; font-size:11.5px; font-weight:800; color:#0f6b3a; background:#e8f4ee; padding:2px 8px; border-radius:999px; margin-inline-start:6px; }
@media (max-width:960px) { .co-aside { position:static; } }
