/* بريق المشاهير: الاستلام من الفرع (الرئيسية) — خريطة قوقل تعرض التقييم تلقائياً */ (function () { var EMBED = 'https://www.google.com/maps?cid=5373509735266818252&hl=ar&output=embed'; var MAPS = 'https://maps.google.com/?cid=5373509735266818252'; function isHome() { var p = location.pathname.replace(/\/+$/, ''); return p === '' || p === '/ar' || p === '/en'; } function build() { if (document.getElementById('bq-branch')) return; var s = document.createElement('section'); s.id = 'bq-branch'; s.setAttribute('dir', 'rtl'); s.innerHTML = '' + '

استلم طلبك من فرعنا بالرياض

' + '

اطلب أونلاين واستلم من الفرع

' + '📍 فرع طويق - شارع أحمد بن الخطاب' + ''; var blocks = document.querySelectorAll('section.s-block'); var last = blocks.length ? blocks[blocks.length - 1] : null; if (last && last.parentNode) last.parentNode.insertBefore(s, last.nextSibling); else { var f = document.querySelector('footer'); if (f && f.parentNode) f.parentNode.insertBefore(s, f); } } function run() { if (isHome()) build(); } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run(); })(); /* بريق المشاهير: قسم «تسوّق حسب القسم» (مربعات) + نقل المميزات تحته — الرئيسية فقط */ (function () { var IMG = 'https://cdn.files.salla.network/homepage/446612444/'; var CATS = [ ['الأثواب', '/اثواب-رجالية/c461348321', 'https://cdn.salla.sa/EZBzmB/TbVgPtwMu4JJK746ctfi5VwPAamBSoEmPYb9wRJD.jpg'], ['الأشمغة والغتر', '/اشمغة-وغتر-رجالية/c385264882', 'https://cdn.salla.sa/EZBzmB/ocYS7zViqKtddqEHN2ipQrdSQUpvRf1QLj0MUlkr.jpg'], ['البشوت', '/بشت/c1865663188', 'https://cdn.salla.sa/EZBzmB/VIMSYVJNfYbK8TKaxOUXoM26l9eKj4v1cZQdanCh.jpg'], ['العقال', '/عقال/c957931989', 'https://cdn.salla.sa/EZBzmB/pOmuAU2s5do2hXzTKrPccaU1Jl1DUdSVSBN5CJez.jpg'], ['الطواقي', '/طواقي/c492217291', 'https://cdn.salla.sa/EZBzmB/WdOuqcOUQ3N9swRFvslQghC62eSGye1YWsm59IR0.jpg'], ['الإكسسوارات', '/الإكسسوارات/c1442392015', 'https://cdn.salla.sa/EZBzmB/LJvcAm1kFeaNMscuFt2vDzC7NP40XuR1HlJO0Ynl.jpg'], ['ملابس داخلية', '/ملابس-داخلية-رجالية/c1725595073', 'https://cdn.salla.sa/EZBzmB/zb6LxcnqPtpINK1JEKCiRavuJAFyLokcxkQd4MAg.jpg'], ['الجوارب', '/جوارب/c1133085898', 'https://cdn.salla.sa/EZBzmB/lGpp6ttbBkDy7mizevhXdKPgtufjXytIa3uIQOJu.jpg'] ]; function isHome() { var p = location.pathname.replace(/\/+$/, ''); return p === '' || p === '/ar' || p === '/en'; } function build() { if (document.getElementById('bq-cats')) return true; var hero = document.querySelector('.s-block--hero-slider'); if (!hero) return false; var s = document.createElement('section'); s.id = 'bq-cats'; s.setAttribute('dir', 'rtl'); var html = '

تسوّق حسب القسم

'; CATS.forEach(function (c) { html += '' + c[0] + '' + c[0] + ''; }); s.innerHTML = html + '
'; hero.parentNode.insertBefore(s, hero.nextSibling); var feat = document.querySelector('.s-block--features'); /* المزايا تُنقل تحت الأكثر مبيعاً (bq-pk-slider) */ return true; } function run() { if (!isHome()) return; if (build()) return; var n = 0, t = setInterval(function () { if (build() || ++n > 40) clearInterval(t); }, 150); } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run(); })(); /* بريق المشاهير: شارة نسبة الخصم على بطاقات المنتجات (تُحسب من السعرين الحقيقيين) */ (function () { var AR = '٠١٢٣٤٥٦٧٨٩'; function num(el) { var t = (el && el.textContent || '').replace(/[٠-٩]/g, function (d) { return AR.indexOf(d); }); return parseFloat(t.replace(/[^\d.]/g, '')); } function apply() { document.querySelectorAll('.s-product-card-entry').forEach(function (c) { if (c.querySelector('.bq-off-badge')) return; var before = c.querySelector('.s-product-card-price-before'); var price = c.querySelector('.s-product-card-price'); var img = c.querySelector('.s-product-card-image'); if (!before || !price || !img) return; var o = num(before), s = num(price); if (!(o > s && s > 0)) return; var pct = Math.round((1 - s / o) * 100); if (pct < 5) return; var b = document.createElement('span'); b.className = 'bq-off-badge'; b.innerHTML = 'خصم ' + pct + '%'; img.appendChild(b); }); } var t; function schedule() { clearTimeout(t); t = setTimeout(apply, 300); } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', schedule); else schedule(); new MutationObserver(schedule).observe(document.documentElement, { childList: true, subtree: true }); })(); /* الدفع عند الاستلام: شرط تأكيد الاستلام عبر واتساب (صفحة الشكر) */ (function () { var WA = '966590017621'; if (location.pathname.indexOf('/thankyou') !== 0) return; function build() { if (document.getElementById('bq-cod')) return true; var txt = document.body.innerText || ''; if (txt.indexOf('الدفع عند الاستلام') === -1) return false; var m = txt.match(/#\s?(\d{5,})/) || txt.match(/رقم الطلب\D{0,10}(\d{5,})/); var order = m ? m[1] : ''; var box = document.createElement('div'); box.id = 'bq-cod'; box.setAttribute('dir', 'rtl'); box.style.cssText = 'max-width:640px;margin:16px auto;padding:18px;border:2px solid #23305f;border-radius:14px;background:#fff8e6;text-align:center;font-family:inherit'; var days = [], names = ['اليوم', 'غداً', 'بعد غد'], i; for (i = 0; i < 3; i++) days.push(names[i]); var slots = ['صباحاً (9 - 12)', 'ظهراً (12 - 4)', 'مساءً (4 - 9)']; var selDay = days[0], selSlot = slots[0]; box.innerHTML = '
⚠️ خطوة أساسية لتأكيد طلبك
' + '
طلبك بالدفع عند الاستلام لن يُجهَّز ولن يُوصَّل حتى تؤكد استلامه برسالة واتساب. اختر الوقت المناسب لك ثم اضغط الزر.
' + '
' + 'أرسل رسالة التأكيد عبر واتساب'; function chips(id, arr, cur, set) { var c = box.querySelector(id); c.innerHTML = ''; arr.forEach(function (t) { var b = document.createElement('button'); b.type = 'button'; b.textContent = t; b.style.cssText = 'margin:3px;padding:8px 14px;border-radius:20px;border:1.5px solid #23305f;font-weight:700;cursor:pointer;background:' + (t === cur ? '#23305f' : '#fff') + ';color:' + (t === cur ? '#fff' : '#23305f'); b.onclick = function () { set(t); refresh(); }; c.appendChild(b); }); } function refresh() { chips('#bq-cod-days', days, selDay, function (t) { selDay = t; }); chips('#bq-cod-slots', slots, selSlot, function (t) { selSlot = t; }); var msg = 'السلام عليكم، أؤكد أني سأستلم طلبي من بريق المشاهير' + (order ? ' رقم ' + order : '') + ' (الدفع عند الاستلام). الوقت المناسب لي: ' + selDay + ' ' + selSlot + '.'; box.querySelector('#bq-cod-go').href = 'https://wa.me/' + WA + '?text=' + encodeURIComponent(msg); } refresh(); var host = document.querySelector('main') || document.querySelector('#app') || document.body; host.insertBefore(box, host.firstChild); return true; } var n = 0, t = setInterval(function () { if (build() || ++n > 40) clearInterval(t); }, 500); })(); /* باكجات مميزة في الرئيسية (قبل الأقسام) */ (function () { var IDS = [1997572972, 1090366061, 1822943343]; function isHome() { var p = location.pathname.replace(/\/+$/, ''); return p === '' || p === '/ar' || p === '/en'; } function put() { if (document.getElementById('bq-bundles')) return true; var anchor = document.getElementById('bq-cats'); if (!anchor) return false; var s = document.createElement('section'); s.id = 'bq-bundles'; s.setAttribute('dir', 'rtl'); s.style.cssText = 'max-width:1200px;margin:28px auto;padding:0 16px'; /* bq-cls-fix 2026-10-18: حجز مساحة الباكجات عشان الصفحة ما تتحرك */ if (!document.getElementById('bq-b-css')) { var st = document.createElement('style'); st.id = 'bq-b-css'; st.textContent = '#bq-bundles{min-height:430px}@media(max-width:1023px){#bq-bundles{min-height:360px}}@media(max-width:768px){#bq-bundles{min-height:calc(350px + 98vw)}}'; document.head.appendChild(st); } s.innerHTML = '

باكجات مميزة

قطع مختارة بسعر واحد والشحن مجاني

'; anchor.parentNode.insertBefore(s, anchor); return true; } function run() { if (!isHome()) return; if (put()) return; var n = 0, t = setInterval(function () { if (put() || ++n > 60) clearInterval(t); }, 100); } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run(); })(); ; /* بريق المشاهير: إخفاء الباكجات من قسم «عروض وتخفيضات» لأنها ظاهرة في قسمها (bq-hide-bundles) */ (function () { var RE = /\/p(1997572972|1090366061|1822943343)(\/|\?|$)/ function clean() { var slides = document.querySelectorAll('.angel-products .swiper-slide') slides.forEach(function (sl) { var a = sl.querySelector('a[href]') var hit = false sl.querySelectorAll('a[href]').forEach(function (x) { if (RE.test(x.getAttribute('href'))) hit = true }) if (hit) { var sw = sl.closest('.swiper') sl.remove() if (sw && sw.swiper) { sw.swiper.update() } } }) } var n = 0 var t = setInterval(function () { clean(); if (++n > 40) clearInterval(t) }, 500) })() ; /* بريق المشاهير: عند اختيار خيار (لون...) تنتقل المعرض لصورة نفس الخيار تلقائياً (bq-option-gallery) */ (function () { function norm(s) { return String(s || '').replace(/[أإآ]/g, 'ا').replace(/\s+/g, ' ').trim() } function go(label) { var key = norm(label) if (!key) return var sl = document.querySelector('salla-slider.details-slider') if (!sl) return var host = [sl].concat([].slice.call(sl.querySelectorAll('*'))).filter(function (e) { return e.swiper })[0] if (!host) return var slides = host.swiper.slides for (var i = 0; i < slides.length; i++) { var im = slides[i].querySelector('img') if (im && norm(im.getAttribute('alt')).indexOf(key) > -1) { host.swiper.slideTo(i); return } } } document.addEventListener('change', function (e) { var t = e.target if (!t || t.type !== 'radio' || !/^options\[/.test(t.name || '')) return var l = t.id && document.querySelector('label[for="' + t.id + '"]') go(l ? l.innerText : (t.closest('label') || t.parentElement || {}).innerText) }, true) })() ; /* بريق المشاهير: ربط كل لون بصورته في منتجات الألوان (bq-option-map) */ (function () { var MAP = {"532973322":{"احمر غامق":0,"احمر فاتح":1},"118051132":{"اسود":0,"ازرق":1,"فضي":2,"ابيض":3,"ذهبي":4},"1916472757":{"ازرق":1,"ذهبي":2,"اسود":0,"فضي":3,"ابيض":4},"1359294564":{"اسود":1,"ازرق":0,"ذهبي":2,"ابيض":3,"رمادي فاتخ":4},"1830363221":{"اسود":0,"ابيض":1,"بني غامق":2,"بني فاتح":3,"بيج غامق":4},"1780496624":{"بيج":3,"زيتي غامق":2,"اسود":0,"بني":1,"اسود ابيض":4,"ابيض ورصاصي":5},"1168944651":{"ابيض":1,"كحلي":2,"رصاصي":3},"1234335004":{"فضي ذهبي":5,"فضي اسود":1,"فضي ازرق":2,"فضي":3,"فضي ابيض":4,"اسود كامل":0},"2118296604":{"ازرق":2,"اسود":3,"الاسود المترج":4,"بني":5,"زيتي":6,"مراه بلوري":7},"619409724":{"اسود معا ذهبي":0,"فضي معا ذهبي":1,"اسود معا بنزوي":2,"اسود ذهبي فضي":3,"اسود وفضي":4,"اسود رمادي":5,"كحلي":6,"فضي":7,"اسود فضي":8,"فضي اخظر":9},"1773880295":{"كحلي":2,"اسود":1,"رمادي":0},"1796567170":{"وردي":1,"احمر":2,"الازرق الفيروزي":3,"بني":4,"كحلي":0,"بيج فاتح":5,"رصاصي":6,"الازرق السماوي":7},"760959186":{"كحلي":0,"بني":1,"اخضر غامق":2},"424825628":{"رمادي":0,"كحلي":1,"اسود":2}} function norm(s) { return String(s || '').replace(/[أإآ]/g, 'ا').replace(/\s+/g, ' ').trim() } document.addEventListener('change', function (e) { var t = e.target if (!t || t.type !== 'radio' || !/^options\[/.test(t.name || '')) return var sl = document.querySelector('salla-slider.details-slider') if (!sl) return var pid = (sl.id || '').replace('details-slider-', '') var m = MAP[pid] if (!m) return var lb = t.closest('label') || t.parentElement var i = m[norm(lb ? lb.innerText : '')] if (i === undefined) return var host = [sl].concat([].slice.call(sl.querySelectorAll('*'))).filter(function (x) { return x.swiper })[0] if (host) host.swiper.slideTo(i) }, true) })(); ;/* bq-pk-slider: سلايدر الباكجات تحت الأقسام (سطح مكتب + جوال) + نقل المزايا تحت الأكثر مبيعاً + توسيط الباكج الثالث */ (function () { var C = 'https://cdn.files.salla.network/homepage/446612444/'; var D = [ [C + '83968eb4-9391-479e-927a-02c5354b66dd-original.webp', C + '64f00b22-cadf-467e-bccf-33a2590d1ea9-original.webp', 'https://bareeqmen.com/x/p1997572972', 'باكج تاج الهيبة'], [C + '1cc428b4-a097-40f5-b73e-9e37c0b40111-original.webp', C + 'bcc84427-aec6-4d75-b984-fe30b60d8c65-original.webp', 'https://bareeqmen.com/x/p1090366061', 'باكج كشخة الشهر'], [C + '33df2c25-8a00-4c88-908e-acf8d4e484db-original.webp', C + 'e517d005-9ff2-4938-a490-2f268c1f63ea-original.webp', 'https://bareeqmen.com/x/p1822943343', 'باكج طلة المعرس'] ]; function isHome() { var p = location.pathname.replace(/\/+$/, ''); return p === '' || p === '/ar' || p === '/en'; } function css() { if (document.getElementById('bq-pk-css')) return; var st = document.createElement('style'); st.id = 'bq-pk-css'; st.textContent = '#bq-pk{margin:26px 0 8px}#bq-pk .bqp-box{position:relative;border-radius:20px;overflow:hidden;box-shadow:0 14px 34px rgba(29,42,91,.16);aspect-ratio:2.4/1;background:#efe8dd}#bq-pk .bqp-s{position:absolute;inset:0;opacity:0;visibility:hidden;transition:opacity .7s ease}#bq-pk .bqp-s.on{opacity:1;visibility:visible}#bq-pk .bqp-s a,#bq-pk .bqp-s picture,#bq-pk .bqp-s img{display:block;width:100%;height:100%}#bq-pk .bqp-s img{object-fit:cover}#bq-pk .bqp-dots{position:absolute;left:0;right:0;bottom:12px;display:flex;justify-content:center;gap:8px;z-index:3}#bq-pk .bqp-dots button{width:9px;height:9px;border-radius:99px;border:0;padding:0;background:rgba(255,255,255,.65);cursor:pointer;transition:all .3s}#bq-pk .bqp-dots button.on{width:26px;background:#fff}@media(max-width:768px){#bq-pk .bqp-box{aspect-ratio:3/4;border-radius:18px}#bq-pk .bqp-dots{bottom:auto;top:12px}.bq-bgrid{display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:12px!important}.bq-bgrid>*{flex:0 0 calc(50% - 6px)!important;max-width:calc(50% - 6px)!important;width:calc(50% - 6px)!important}}'; document.head.appendChild(st); } function moveFeatures() { var feat = document.querySelector('.s-block--features'); if (!feat) return; var blocks = document.querySelectorAll('.s-block'), best = null; for (var i = 0; i < blocks.length; i++) { var b = blocks[i]; if (b === feat || b.contains(feat)) continue; var h = b.querySelector('h1,h2,h3,.s-block__title,.section-title'); if (h && h.textContent.replace(/\s+/g, ' ').indexOf('الأكثر مبيعاً') > -1) { best = b; break; } } if (best && best.nextElementSibling !== feat) best.parentNode.insertBefore(feat, best.nextSibling); } function centerBundles() { var root = document.getElementById('bq-bundles'); if (!root) return; var card = root.querySelector('.s-product-card-entry, custom-salla-product-card, salla-product-card'); if (!card) return; var el = card.parentElement, n = 0; while (el && el !== root && n++ < 6) { if (el.children.length >= 3) { el.classList.add('bq-bgrid'); return; } el = el.parentElement; } } function build() { var cats = document.getElementById('bq-cats'); if (!cats) return false; if (document.getElementById('bq-pk')) return true; css(); var s = document.createElement('section'); s.id = 'bq-pk'; var slides = D.map(function (d, i) { return '
' + d[3] + '
'; }).join(''); var dots = D.map(function (d, i) { return ''; }).join(''); s.innerHTML = '
' + slides + '
' + dots + '
'; cats.parentNode.insertBefore(s, cats.nextSibling); var sl = s.querySelectorAll('.bqp-s'), dt = s.querySelectorAll('.bqp-dots button'), cur = 0, tm; function go(n) { sl[cur].classList.remove('on'); dt[cur].classList.remove('on'); cur = (n + sl.length) % sl.length; sl[cur].classList.add('on'); dt[cur].classList.add('on'); } function mk(cls, label, d) { var b = document.createElement('button'); b.type = 'button'; b.className = 'bqp-arw ' + cls; b.setAttribute('aria-label', label); b.innerHTML = d > 0 ? '‹' : '›'; b.addEventListener('click', function (e) { e.preventDefault(); e.stopPropagation(); go(cur + d); }); s.querySelector('.bqp-box').appendChild(b); } function arrows() { if (!document.getElementById('bq-pk-arw')) { var st = document.createElement('style'); st.id = 'bq-pk-arw'; st.textContent = '#bq-pk .bqp-arw{position:absolute;top:50%;transform:translateY(-50%);z-index:5;width:42px;height:42px;border-radius:50%;border:1px solid rgba(255,255,255,.55);background:rgba(20,20,30,.45);color:#fff;font-size:28px;line-height:38px;padding:0;cursor:pointer;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}#bq-pk .bqp-arw.nx{left:12px}#bq-pk .bqp-arw.pv{right:12px}@media(max-width:768px){#bq-pk .bqp-arw{width:34px;height:34px;font-size:24px;line-height:30px}#bq-pk .bqp-arw.nx{left:8px}#bq-pk .bqp-arw.pv{right:8px}}'; document.head.appendChild(st); } mk('nx', 'التالي', 1); mk('pv', 'السابق', -1); } function swipe() { var bx = s.querySelector('.bqp-box'), x0 = null; bx.addEventListener('touchstart', function (e) { x0 = e.touches[0].clientX; }, { passive: true }); bx.addEventListener('touchend', function (e) { if (x0 === null) return; var dx = e.changedTouches[0].clientX - x0; x0 = null; if (Math.abs(dx) > 40) go(cur + (dx < 0 ? 1 : -1)); }, { passive: true }); } for (var i = 0; i < dt.length; i++) (function (k) { dt[k].addEventListener('click', function () { go(k); }); })(i); arrows(); swipe(); return true; } function rdy() { if (document.getElementById('bq-pk') && document.getElementById('bq-bundles')) document.documentElement.classList.add('bq-ready'); } function run() { if (!isHome()) return; css(); build(); moveFeatures(); rdy(); var n = 0, t = setInterval(function () { build(); moveFeatures(); centerBundles(); rdy(); if (++n > 80) clearInterval(t); }, 250); } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run(); })(); /* bq-quickadd-fix 2026-10-17: منتجات لها مقاسات في بطاقات بدون خيارات -> تفتح صفحة المنتج بدل الإضافة بدون مقاس */ (function(){ document.addEventListener('click', function(e){ var b = e.target.closest && e.target.closest('salla-add-product-button'); if(!b) return; var c = b.closest('custom-salla-product-card, salla-product-card'); if(!c || !c.product || !c.product.has_options || !c.product.url) return; if(c.querySelector('salla-product-options, [class*=product-options]')) return; e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); window.location.href = c.product.url; }, true); })();