أفضل 3 ترشيحات لك من أرض الجوال:
| المقارنة | '+selected.map(function(p){return ''+esc(p.brand)+' | '}).join('')+'
|---|
جاوبني بسرعة وأرشّح لك الأنسب من منتجاتنا الحقيقية.
اختر ملحقات متوافقة مع جهاز الآيفون، ثم أضفها للسلة بضغطة واحدة. أضف الآيفون من زر السلة بعد اختيار اللون والسعة.
'; var grid = section.querySelector('.aj-bp-grid'); items.forEach(function (item) { var label = document.createElement('label'); label.className = 'aj-bp-item'; label.innerHTML = '
بكج حماية هيلمت HELMET TOKEN + بطارية MOMAX 20000mAh١٤٩٫٩٦ ر.ستفاصيل المنتج';
grid.appendChild(label);
}
function chosen(){return Array.from(section.querySelectorAll('.aj-bp-check:checked')).map(function(x){return x.value;});}
function total(){var el=section.querySelector('.aj-bp-total span');if(el)el.textContent=money(chosen().reduce(function(s,id){return s+(prices[id]||0);},0));}
grid.addEventListener('change',function(){setTimeout(total,0);});
var button=section.querySelector('#aj-bp-add');
if(button)button.addEventListener('click',function(e){
var ids=chosen();if(ids.indexOf('568564677')<0)return;
e.preventDefault();e.stopImmediatePropagation();
var status=section.querySelector('#aj-bp-status');
if(!ids.length){if(status)status.textContent='اختر ملحقًا واحدًا على الأقل.';return;}
if(!window.salla||!salla.cart||!salla.cart.addItem){if(status)status.textContent='تعذر الاتصال بالسلة الآن، حاول مرة أخرى.';return;}
button.disabled=true;if(status)status.textContent='جاري إضافة الملحقات المختارة...';var added=0;
ids.reduce(function(p,id){return p.then(function(){return salla.cart.addItem({id:Number(id),quantity:1}).then(function(){added++;});});},Promise.resolve()).then(function(){if(status)status.textContent='تمت إضافة '+added+' من الملحقات إلى السلة بنجاح ✓';}).catch(function(){if(status)status.textContent='تمت إضافة '+added+' ملحقات، وتعذر إضافة أحد المنتجات.';}).finally(function(){button.disabled=false;});
},true);
total();return true;
}
if(!enhance())new MutationObserver(function(_,o){if(enhance())o.disconnect();}).observe(document.documentElement,{childList:true,subtree:true});
})();
/* أرض الجوال — شعار تذييل واحد بلا تراكب */
(function(){
if(window.__ajSingleFooterLogo)return;
window.__ajSingleFooterLogo=true;
var lightSrc='https://cdn.files.salla.network/theme/938040493/eb58a789-3060-40ac-9ac7-876005775495-original.webp';
var darkSrc='https://cdn.files.salla.network/homepage/938040493/91b16e7a-535d-41bc-b614-959a26651a99_751x509.webp';
function update(img){
var dark=document.body&&document.body.classList.contains('color-mode-dark');
var wanted=dark?darkSrc:lightSrc;
if(img.src!==wanted)img.src=wanted;
img.style.setProperty('display','block','important');
img.style.setProperty('visibility','visible','important');
img.style.setProperty('opacity','1','important');
img.style.setProperty('filter','none','important');
}
function mount(){
var footer=document.querySelector('footer');
if(!footer)return;
var originals=footer.querySelectorAll('img.light-logo,img.dark-logo');
if(!originals.length)return;
originals.forEach(function(x){x.style.setProperty('display','none','important');x.style.setProperty('visibility','hidden','important');x.style.setProperty('opacity','0','important');});
var img=footer.querySelector('#aj-footer-single-logo');
if(!img){
img=document.createElement('img');
img.id='aj-footer-single-logo';
img.alt='أرض الجوال logo';
img.width=150;
img.style.maxWidth='150px';
img.style.height='auto';
var host=originals[0].parentElement||footer;
host.appendChild(img);
}
update(img);
}
function start(){mount();new MutationObserver(function(m){var modeChanged=m.some(function(x){return x.type==='attributes'&&x.attributeName==='class'});if(modeChanged){var img=document.getElementById('aj-footer-single-logo');if(img)update(img);}else mount();}).observe(document.documentElement,{subtree:true,childList:true,attributes:true,attributeFilter:['class']});}
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',start,{once:true});else start();
})();
/* أرض الجوال — حذف نسخ شعار التذييل القديمة نهائيًا */
(function(){
if(window.__ajFooterLogoHardCleanup)return;window.__ajFooterLogoHardCleanup=true;
var light='https://cdn.files.salla.network/theme/938040493/eb58a789-3060-40ac-9ac7-876005775495-original.webp';
var dark='https://cdn.files.salla.network/homepage/938040493/91b16e7a-535d-41bc-b614-959a26651a99_751x509.webp';
function clean(){
var footer=document.querySelector('footer');if(!footer)return;
var old=footer.querySelectorAll('img.light-logo,img.dark-logo');
var one=footer.querySelector('#aj-footer-single-logo');
if(!one&&old.length){one=document.createElement('img');one.id='aj-footer-single-logo';one.alt='أرض الجوال logo';one.width=150;one.style.cssText='display:block!important;visibility:visible!important;opacity:1!important;filter:none!important;max-width:150px;height:auto';(old[0].parentElement||footer).appendChild(one);}
old.forEach(function(x){x.remove();});
if(one){one.src=document.body&&document.body.classList.contains('color-mode-dark')?dark:light;one.style.setProperty('display','block','important');one.style.setProperty('filter','none','important');}
}
clean();new MutationObserver(clean).observe(document.documentElement,{subtree:true,childList:true,attributes:true,attributeFilter:['class']});
})();
/* ardaljwal-blog-arrows-fix-v1 */
(function () {
if (window.__ardaljwalBlogArrowsFixV1) return;
window.__ardaljwalBlogArrowsFixV1 = true;
function initBlogSlider() {
var section = document.querySelector('section.s-block--blogs');
if (!section || section.dataset.ardaljwalBlogNav === '1') return;
var container = section.querySelector('.swiper');
var wrapper = section.querySelector('.swiper-wrapper');
var next = section.querySelector('.s-slider-next');
var prev = section.querySelector('.s-slider-prev');
if (!container || !wrapper || !next || !prev) return;
section.dataset.ardaljwalBlogNav = '1';
container.style.setProperty('overflow-x', 'auto', 'important');
container.style.setProperty('scroll-behavior', 'smooth', 'important');
container.style.setProperty('scrollbar-width', 'none', 'important');
wrapper.style.setProperty('transform', 'none', 'important');
wrapper.style.setProperty('transition', 'none', 'important');
if (!document.getElementById('ardaljwal-blog-arrows-style')) {
var style = document.createElement('style');
style.id = 'ardaljwal-blog-arrows-style';
style.textContent = 'section.s-block--blogs .swiper::-webkit-scrollbar{display:none}';
document.head.appendChild(style);
}
var pausedUntil = 0;
function move(direction, manual) {
var slide = section.querySelector('.swiper-slide');
var step = slide ? slide.getBoundingClientRect().width : container.clientWidth * 0.8;
var rtl = getComputedStyle(container).direction === 'rtl';
var max = Math.max(0, container.scrollWidth - container.clientWidth);
var current = container.scrollLeft;
var target;
if (rtl) {
target = current + (direction > 0 ? -step : step);
if (direction > 0 && Math.abs(current) >= max - step * 0.35) target = 0;
if (direction < 0 && current >= -1) target = -max;
} else {
target = current + (direction > 0 ? step : -step);
if (direction > 0 && current >= max - step * 0.35) target = 0;
if (direction < 0 && current <= 1) target = max;
}
container.scrollTo({ left: target, behavior: 'smooth' });
if (manual) pausedUntil = Date.now() + 8000;
}
next.addEventListener('click', function (event) {
event.preventDefault();
event.stopImmediatePropagation();
move(1, true);
}, true);
prev.addEventListener('click', function (event) {
event.preventDefault();
event.stopImmediatePropagation();
move(-1, true);
}, true);
window.setInterval(function () {
if (Date.now() < pausedUntil || document.hidden) return;
move(1, false);
}, 6500);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initBlogSlider, { once: true });
} else {
initBlogSlider();
}
new MutationObserver(initBlogSlider).observe(document.documentElement, { childList: true, subtree: true });
})();
/* ardaljwal-tech-icons-infinite-marquee-desktop-v2 */
(function () {
if (window.__ardaljwalTechMarqueeV2) return;
window.__ardaljwalTechMarqueeV2 = true;
var media = window.matchMedia('(min-width: 1024px)');
var frame = 0;
var wrapper = null;
var section = null;
var clones = [];
var distance = 0;
var offset = 0;
var lastTime = 0;
var paused = false;
var initializing = false;
function findSection() {
var headings = document.querySelectorAll('h2');
for (var i = 0; i < headings.length; i++) {
if ((headings[i].textContent || '').trim() === 'أكتشف عالم التقنية') {
return headings[i].closest('section.s-block--categories');
}
}
return null;
}
function stop() {
if (frame) cancelAnimationFrame(frame);
frame = 0;
lastTime = 0;
}
function cleanup() {
stop();
for (var i = 0; i < clones.length; i++) clones[i].remove();
clones = [];
if (wrapper) {
wrapper.style.removeProperty('transform');
wrapper.style.removeProperty('transition');
wrapper.style.removeProperty('will-change');
wrapper.style.removeProperty('width');
}
if (section) delete section.dataset.ardaljwalTechMarquee;
wrapper = null;
section = null;
distance = 0;
offset = 0;
initializing = false;
}
function tick(time) {
if (!media.matches || !wrapper || !wrapper.isConnected || !distance) {
cleanup();
return;
}
if (!lastTime) lastTime = time;
var delta = Math.min(40, time - lastTime);
lastTime = time;
if (!paused) {
offset = (offset + (72 * delta / 1000)) % distance;
wrapper.style.setProperty('transform', 'translate3d(' + offset + 'px,0,0)', 'important');
}
frame = requestAnimationFrame(tick);
}
function init() {
if (!media.matches || window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
cleanup();
return;
}
if (initializing || (section && section.isConnected)) return;
initializing = true;
var found = findSection();
var foundWrapper = found && found.querySelector('.swiper-wrapper');
if (!found || !foundWrapper) {
initializing = false;
return;
}
section = found;
wrapper = foundWrapper;
var originals = Array.prototype.slice.call(wrapper.children).filter(function (slide) {
return !slide.hasAttribute('data-ardaljwal-marquee-clone');
});
if (originals.length < 2) {
initializing = false;
return;
}
var left = Infinity;
var right = -Infinity;
originals.forEach(function (slide) {
var rect = slide.getBoundingClientRect();
left = Math.min(left, rect.left);
right = Math.max(right, rect.right);
});
distance = Math.max(1, right - left);
originals.forEach(function (slide) {
var clone = slide.cloneNode(true);
clone.setAttribute('data-ardaljwal-marquee-clone', '1');
clone.setAttribute('aria-hidden', 'true');
clone.querySelectorAll('[id]').forEach(function (node) { node.removeAttribute('id'); });
wrapper.appendChild(clone);
clones.push(clone);
});
section.dataset.ardaljwalTechMarquee = '2';
if (!section.dataset.ardaljwalTechHoverPause) {
section.dataset.ardaljwalTechHoverPause = '1';
section.addEventListener('mouseenter', function () { paused = true; });
section.addEventListener('mouseleave', function () { paused = false; lastTime = 0; });
}
wrapper.style.setProperty('transition', 'none', 'important');
wrapper.style.setProperty('will-change', 'transform', 'important');
wrapper.style.setProperty('width', 'max-content', 'important');
offset = 0;
lastTime = 0;
stop();
frame = requestAnimationFrame(tick);
initializing = false;
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init, { once: true });
} else {
init();
}
if (media.addEventListener) media.addEventListener('change', init);
window.addEventListener('resize', function () {
if (media.matches && !section) init();
}, { passive: true });
new MutationObserver(function () {
if (!section || !section.isConnected) {
cleanup();
window.setTimeout(init, 80);
}
}).observe(document.documentElement, { childList: true, subtree: true });
})();
/* AJ GLOBAL PHONE OPTIONS START - phone color and storage options - 2026-09-05 */
;(function () {
'use strict';
if (window.__ajGlobalPhoneOptionsV1) return;
window.__ajGlobalPhoneOptionsV1 = true;
var attempts = 0;
var styleId = 'aj-global-phone-options-style';
function normalize(value) {
return String(value || '').replace(/\s+/g, ' ').trim().toLowerCase();
}
function optionName(container) {
var label = container.querySelector('.s-product-options-option-label b') ||
container.querySelector('.s-product-options-option-label');
return normalize(label && label.textContent);
}
function isColorOption(container) {
var name = optionName(container);
return /(^|\s)(اللون|لون|color)(\s|\*|$)/i.test(name) &&
!!container.querySelector('select,input[type="radio"]');
}
function isStorageOption(container) {
return /(سعة\s*(التخزين|الخزين|الذاكرة|الجهاز|الهاتف)|مساحة\s*(التخزين|الخزين|الذاكرة|الجهاز|الهاتف)|حجم\s*(التخزين|الخزين|الجهاز|الهاتف)|storage|capacity)/i.test(optionName(container));
}
function isPhoneProduct(root) {
var categoryLinks = Array.from(root.querySelectorAll('a')).map(function (link) {
return normalize(link.textContent);
}).join(' ');
if (/جوالات/.test(categoryLinks)) return true;
var title = normalize(document.querySelector('h1')?.textContent);
return /(آيفون|ايفون|iphone|هاتف|جوال)/i.test(title);
}
function ensureStyle() {
if (document.getElementById(styleId)) return;
var style = document.createElement('style');
style.id = styleId;
style.textContent = `
body.aj-phone-options-active .aj-phone-color-option .s-product-options-colors-wrapper,
body.aj-phone-options-active .aj-phone-color-option .s-product-options-thumbnails-wrapper{display:flex!important;flex-wrap:wrap!important;align-items:flex-start!important;gap:10px!important;overflow:visible!important}
body.aj-phone-options-active .aj-phone-color-option .s-product-options-colors-item,
body.aj-phone-options-active .aj-phone-color-option .s-product-options-thumbnails-wrapper>div{flex:0 0 64px!important;width:64px!important;min-width:0!important;text-align:center!important}
body.aj-phone-options-active .aj-phone-color-option .s-product-options-colors-item>label{display:flex!important;flex-direction:column!important;align-items:center!important;gap:3px!important;cursor:pointer!important}
body.aj-phone-options-active .aj-phone-color-option .s-product-options-colors-item>label>span{display:block!important;width:26px!important;height:26px!important;min-width:26px!important;border:2px solid #fff!important;border-radius:50%!important;box-shadow:0 0 0 1px #b5bec3!important;transition:box-shadow .15s ease,transform .15s ease!important}
body.aj-phone-options-active .aj-phone-color-option .s-product-options-colors-item>input:checked+label>span{box-shadow:0 0 0 2px #fff,0 0 0 4px #005430!important;transform:scale(1.04)!important}
body.aj-phone-options-active .aj-phone-color-option .s-product-options-colors-item>input:focus-visible+label>span{outline:2px solid #005430!important;outline-offset:4px!important}
body.aj-phone-options-active .aj-phone-color-option .s-product-options-colors-item>label>div{font-size:11px!important;line-height:1.45!important;text-align:center!important;white-space:normal!important}
body.aj-phone-options-active .aj-phone-color-option .s-product-options-colors-item>label p{margin:0!important;font-size:9px!important;line-height:1.3!important;color:#737373!important}
body.aj-phone-options-active .aj-phone-color-option label.go-to-slide{display:block!important;position:relative!important;width:44px!important;height:44px!important;min-height:44px!important;margin:0 auto!important;padding:9px!important;border:0!important;border-radius:50%!important;background:transparent!important;box-shadow:none!important;overflow:visible!important;cursor:pointer!important;box-sizing:border-box!important}
body.aj-phone-options-active .aj-phone-color-option label.go-to-slide>img{display:block!important;position:static!important;width:26px!important;height:26px!important;min-width:26px!important;object-fit:cover!important;border:2px solid #fff!important;border-radius:50%!important;box-shadow:0 0 0 1px #b5bec3!important;box-sizing:border-box!important;opacity:1!important;transition:box-shadow .15s ease,transform .15s ease!important}
body.aj-phone-options-active .aj-phone-color-option input:checked+label.go-to-slide>img{box-shadow:0 0 0 2px #fff,0 0 0 4px #005430!important;transform:scale(1.04)!important}
body.aj-phone-options-active .aj-phone-color-option input:focus-visible+label.go-to-slide{outline:2px solid #005430!important;outline-offset:2px!important}
body.aj-phone-options-active .aj-phone-color-option .s-product-options-thumbnails-icon,
body.aj-phone-options-active .aj-phone-color-option .s-product-options-thumbnails-stock-badge{display:none!important}
body.aj-phone-options-active .aj-phone-color-option .s-product-options-thumbnails-wrapper>div>p{margin:2px 0 0!important;font-size:11px!important;line-height:1.45!important;white-space:normal!important}
body.aj-phone-options-active .aj-phone-color-option .s-product-options-option-stock-out label.go-to-slide::after{content:"";position:absolute;left:9px;top:21px;width:26px;height:2px;background:#53616a;transform:rotate(-45deg);box-shadow:0 0 0 1px #fff;z-index:4;pointer-events:none}
body.aj-phone-options-active .aj-phone-color-option .s-product-options-option-stock-out>p::after{content:"نفدت الكمية";display:block;font-size:9px;color:#737373}
body.aj-phone-options-active .aj-phone-color-buttons{display:flex!important;flex-wrap:wrap!important;align-items:flex-start!important;gap:10px!important;margin:4px 0!important;max-width:100%!important}
body.aj-phone-options-active .aj-phone-color-buttons>button{appearance:none!important;display:flex!important;flex:0 0 60px!important;width:60px!important;min-width:0!important;flex-direction:column!important;align-items:center!important;gap:5px!important;padding:3px 2px!important;border:0!important;background:transparent!important;color:#0b2f3a!important;font-family:inherit!important;font-size:11px!important;line-height:1.35!important;cursor:pointer!important;box-shadow:none!important;box-sizing:border-box!important}
body.aj-phone-options-active .aj-phone-color-buttons>button>i{display:block!important;width:26px!important;height:26px!important;min-width:26px!important;border:2px solid #fff!important;border-radius:50%!important;background:var(--aj-phone-color,#dfe5e8)!important;box-shadow:0 0 0 1px #b5bec3!important;transition:box-shadow .15s ease,transform .15s ease!important;box-sizing:border-box!important}
body.aj-phone-options-active .aj-phone-color-buttons>button[aria-pressed="true"]>i{box-shadow:0 0 0 2px #fff,0 0 0 4px #005430!important;transform:scale(1.04)!important}
body.aj-phone-options-active .aj-phone-color-buttons>button:focus-visible{outline:2px solid #005430!important;outline-offset:2px!important;border-radius:8px!important}
body.aj-phone-options-active .aj-phone-color-buttons>button:disabled{opacity:.45!important;cursor:not-allowed!important;text-decoration:line-through!important}
body.aj-phone-options-active .aj-phone-storage-buttons{display:flex!important;flex-wrap:wrap!important;gap:8px!important;align-items:center!important;margin:4px 0!important;max-width:100%!important}
body.aj-phone-options-active .aj-phone-storage-buttons>button,
body.aj-phone-options-active .aj-phone-storage-radio input[type="radio"]+label{appearance:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important;width:auto!important;min-width:88px!important;min-height:44px!important;padding:10px 16px!important;border:1.5px solid #0b2f3a!important;border-radius:12px!important;background:#fff!important;color:#0b2f3a!important;font-family:inherit!important;font-size:15px!important;font-weight:800!important;line-height:1.4!important;letter-spacing:normal!important;box-shadow:none!important;text-shadow:none!important;transform:none!important;cursor:pointer!important;transition:background-color .15s ease,color .15s ease,border-color .15s ease!important;box-sizing:border-box!important}
body.aj-phone-options-active .aj-phone-storage-buttons>button[aria-pressed="true"],
body.aj-phone-options-active .aj-phone-storage-radio input[type="radio"]:checked+label{background:#005430!important;border-color:#005430!important;color:#fff!important}
body.aj-phone-options-active .aj-phone-storage-buttons>button:focus-visible,
body.aj-phone-options-active .aj-phone-storage-radio input[type="radio"]:focus-visible+label{outline:2px solid #005430!important;outline-offset:3px!important}
body.aj-phone-options-active .aj-phone-storage-buttons>button:disabled,
body.aj-phone-options-active .aj-phone-storage-radio .s-product-options-option-stock-out label{opacity:.45!important;cursor:not-allowed!important;text-decoration:line-through!important}
body.aj-phone-options-active .aj-phone-storage-radio .s-product-options-option-content>fieldset,
body.aj-phone-options-active .aj-phone-storage-radio .s-product-options-option-content>div{display:flex!important;flex-wrap:wrap!important;gap:8px!important;align-items:center!important}
body.aj-phone-options-active select.aj-phone-native-storage,
body.aj-phone-options-active select.aj-phone-native-color{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;padding:0!important;margin:0!important;border:0!important;opacity:0!important;clip-path:inset(50%)!important;pointer-events:none!important}
@media(max-width:767px){
body.aj-phone-options-active .aj-phone-color-option .s-product-options-colors-wrapper,
body.aj-phone-options-active .aj-phone-color-option .s-product-options-thumbnails-wrapper{gap:8px!important}
body.aj-phone-options-active .aj-phone-color-buttons{gap:8px!important}
body.aj-phone-options-active .aj-phone-storage-buttons>button,
body.aj-phone-options-active .aj-phone-storage-radio input[type="radio"]+label{min-width:82px!important;min-height:42px!important;padding:9px 13px!important;font-size:14px!important}
}`;
document.head.appendChild(style);
}
function cleanOldClasses(root) {
root.querySelectorAll('.aj-ip17-storage').forEach(function (node) { node.remove(); });
root.querySelectorAll('.aj-ip17-native').forEach(function (node) {
node.classList.remove('aj-ip17-native');
node.removeAttribute('tabindex');
});
document.getElementById('aj-ip17-options-style')?.remove();
}
function boot() {
var host = document.querySelector('salla-product-options');
var root = host && (host.closest('[id^="product-"]') || host.parentElement);
if (!host || !root) {
if (++attempts < 40) setTimeout(boot, 250);
return;
}
var containers = Array.from(host.querySelectorAll('.s-product-options-option-container'));
var colorContainers = containers.filter(isColorOption);
var storageContainers = containers.filter(isStorageOption);
if (!isPhoneProduct(root) || (!colorContainers.length && !storageContainers.length)) return;
cleanOldClasses(root);
ensureStyle();
document.body.classList.add('aj-phone-options-active');
colorContainers.forEach(function (container) { container.classList.add('aj-phone-color-option'); });
var queued = false;
var bound = new WeakSet();
function colorValue(name) {
var text = normalize(name);
var colors = [
[/اسود|أسود|black/, '#1d2329'], [/ابيض|أبيض|white/, '#ffffff'],
[/ازرق سماوي|أزرق سماوي|sky blue/, '#8fd3f4'], [/كحلي|navy/, '#0b2f3a'],
[/ازرق|أزرق|blue/, '#4d82c4'], [/اخضر|أخضر|green/, '#69a963'],
[/موف|بنفسجي|purple|violet/, '#9b6bb1'], [/وردي|زهري|pink/, '#efbfd5'],
[/فضي|silver/, '#c9cdd2'], [/رمادي|grey|gray/, '#858b90'],
[/احمر|أحمر|red/, '#d64545'], [/برتقالي|orange/, '#e9823f'],
[/ذهبي|gold/, '#d5b56e'], [/بيج|beige/, '#d9c7a7']
];
for (var i = 0; i < colors.length; i++) if (colors[i][0].test(text)) return colors[i][1];
return '#dfe5e8';
}
function syncColorSelect(container) {
var current = container.querySelector('select');
if (!current) return;
var options = Array.from(current.options).filter(function (option) { return option.value !== ''; });
if (!options.length) return;
var signature = JSON.stringify(options.map(function (option) { return [option.value, option.text, option.disabled]; }));
var group = container.querySelector('.aj-phone-color-buttons');
if (!group || group.dataset.signature !== signature || group.dataset.selectId !== current.id) {
group?.remove();
group = document.createElement('div');
group.className = 'aj-phone-color-buttons';
group.dataset.signature = signature;
group.dataset.selectId = current.id || 'color';
group.setAttribute('role', 'group');
group.setAttribute('aria-label', 'اختر اللون');
options.forEach(function (option) {
var button = document.createElement('button');
var dot = document.createElement('i');
var label = document.createElement('span');
button.type = 'button';
button.dataset.ajPhoneValue = option.value;
button.setAttribute('aria-label', option.text.trim());
dot.setAttribute('aria-hidden', 'true');
dot.style.setProperty('--aj-phone-color', colorValue(option.text));
label.textContent = option.text.trim();
button.appendChild(dot); button.appendChild(label);
button.addEventListener('click', function () {
if (button.disabled || current.value === option.value) return;
current.value = option.value;
current.dispatchEvent(new Event('input', { bubbles: true }));
current.dispatchEvent(new Event('change', { bubbles: true }));
scheduleSync();
});
group.appendChild(button);
});
(current.closest('.s-product-options-option-content') || current.parentElement || container).appendChild(group);
}
current.classList.add('aj-phone-native-color');
current.tabIndex = -1;
Array.from(group.children).forEach(function (button) {
var option = options.find(function (item) { return item.value === button.dataset.ajPhoneValue; });
button.setAttribute('aria-pressed', String(current.value === button.dataset.ajPhoneValue));
var disabled = current.disabled || !option || option.disabled;
if (button.disabled !== disabled) button.disabled = disabled;
});
}
function syncSelect(container) {
var current = container.querySelector('select');
if (!current) {
if (container.querySelector('input[type="radio"]')) container.classList.add('aj-phone-storage-radio');
return;
}
var options = Array.from(current.options).filter(function (option) { return option.value !== ''; });
if (!options.length) return;
var signature = JSON.stringify(options.map(function (option) {
return [option.value, option.text, option.disabled];
}));
var group = container.querySelector('.aj-phone-storage-buttons');
if (!group || group.dataset.signature !== signature || group.dataset.selectId !== current.id) {
group?.remove();
group = document.createElement('div');
group.className = 'aj-phone-storage-buttons';
group.dataset.signature = signature;
group.dataset.selectId = current.id || 'storage';
group.setAttribute('role', 'group');
group.setAttribute('aria-label', 'اختر سعة التخزين');
options.forEach(function (option) {
var button = document.createElement('button');
var text = option.text.trim();
button.type = 'button';
button.dataset.ajPhoneValue = option.value;
button.dir = 'ltr';
button.textContent = /^\d+(?:\.\d+)?$/.test(text) ? text + ' GB' : text;
button.addEventListener('click', function () {
if (button.disabled || current.value === option.value) return;
current.value = option.value;
current.dispatchEvent(new Event('input', { bubbles: true }));
current.dispatchEvent(new Event('change', { bubbles: true }));
scheduleSync();
});
group.appendChild(button);
});
(current.closest('.s-product-options-option-content') || current.parentElement || container).appendChild(group);
}
current.classList.add('aj-phone-native-storage');
current.tabIndex = -1;
if (!bound.has(current)) {
bound.add(current);
current.addEventListener('invalid', function () {
container.querySelector('.aj-phone-storage-buttons button:not(:disabled)')?.focus();
});
}
Array.from(group.children).forEach(function (button) {
var option = options.find(function (item) { return item.value === button.dataset.ajPhoneValue; });
button.setAttribute('aria-pressed', String(current.value === button.dataset.ajPhoneValue));
var disabled = current.disabled || !option || option.disabled;
if (button.disabled !== disabled) button.disabled = disabled;
});
}
function sync() {
colorContainers.forEach(syncColorSelect);
storageContainers.forEach(syncSelect);
}
function scheduleSync() {
if (queued) return;
queued = true;
requestAnimationFrame(function () {
queued = false;
containers = Array.from(host.querySelectorAll('.s-product-options-option-container'));
colorContainers = containers.filter(isColorOption);
storageContainers = containers.filter(isStorageOption);
colorContainers.forEach(function (container) { container.classList.add('aj-phone-color-option'); });
sync();
});
}
try {
sync();
host.addEventListener('change', scheduleSync);
new MutationObserver(scheduleSync).observe(host, {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ['disabled', 'selected', 'checked']
});
} catch (error) {
console.warn('AJ phone options: native controls retained.', error);
}
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot, { once: true });
else boot();
})();
/* AJ GLOBAL PHONE OPTIONS END */
/* AJ ALTERNATIVE CARDS FIX START */
(function(){if(document.getElementById('aj-alternative-cards-fix'))return;var s=document.createElement('style');s.id='aj-alternative-cards-fix';s.textContent=`
.out-of-stock-alternative .s-products-list-wrapper{display:flex!important;flex-direction:column!important;gap:12px!important;grid-template-columns:none!important;margin-bottom:0!important}
.out-of-stock-alternative custom-salla-product-card.s-product-card-entry{display:grid!important;grid-template-columns:88px minmax(0,1fr)!important;width:100%!important;min-width:0!important;height:auto!important;min-height:132px!important;border:1px solid #e4e9ec!important;border-radius:14px!important;overflow:hidden!important;background:#fff!important}
.out-of-stock-alternative .s-product-card-image{grid-column:1!important;width:88px!important;height:132px!important;min-height:132px!important}
.out-of-stock-alternative .s-product-card-image>a{width:100%!important;height:100%!important;padding:8px!important}
.out-of-stock-alternative .s-product-card-image img{width:100%!important;height:100%!important;object-fit:contain!important}
.out-of-stock-alternative .s-product-card-content{grid-column:2!important;width:100%!important;height:auto!important;min-width:0!important;min-height:132px!important;padding:10px 10px 10px 8px!important;display:flex!important;flex-direction:column!important}
.out-of-stock-alternative .s-product-card-content-title{width:100%!important;height:auto!important;min-height:40px!important;margin:0 0 6px!important;font-size:13px!important;line-height:1.55!important}
.out-of-stock-alternative .s-product-card-content-title>a{width:100%!important;height:auto!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important}
.out-of-stock-alternative .s-product-card-content-sub{width:100%!important;margin:0 0 8px!important}
.out-of-stock-alternative .s-product-card-content-footer{position:static!important;inset:auto!important;width:100%!important;height:auto!important;margin-top:auto!important}
.out-of-stock-alternative .s-product-card-content-footer salla-add-product-button,.out-of-stock-alternative .s-product-card-content-footer salla-button,.out-of-stock-alternative .s-product-card-content-footer button{display:flex!important;width:100%!important;max-width:100%!important}
.out-of-stock-alternative .s-product-card-content-footer button{min-height:36px!important;padding:7px 8px!important;justify-content:center!important}
.out-of-stock-alternative .s-product-card-content-footer .s-button-text{display:flex!important;width:auto!important;overflow:visible!important}
.out-of-stock-alternative .s-product-card-content-footer .s-button-text>span{white-space:nowrap!important;font-size:12px!important}`;document.head.appendChild(s)})();
/* AJ ALTERNATIVE CARDS FIX END */
/* AJ ALTERNATIVE CARDS MOBILE FIX START */
(function(){if(document.getElementById('aj-alternative-cards-mobile-fix'))return;var s=document.createElement('style');s.id='aj-alternative-cards-mobile-fix';s.textContent=`@media (max-width:767px){body .out-of-stock-alternative .out-of-stock-alternative__list .out-of-stock-alternative__products .s-products-list-wrapper{display:flex!important;flex-flow:column nowrap!important;grid-template-columns:unset!important;width:100%!important;max-width:100%!important;gap:12px!important;overflow:visible!important}body .out-of-stock-alternative .out-of-stock-alternative__products custom-salla-product-card.s-product-card-entry{display:grid!important;grid-template-columns:92px minmax(0,1fr)!important;flex:0 0 auto!important;width:100%!important;max-width:100%!important;min-width:0!important;height:auto!important;min-height:132px!important}body .out-of-stock-alternative .s-product-card-image{grid-column:1!important;width:92px!important;height:132px!important}body .out-of-stock-alternative .s-product-card-content{grid-column:2!important;width:100%!important;min-width:0!important}body .out-of-stock-alternative .s-product-card-content-footer,body .out-of-stock-alternative .s-product-card-content-footer button{width:100%!important;max-width:100%!important}}`;document.head.appendChild(s)})();
/* AJ ALTERNATIVE CARDS MOBILE FIX END */
/* AJ ALTERNATIVE MOBILE SLIDER FIX START */
(function(){if(document.getElementById('aj-alternative-mobile-slider-fix'))return;var s=document.createElement('style');s.id='aj-alternative-mobile-slider-fix';s.textContent=`@media (max-width:767px){body .out-of-stock-alternative .out-of-stock-alternative__slider .s-slider-container{width:100%!important;max-width:100%!important;overflow:visible!important}body .out-of-stock-alternative .out-of-stock-alternative__slider .s-slider-swiper-wrapper{display:flex!important;flex-direction:column!important;transform:none!important;gap:12px!important;width:100%!important}body .out-of-stock-alternative .out-of-stock-alternative__slider .s-products-slider-card{width:100%!important;max-width:100%!important;flex:0 0 auto!important;margin:0!important}body .out-of-stock-alternative .out-of-stock-alternative__slider custom-salla-product-card.s-product-card-entry{width:100%!important;max-width:100%!important}}`;document.head.appendChild(s)})();
/* AJ ALTERNATIVE MOBILE SLIDER FIX END */
/* AJ IPAD OPTIONS EXTENSION — 2026-09-05 */
;(function () {
'use strict';
if (window.__ajTabletOptionsV1) return;
window.__ajTabletOptionsV1 = true;
var tries = 0;
function norm(v) { return String(v || '').replace(/\s+/g, ' ').trim().toLowerCase(); }
function labelOf(box) { var x = box.querySelector('.s-product-options-option-label b,.s-product-options-option-label'); return norm(x && x.textContent); }
function isIpad(root) {
var all = norm(root.textContent).slice(0, 3000);
return /ipad|tablet|\u0627\u064a\u0628\u0627\u062f|\u0622\u064a\u0628\u0627\u062f|\u0623\u064a\u0628\u0627\u062f|\u062a\u0627\u0628\u0644\u062a/.test(all);
}
function isColor(box) { return /(?:^|\s)(?:\u0627\u0644\u0644\u0648\u0646|\u0644\u0648\u0646|color)(?:\s|\*|$)/i.test(labelOf(box)); }
function isStorage(box) { return /(?:\u0645\u0633\u0627\u062d\u0629|\u0633\u0639\u0629|\u0630\u0627\u0643\u0631\u0629|storage|capacity)/i.test(labelOf(box)); }
function setStyle() {
if (document.getElementById('aj-ipad-options-style')) return;
var s = document.createElement('style');
s.id = 'aj-ipad-options-style';
s.textContent = '.aj-ipad-color .s-product-options-thumbnails-wrapper{display:flex!important;flex-wrap:wrap!important;gap:10px!important}.aj-ipad-color .s-product-options-thumbnails-wrapper>div{width:64px!important;flex:0 0 64px!important;text-align:center!important}.aj-ipad-color label.go-to-slide{display:block!important;width:44px!important;height:44px!important;margin:0 auto!important;padding:9px!important;border-radius:50%!important;overflow:visible!important}.aj-ipad-color label.go-to-slide>img{display:block!important;width:26px!important;height:26px!important;object-fit:cover!important;border:2px solid #fff!important;border-radius:50%!important;box-shadow:0 0 0 1px #b5bec3!important}.aj-ipad-color input:checked+label.go-to-slide>img{box-shadow:0 0 0 2px #fff,0 0 0 4px #005430!important;transform:scale(1.04)!important}.aj-ipad-color .s-product-options-thumbnails-icon,.aj-ipad-color .s-product-options-thumbnails-stock-badge{display:none!important}.aj-ipad-color .s-product-options-thumbnails-wrapper>div>p{margin:2px 0 0!important;font-size:11px!important;line-height:1.45!important}.aj-ipad-storage-buttons{display:flex!important;flex-wrap:wrap!important;gap:8px!important;margin:4px 0!important}.aj-ipad-storage-buttons>button{appearance:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:88px!important;min-height:44px!important;padding:10px 16px!important;border:1.5px solid #0b2f3a!important;border-radius:12px!important;background:#fff!important;color:#0b2f3a!important;font:800 15px/1.4 inherit!important;cursor:pointer!important}.aj-ipad-storage-buttons>button[aria-pressed="true"]{background:#005430!important;border-color:#005430!important;color:#fff!important}.aj-ipad-storage-buttons>button:disabled{opacity:.45!important;cursor:not-allowed!important}.aj-ipad-native-storage{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;opacity:0!important;clip-path:inset(50%)!important;pointer-events:none!important}@media(max-width:767px){.aj-ipad-storage-buttons>button{min-width:82px!important;min-height:42px!important;padding:9px 13px!important;font-size:14px!important}}';
document.head.appendChild(s);
}
function mount() {
var host = document.querySelector('salla-product-options');
var root = host && (host.closest('[id^="product-"]') || host.parentElement);
if (!host || !root) { if (++tries < 40) setTimeout(mount, 250); return; }
if (!isIpad(root)) return;
var boxes = Array.prototype.slice.call(host.querySelectorAll('.s-product-options-option-container'));
var colors = boxes.filter(isColor), storage = boxes.filter(isStorage);
if (!colors.length && !storage.length) return;
setStyle();
colors.forEach(function (box) { box.classList.add('aj-ipad-color'); });
function syncStorage(box) {
var select = box.querySelector('select');
if (!select) return;
var opts = Array.prototype.slice.call(select.options).filter(function (o) { return o.value; });
if (!opts.length) return;
var signature = opts.map(function (o) { return o.value + ':' + o.text + ':' + o.disabled; }).join('|');
var group = box.querySelector('.aj-ipad-storage-buttons');
if (!group || group.dataset.signature !== signature) {
if (group) group.remove();
group = document.createElement('div'); group.className = 'aj-ipad-storage-buttons'; group.dataset.signature = signature;
opts.forEach(function (opt) {
var btn = document.createElement('button'); var value = opt.text.trim();
btn.type = 'button'; btn.dir = 'ltr'; btn.dataset.value = opt.value;
btn.textContent = /^\d+(?:\.\d+)?$/.test(value) ? value + ' GB' : value;
btn.addEventListener('click', function () { if (btn.disabled) return; select.value = opt.value; select.dispatchEvent(new Event('input', { bubbles:true })); select.dispatchEvent(new Event('change', { bubbles:true })); update(); });
group.appendChild(btn);
});
(select.closest('.s-product-options-option-content') || select.parentElement).appendChild(group);
}
select.classList.add('aj-ipad-native-storage'); select.tabIndex = -1;
function update() { Array.prototype.forEach.call(group.children, function (btn) { var opt = opts.filter(function (o) { return o.value === btn.dataset.value; })[0]; btn.setAttribute('aria-pressed', String(select.value === btn.dataset.value)); btn.disabled = !!(select.disabled || !opt || opt.disabled); }); }
update();
}
function sync() { storage.forEach(syncStorage); }
sync();
var queued = false;
var schedule = function () { if (queued) return; queued = true; requestAnimationFrame(function () { queued = false; boxes = Array.prototype.slice.call(host.querySelectorAll('.s-product-options-option-container')); colors = boxes.filter(isColor); storage = boxes.filter(isStorage); colors.forEach(function (box) { box.classList.add('aj-ipad-color'); }); sync(); }); };
host.addEventListener('change', schedule);
new MutationObserver(schedule).observe(host, { childList:true, subtree:true, attributes:true, attributeFilter:['disabled','selected','checked'] });
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', mount, { once:true }); else mount();
})();
/* AJ IPAD OPTIONS EXTENSION END */
/* H1-SEO-FIX */(function(){if(!/^\/(?:ar\/?)?$/.test(location.pathname))return;function r(n,t){var x=document.createElement(t);Array.from(n.attributes).forEach(function(a){x.setAttribute(a.name,a.value)});while(n.firstChild)x.appendChild(n.firstChild);n.parentNode.replaceChild(x,n)}function f(){document.querySelectorAll('h1.s-product-card-content-title').forEach(function(n){r(n,'h3')});document.querySelectorAll('h1.sr-only').forEach(function(n,i){if(i)r(n,'span')})}if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',f,{once:true});else f();new MutationObserver(f).observe(document.documentElement,{childList:true,subtree:true})})();
/* H1-SEO-FIX-PRODUCTS */(function(){if(!/\/p\d+(?:\/|$)/.test(location.pathname))return;function r(n){var x=document.createElement('h3');Array.from(n.attributes).forEach(function(a){x.setAttribute(a.name,a.value)});while(n.firstChild)x.appendChild(n.firstChild);n.parentNode.replaceChild(x,n)}function f(){document.querySelectorAll('h1.s-product-card-content-title').forEach(r)}if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',f,{once:true});else f();new MutationObserver(f).observe(document.documentElement,{childList:true,subtree:true})})();
/* H1-SEO-FIX-CATEGORIES */(function(){if(!/\/c\d+$/.test(location.pathname))return;function f(){document.querySelectorAll('h1.s-product-card-content-title').forEach(function(h){var n=document.createElement('h3');n.className=h.className;while(h.firstChild)n.appendChild(h.firstChild);h.replaceWith(n);});}f();new MutationObserver(f).observe(document.documentElement,{childList:true,subtree:true});})();
/* H1-SEO-FIX-BRANDS */(function(){if(!/\/brand-\d+\/?$/.test(location.pathname))return;function swap(el){if(!el||el.tagName!=="H1")return;var h3=document.createElement("h3");Array.from(el.attributes).forEach(function(a){h3.setAttribute(a.name,a.value)});while(el.firstChild)h3.appendChild(el.firstChild);el.replaceWith(h3)}function fix(root){if(root&&root.matches&&root.matches("h1.s-product-card-content-title"))swap(root);if(root&&root.querySelectorAll)root.querySelectorAll("h1.s-product-card-content-title").forEach(swap)}fix(document);new MutationObserver(function(records){records.forEach(function(r){r.addedNodes.forEach(function(n){if(n.nodeType===1)fix(n)})})}).observe(document.documentElement,{childList:true,subtree:true})})();
/* AJ_TECH_ICONS_MOTION — rollback: delete this block */
(function () {
if (window.__ajTechIconsMotion) return;
window.__ajTechIconsMotion = true;
function init() {
if (!window.matchMedia("(min-width: 992px)").matches) return;
var slider = document.querySelector("#main-links-3");
if (!slider || slider.dataset.ajTechMotion === "1") return;
var viewport = slider.querySelector(".swiper");
var track = slider.querySelector(".swiper-wrapper");
if (!viewport || !track) return;
slider.dataset.ajTechMotion = "1";
var position = 0;
var direction = 1;
var paused = false;
track.style.transition = "none";
track.style.willChange = "transform";
slider.addEventListener("mouseenter", function () { paused = true; });
slider.addEventListener("mouseleave", function () { paused = false; });
function frame() {
if (!document.hidden && !paused && window.matchMedia("(min-width: 992px)").matches) {
var limit = Math.max(0, track.scrollWidth - viewport.clientWidth);
position += 0.38 * direction;
if (position >= limit) { position = limit; direction = -1; }
if (position <= 0) { position = 0; direction = 1; }
track.style.transform = "translate3d(" + position + "px,0,0)";
}
window.requestAnimationFrame(frame);
}
window.requestAnimationFrame(frame);
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init, { once: true });
} else {
init();
}
new MutationObserver(init).observe(document.documentElement, { childList: true, subtree: true });
})();