/* بطاقة المنتج + الإشعارات السفلية */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.pcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s, transform .15s; }
.pcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pimg { position: relative; display: block; aspect-ratio: var(--img-ar); border-radius: var(--img-r); overflow: hidden; background: #eee; }
.pimg img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.pcard:hover .pimg img { transform: scale(1.04); }
.pbs { position: absolute; top: 8px; inset-inline-start: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pb { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); line-height: 1.5; }
.pb.out { background: #b91c1c; color: #fff; }
.pb.new { background: #0ea5e9; color: #fff; }
.pb.best { background: #7c3aed; color: #fff; }
.pwish { position: absolute; top: 18px; inset-inline-end: 18px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.94); display: grid; place-items: center; color: #6b7785; box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: transform .15s, color .15s; }
.pwish:hover { transform: scale(1.1); color: #e11d48; }
.pwish.on { color: #e11d48; }
.pwish.on svg { fill: currentColor; }
.pbody { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pbrand { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.pname { font-weight: 600; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pname:hover { color: var(--primary-ink, var(--primary)); }
.pprice b { color: var(--primary-ink, var(--primary)); font-size: 18px; font-weight: 800; }
.pprice s { color: var(--muted); font-size: 13px; margin-inline-start: 8px; }
.pst { font-size: 12px; color: var(--muted); }
.pst.low { color: #c2410c; font-weight: 700; }
.pst.out { color: #b91c1c; font-weight: 700; }
.pbtn { margin-top: auto; width: 100%; }
.pcard.is-out .pimg img { filter: grayscale(.85); opacity: .7; }

.toast-root { position: fixed; inset-block-end: 92px; inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 120; padding-inline: 14px; }
.toast { pointer-events: auto; background: #101820; color: #fff; padding: 11px 20px; border-radius: 999px; display: flex; gap: 16px; align-items: center; box-shadow: 0 8px 28px rgba(0,0,0,.3); font-size: 14px; font-weight: 600; animation: toast-in .25s ease; }
.toast a { color: var(--accent); font-weight: 800; white-space: nowrap; }
.toast.warn { background: #9a3412; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .pgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pcard { padding: 8px; }
  .pprice b { font-size: 16px; }
}

/* ---------- صف المنتجات الأفقي (الرئيسية) ---------- */
.rail-wrap { position: relative; }
.rail { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 4px 2px 10px; }
.rail::-webkit-scrollbar { display: none; }
.rail .pcard { flex: 0 0 clamp(185px, 18vw, 235px); scroll-snap-align: start; }
.rail-btn { position: absolute; top: 38%; z-index: 3; width: 42px; height: 42px; border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: 0 3px 14px rgba(0,0,0,.22); display: grid; place-items: center; transition: transform .15s; }
.rail-btn:hover { transform: scale(1.08); background: var(--primary); color: var(--on-primary); }
.rail-prev { inset-inline-start: -14px; }
.rail-next { inset-inline-end: -14px; }
[dir=ltr] .rail-prev .ic { transform: rotate(90deg); }
[dir=ltr] .rail-next .ic { transform: rotate(-90deg); }
[dir=rtl] .rail-prev .ic { transform: rotate(-90deg); }
[dir=rtl] .rail-next .ic { transform: rotate(90deg); }
@media (max-width: 900px) { .rail-btn { display: none; } }
@media (max-width: 560px) { .rail { gap: 10px; } .rail .pcard { flex: 0 0 44vw; } }

/* شعار الماركة */
.pbrand { display: flex; align-items: center; gap: 6px; }
.blogo { width: 20px; height: 20px; border-radius: 6px; object-fit: cover; flex: none; }
.pp-brand .blogo { width: 26px; height: 26px; border-radius: 7px; vertical-align: middle; margin-inline-end: 6px; }
.pp-brand { display: inline-flex; align-items: center; }

/* بطاقة المنتج: فراغات أقل */
.pcard { gap: 6px; }
.pname { min-height: 0; }
.pbody { gap: 4px; }
