/* ==========================================================
   🛒 متجر BEYOND RP — يعتمد على متغيرات style.css (ثيم الموقع)
   ========================================================== */
:root {
    --st-radius: 18px;
    --st-surface: rgba(255, 255, 255, 0.03);
    --st-surface-2: rgba(255, 255, 255, 0.055);
    --st-line: rgba(255, 255, 255, 0.08);
    --st-line-strong: rgba(255, 255, 255, 0.22);
    --st-muted: #9ca3af;
    --st-faint: #6b7280;
    --st-ok: #22c55e;
    --st-danger: #f87171;
    --st-ease: cubic-bezier(.2, .8, .2, 1);
}

.st-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px) 4rem; }

/* مسار التنقل */
.st-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .85rem; color: var(--st-faint); margin: 2rem 0 1.5rem; }
.st-crumbs a { color: var(--st-muted); text-decoration: none; transition: color .2s; }
.st-crumbs a:hover { color: #fff; }
.st-crumbs i { font-size: .6rem; opacity: .6; }
.st-crumbs span:last-child { color: #fff; }

/* شريط الأقسام */
.st-cats { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 10px; margin-bottom: 1.25rem; -webkit-mask-image: linear-gradient(to left, #000 92%, transparent); mask-image: linear-gradient(to left, #000 92%, transparent); }
.st-cats::-webkit-scrollbar { display: none; }
.st-cat {
    flex: 0 0 auto; background: var(--st-surface); border: 1px solid var(--st-line); color: var(--st-muted);
    padding: .55rem 1.15rem; border-radius: 999px; font: 700 .88rem 'Tajawal', sans-serif; cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
}
.st-cat:hover { color: #fff; border-color: var(--st-line-strong); }
.st-cat[aria-pressed="true"] { background: #fff; color: #0a0a0a; border-color: #fff; }
.st-cat small { opacity: .55; margin-inline-start: .35rem; }

/* شريط الأدوات */
.st-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.st-count { font-weight: 900; font-size: 1.05rem; }
.st-count span { color: var(--st-muted); font-weight: 500; font-size: .9rem; }
.st-tools { display: flex; gap: .65rem; flex-wrap: wrap; }
.st-field { position: relative; }
.st-field i { position: absolute; inset-inline-start: .95rem; top: 50%; transform: translateY(-50%); color: var(--st-faint); font-size: .8rem; pointer-events: none; }
.st-input, .st-select {
    background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 12px; color: #fff;
    font: 500 .9rem 'Tajawal', sans-serif; padding: .7rem 2.4rem .7rem 1rem; outline: none; transition: border-color .2s;
    min-width: 200px;
}
.st-select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline: 1rem 2.4rem; }
.st-select + i { inset-inline-start: auto; inset-inline-end: .95rem; }
.st-input:focus, .st-select:focus { border-color: rgba(255,255,255,.45); }
.st-input::placeholder { color: var(--st-faint); }
.st-select option { background: #0e0f14; color: #fff; }

/* الشبكة والكروت */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.st-card {
    position: relative; display: flex; flex-direction: column; gap: .9rem; padding: 14px;
    background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-radius);
    transition: transform .3s var(--st-ease), border-color .3s, box-shadow .3s; cursor: pointer;
    animation: st-in .45s var(--st-ease) both;
}
.st-card:hover { transform: translateY(-4px); border-color: var(--st-line-strong); box-shadow: 0 20px 45px rgba(0,0,0,.5); }
.st-card:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@keyframes st-in { from { opacity: 0; transform: translateY(10px); } }
.st-media { position: relative; aspect-ratio: 1 / 1; border-radius: 13px; overflow: hidden; background: #0b0c11; }
.st-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--st-ease); }
.st-card:hover .st-media img { transform: scale(1.06); }
.st-ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.12); font-size: 2.6rem; }
.st-badge { position: absolute; top: 10px; inset-inline-start: 10px; font-size: .72rem; font-weight: 800; padding: .28rem .65rem; border-radius: 999px; background: #fff; color: #0a0a0a; }
.st-badge.feat { inset-inline-start: auto; inset-inline-end: 10px; background: rgba(10,10,14,.72); color: #fff; border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.st-name { font-size: 1.08rem; font-weight: 800; line-height: 1.45; color: #fff; margin: 0; min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-price { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; }
.st-price b { font-size: 1.25rem; font-weight: 900; color: #fff; }
.st-price b small { font-size: .78rem; font-weight: 700; color: var(--st-muted); margin-inline-start: .2rem; }
.st-price s { color: var(--st-faint); font-size: .85rem; }
.st-actions { display: flex; align-items: center; gap: .6rem; margin-top: auto; }

.st-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border-radius: 12px;
    font: 800 .92rem 'Tajawal', sans-serif; padding: .75rem 1.2rem; cursor: pointer; text-decoration: none;
    border: 1px solid transparent; transition: transform .2s var(--st-ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
    white-space: nowrap;
}
.st-btn:active { transform: scale(.98); }
.st-btn:disabled, .st-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.st-btn-primary { background: linear-gradient(135deg, #ffffff, #e5e7eb); color: #0a0a0a; box-shadow: 0 6px 22px rgba(255,255,255,.16); }
.st-btn-primary:hover { box-shadow: 0 10px 30px rgba(255,255,255,.28); transform: translateY(-1px); }
.st-btn-ghost { background: transparent; color: #fff; border-color: var(--st-line-strong); }
.st-btn-ghost:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.4); }
.st-btn-block { flex: 1; }
.st-icon-btn {
    width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 12px;
    background: transparent; border: 1px solid var(--st-line); color: var(--st-muted); cursor: pointer; transition: all .2s;
}
.st-icon-btn:hover { color: #fff; border-color: var(--st-line-strong); }
.st-icon-btn.is-on { color: #ff4d6d; border-color: rgba(255,77,109,.4); }

/* هياكل التحميل والحالات */
.st-sk { background: linear-gradient(100deg, rgba(255,255,255,.035) 30%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.035) 70%); background-size: 200% 100%; animation: st-sk 1.3s linear infinite; border-radius: 10px; }
@keyframes st-sk { to { background-position: -200% 0; } }
.st-state { text-align: center; padding: 4rem 1rem; color: var(--st-muted); border: 1px dashed var(--st-line); border-radius: var(--st-radius); background: rgba(255,255,255,.015); }
.st-state i { font-size: 2.4rem; color: rgba(255,255,255,.3); display: block; margin-bottom: 1rem; }
.st-state h3 { color: #fff; margin-bottom: .45rem; }
.st-state .st-btn { margin-top: 1.2rem; }

/* ======================= صفحة المنتج ======================= */
.pd { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); align-items: start; }
.pd-gallery { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; position: sticky; top: 100px; }
.pd-thumbs { display: flex; flex-direction: column; gap: 10px; max-height: min(560px, 70vh); overflow-y: auto; scrollbar-width: none; padding: 2px; }
.pd-thumbs::-webkit-scrollbar { display: none; }
.pd-thumb { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--st-line); background: #0b0c11; padding: 0; cursor: pointer; opacity: .55; transition: opacity .2s, border-color .2s; }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-thumb:hover { opacity: .85; }
.pd-thumb[aria-current="true"] { opacity: 1; border-color: #fff; }
.pd-stage { position: relative; aspect-ratio: 16 / 10; border-radius: var(--st-radius); overflow: hidden; background: #0b0c11; border: 1px solid var(--st-line); }
.pd-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s var(--st-ease); }
.pd-stage img.is-on { opacity: 1; }
.pd-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(8,9,13,.55); border: 1px solid rgba(255,255,255,.3); color: #fff; cursor: pointer; backdrop-filter: blur(6px); transition: background .2s; z-index: 2; }
.pd-nav:hover { background: rgba(8,9,13,.85); }
.pd-nav.prev { right: 14px; }
.pd-nav.next { left: 14px; }
.pd-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.pd-dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(255,255,255,.75); background: transparent; padding: 0; cursor: pointer; transition: all .25s; }
.pd-dot[aria-current="true"] { background: #fff; width: 22px; border-radius: 6px; }

.pd-info { display: flex; flex-direction: column; gap: 1.35rem; }
.pd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.pd-title { font-size: clamp(1.5rem, 2.4vw, 2.1rem); font-weight: 900; line-height: 1.3; margin: 0; }
.pd-cat { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--st-muted); background: rgba(255,255,255,.06); padding: .25rem .7rem; border-radius: 999px; margin-bottom: .6rem; }
.pd-head-actions { display: flex; gap: .5rem; }
.pd-price { display: flex; align-items: baseline; gap: .75rem; }
.pd-price b { font-size: 1.9rem; font-weight: 900; }
.pd-price b small { font-size: 1rem; color: var(--st-muted); margin-inline-start: .25rem; }
.pd-price s { color: var(--st-faint); }
.pd-price .st-badge { position: static; }
.pd-desc { color: #d1d5db; line-height: 1.85; font-size: .96rem; white-space: pre-line; padding: 1.25rem 1.35rem; background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 14px; max-height: 340px; overflow: auto; }
.pd-desc.is-empty { display: none; }

.pd-form { display: flex; flex-direction: column; gap: 1rem; }
.pd-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 1rem; }
.pd-row > label { font-weight: 800; font-size: .95rem; }
.pd-row > label .req { color: #ff4d6d; margin-inline-start: .2rem; }
.pd-row .st-field { width: 100%; }
.pd-row .st-select { width: 100%; min-width: 0; }
.pd-row.has-error .st-select { border-color: var(--st-danger); }
.pd-user { display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border-radius: 12px; background: var(--st-surface); border: 1px solid var(--st-line); font-weight: 700; min-height: 46px; }
.pd-user img { width: 30px; height: 30px; border-radius: 50%; }
.pd-user a { color: #fff; }
.pd-qty { display: inline-flex; align-items: center; border: 1px solid var(--st-line); border-radius: 12px; overflow: hidden; width: fit-content; }
.pd-qty button { width: 44px; height: 44px; background: transparent; border: 0; color: #fff; cursor: pointer; font-size: 1rem; transition: background .2s; }
.pd-qty button:hover { background: rgba(255,255,255,.07); }
.pd-qty button:disabled { opacity: .3; cursor: default; }
.pd-qty output { min-width: 48px; text-align: center; font-weight: 900; font-size: 1.05rem; border-inline: 1px solid var(--st-line); line-height: 44px; }
.pd-total b { font-size: 1.35rem; font-weight: 900; }

.pd-cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem; border-radius: var(--st-radius); background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid var(--st-line-strong); }
.pd-cta h3 { margin: 0 0 .2rem; font-size: 1.25rem; font-weight: 900; }
.pd-cta p { margin: 0; color: var(--st-muted); font-size: .9rem; }
.pd-cta .st-btn { padding-inline: 1.6rem; }
.pd-pay { display: flex; align-items: center; gap: .9rem; color: var(--st-faint); font-size: .82rem; flex-wrap: wrap; }
.pd-pay i { font-size: 1.55rem; color: #e5e7eb; }

/* ======================= نافذة التأكيد ======================= */
.st-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(3,4,7,.72); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.st-modal.is-open { opacity: 1; pointer-events: auto; }
.st-dialog { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: linear-gradient(180deg, #12141b, #0b0c11); border: 1px solid var(--st-line-strong); border-radius: 22px; padding: 1.5rem; box-shadow: 0 30px 80px rgba(0,0,0,.65); transform: translateY(14px) scale(.98); transition: transform .3s var(--st-ease); }
.st-modal.is-open .st-dialog { transform: none; }
.st-dialog h3 { margin: 0 0 .3rem; font-size: 1.3rem; font-weight: 900; display: flex; align-items: center; gap: .6rem; }
.st-dialog > p { color: var(--st-muted); margin: 0 0 1.2rem; font-size: .92rem; line-height: 1.7; }
.st-sum { display: flex; gap: .9rem; align-items: center; padding: .9rem; border-radius: 14px; background: var(--st-surface); border: 1px solid var(--st-line); margin-bottom: 1rem; }
.st-sum img, .st-sum .ph { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #0b0c11; flex: 0 0 64px; display: grid; place-items: center; color: rgba(255,255,255,.2); }
.st-sum b { display: block; font-size: 1rem; }
.st-sum small { color: var(--st-muted); }
.st-lines { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .92rem; }
.st-lines li { display: flex; justify-content: space-between; gap: 1rem; color: var(--st-muted); }
.st-lines li b { color: #fff; text-align: left; }
.st-lines li.total { border-top: 1px dashed var(--st-line-strong); padding-top: .7rem; margin-top: .2rem; font-size: 1.05rem; }
.st-lines li.total b { font-size: 1.25rem; font-weight: 900; }
.st-note { display: flex; gap: .65rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 12px; background: rgba(88,101,242,.1); border: 1px solid rgba(88,101,242,.3); color: #c7cdfb; font-size: .86rem; line-height: 1.7; margin-bottom: 1.2rem; }
.st-note i { margin-top: .3rem; color: #8b95ff; }
.st-dialog-actions { display: flex; gap: .65rem; }
.st-dialog-actions .st-btn { flex: 1; }
.st-status { text-align: center; padding: 1rem 0 .4rem; }
.st-status .ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; font-size: 1.8rem; border: 1px solid var(--st-line-strong); background: rgba(255,255,255,.04); }
.st-status .ic.ok { color: var(--st-ok); border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.08); }
.st-status .ic.err { color: var(--st-danger); border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.08); }
.st-status h3 { justify-content: center; }
.st-status p { color: var(--st-muted); margin: 0 0 1.25rem; line-height: 1.7; }
.st-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: #fff; animation: st-rot .8s linear infinite; }
@keyframes st-rot { to { transform: rotate(360deg); } }
.st-progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin: 0 0 1.1rem; }
.st-progress span { display: block; height: 100%; width: 0; background: #fff; transition: width linear; }

.st-toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: #fff; color: #0a0a0a; font-weight: 800; padding: .7rem 1.2rem; border-radius: 12px; opacity: 0; pointer-events: none; transition: all .3s var(--st-ease); z-index: 2100; font-size: .9rem; }
.st-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
    .pd { grid-template-columns: 1fr; }
    .pd-gallery { position: static; }
}
@media (max-width: 600px) {
    .pd-gallery { grid-template-columns: 1fr; }
    .pd-thumbs { flex-direction: row; order: 2; max-height: none; overflow-x: auto; }
    .pd-thumb { flex: 0 0 76px; }
    .pd-row { grid-template-columns: 1fr; gap: .45rem; }
    .pd-cta { flex-direction: column; align-items: stretch; text-align: center; }
    .st-toolbar, .st-tools { flex-direction: column; align-items: stretch; }
    .st-input, .st-select { width: 100%; min-width: 0; }
    .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-card { padding: 10px; gap: .7rem; }
    .st-name { font-size: .95rem; }
    .st-actions .st-btn span { display: none; }
}
/* شاشات 2K/4K — نكبّر المقاسات بدل ما تصير الصفحة صغيرة بالنص */
@media (min-width: 2200px) {
    .st-wrap { max-width: 1680px; }
    html { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .st-card, .st-media img, .pd-stage img, .st-dialog, .st-modal { transition: none; animation: none; }
}
