(function() {
function applyStrictFooterRedesign() {
const footerContainer = document.querySelector('.store-footer__inner .container');
if (!footerContainer || footerContainer.classList.contains('redesign-applied')) return;
// Fetch Quick Links
const linkElements = document.querySelectorAll('.store-links-items a');
let quickLinksHTML = '';
linkElements.forEach(a => {
quickLinksHTML += `
${a.textContent.trim()}`;
});
if (!quickLinksHTML) {
quickLinksHTML = `
من نحن
منتجات
تجميعات
مدونات
التواصل
`;
}
// Fetch Categories
const catNodes = document.querySelectorAll('#mobile-menu li.root-level > a');
let catsHTML = '';
catNodes.forEach(node => {
catsHTML += `${node.textContent.trim()}`;
});
// Set the newly requested logo
const logoSrc = 'https://cdn.files.salla.network/homepage/304821586/0c7df4f2-3745-4a9b-8f59-67ad1ca77045_865x217.webp';
// Social SVG Icons
const socialHTML = `
`;
footerContainer.classList.add('redesign-applied');
footerContainer.innerHTML = `
نمتلك الابداع الذي يجعل مشروعك يتقدم. جودة وجمالية وكمية تناسب احتياجك.
`;
const bottomFooter = document.querySelector('.footer-bottom .container');
if (bottomFooter) {
const smallLogo = 'https://cdn.files.salla.network/theme/304821586/d10e79d2-9946-4182-8573-2133edc74aa8.png';
bottomFooter.innerHTML = `
© 2026 Rise. All rights reserved.
`;
}
const style = document.createElement('style');
style.textContent = `
.store-footer {
background-color: #ffffff !important;
color: #111 !important;
border-top: 1px solid #eaeaea;
}
.store-footer__inner {
padding: 70px 0 50px 0 !important;
}
.store-footer salla-payments,
.store-footer salla-social,
.store-footer selia-contacts,
.store-footer salla-trust-badges {
display: none !important;
}
.nf-grid {
display: grid !important;
grid-template-columns: 2fr 1fr 1fr 1fr !important;
gap: 40px !important;
direction: rtl !important;
width: 100% !important;
}
.nf-col {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.nf-title {
color: #111 !important;
font-size: 19px !important;
font-weight: 800 !important;
margin-bottom: 30px !important;
border: none !important;
}
.nf-list {
list-style: none !important;
padding: 0 !important;
margin: 0 !important;
width: 100%;
}
.nf-list li {
margin-bottom: 20px !important;
}
.nf-list li a, .nf-contact-links a, .nf-contact-links span {
color: var(--color-primary, #ed1c24) !important;
font-size: 15px !important;
font-weight: 500 !important;
text-decoration: none !important;
display: block !important;
transition: opacity 0.3s ease;
}
.nf-list li a:hover, .nf-contact-links a:hover {
opacity: 0.7;
}
.nf-contact-links {
margin-bottom: 40px;
width: 100%;
}
.nf-contact-links a, .nf-contact-links span {
margin-bottom: 20px !important;
}
.nf-socials {
display: flex;
gap: 15px;
justify-content: center;
}
.nf-socials a {
width: 48px;
height: 48px;
background-color: #c4c4c4;
color: #fff;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
}
.nf-socials a:hover {
background-color: var(--color-primary, #ed1c24);
transform: translateY(-4px);
}
.nf-brand {
align-items: flex-start !important;
text-align: right !important;
}
.nf-logo {
max-width: 250px;
height: auto;
margin-bottom: 25px;
object-fit: contain;
}
.nf-desc {
color: #111;
font-size: 17px;
font-weight: 700;
line-height: 1.7;
margin-bottom: 35px;
max-width: 95%;
}
.nf-newsletter {
background-color: #ebfbf9;
border-radius: 28px;
padding: 40px 30px;
text-align: center;
width: 100%;
box-sizing: border-box;
}
.nfn-title {
font-size: 21px;
font-weight: 700;
color: #111;
margin-bottom: 25px;
line-height: 1.6;
}
.nfn-highlight {
color: var(--color-primary, #ed1c24);
}
.nfn-input-wrap {
background: #fff;
border-radius: 50px;
padding: 6px;
border: 1px solid #ddd;
margin-bottom: 15px;
max-width: 320px;
margin: 0 auto 15px auto;
}
.nfn-input {
border: none;
background: transparent;
width: 100%;
padding: 12px 15px;
outline: none;
text-align: center;
font-family: inherit;
font-size: 14px;
}
.nfn-input::placeholder {
color: #999;
}
.nfn-note {
font-size: 13px;
color: #333;
margin: 0;
line-height: 1.6;
}
.nfn-note a {
color: var(--color-primary, #ed1c24);
text-decoration: none;
font-weight: 700;
}
.footer-bottom {
background: #fff !important;
border-top: 1px solid #eaeaea;
}
.nf-bottom-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 25px 0;
flex-wrap: wrap;
gap: 20px;
}
.nf-bottom-right {
display: flex;
gap: 25px;
flex-wrap: wrap;
}
.nf-bottom-right a {
color: #888;
font-size: 14px;
font-weight: 500;
text-decoration: none;
transition: color 0.3s;
}
.nf-bottom-right a:hover {
color: var(--color-primary, #ed1c24);
}
.nf-bottom-left {
display: flex;
align-items: center;
gap: 12px;
color: #111;
font-size: 14px;
font-weight: 700;
}
.nf-bottom-icon {
width: 22px;
height: 22px;
object-fit: contain;
}
@media (max-width: 1024px) {
.nf-grid {
grid-template-columns: 1fr 1fr !important;
}
.nf-brand {
grid-column: span 2;
align-items: center !important;
text-align: center !important;
}
.nf-desc {
text-align: center !important;
margin: 0 auto 30px auto;
}
}
@media (max-width: 768px) {
.nf-grid {
grid-template-columns: 1fr !important;
}
.nf-brand {
grid-column: span 1;
}
.nf-bottom-bar {
flex-direction: column-reverse;
justify-content: center;
text-align: center;
}
.nf-bottom-right {
justify-content: center;
}
}
`;
document.head.appendChild(style);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => setTimeout(applyStrictFooterRedesign, 600));
} else {
setTimeout(applyStrictFooterRedesign, 600);
}
})();
(function() {
function buildCustomHero() {
// Prevent duplicate execution
if(document.querySelector('.custom-split-hero')) return;
// Locate the original Salla slider block
const originalSlider = document.querySelector('.advanced-slider');
if(!originalSlider) return;
// Dynamically extract data from the original slider (so changes in the dashboard still apply)
const imgEl = originalSlider.querySelector('img.advanced-slider__image');
const imgSrc = imgEl ? (imgEl.getAttribute('data-src') || imgEl.src) : 'https://cdn.files.salla.network/homepage/304821586/497cdc2b-07e6-4ac7-99f5-cad70c763644_823x537.webp';
const titleEl = originalSlider.querySelector('.advanced-slider__caption__inner__content__heading');
const title = titleEl ? titleEl.innerText.trim() : 'خلك في الذاكرة.';
const subtitleEl = originalSlider.querySelector('.advanced-slider__caption__inner__content__text');
const subtitle = subtitleEl ? subtitleEl.innerText.trim() : 'مجموعتنا الفاخرة من الكروت, الفلايارات والإستيكرات.';
const btnEl = originalSlider.querySelector('.advanced-slider__caption__inner__content__button');
const btnLink = btnEl ? btnEl.href : '#';
const btnText = btnEl ? btnEl.innerText.trim() : 'تسوق الآن';
// Format the title logically (Split the specific sentence into two lines to match the design perfectly)
let formattedTitle = title;
if(title.includes('خلك في الذاكرة')) {
formattedTitle = 'خلك
في الذاكرة.';
} else {
formattedTitle = title.replace(/\n/g, '
');
}
// Build the new HTML structure
const heroHTML = `
${formattedTitle}
${subtitle}
${btnText}
`;
const newHero = document.createElement('section');
newHero.className = 'custom-split-hero';
newHero.innerHTML = heroHTML;
// Inject the precise custom CSS
const style = document.createElement('style');
style.textContent = `
.custom-split-hero {
display: flex;
flex-direction: row-reverse; /* Forces Image Left, Content Right for RTL */
width: 100%;
height: 550px;
overflow: hidden;
font-family: var(--font-main, 'IBM Plex Sans Arabic'), sans-serif;
background-color: #f8f8f8;
}
.c-hero-image-side {
flex: 0 0 58%;
position: relative;
height: 100%;
}
.c-hero-image-side img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center right;
}
.c-hero-content-side {
flex: 0 0 42%;
background-color: #ff2b56;
display: flex;
align-items: center;
justify-content: center;
position: relative;
text-align: center;
height: 100%;
}
.c-hero-text-wrapper {
padding: 0 40px;
display: flex;
flex-direction: column;
align-items: center;
z-index: 2;
}
.c-hero-title {
color: #ffffff;
font-size: clamp(45px, 4vw, 75px);
font-weight: 900;
line-height: 1.15;
margin-bottom: 20px;
}
.c-hero-subtitle {
color: #ffffff;
font-size: clamp(16px, 1.5vw, 22px);
font-weight: 400;
line-height: 1.6;
margin-bottom: 40px;
max-width: 90%;
}
.c-hero-btn {
background-color: #ffffff;
color: #ff2b56;
text-decoration: none;
font-size: 18px;
font-weight: 700;
padding: 12px 55px;
border-radius: 50px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
display: inline-block;
}
.c-hero-btn:hover {
transform: translateY(-4px);
box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.c-hero-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 48px;
height: 48px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
cursor: default; /* Decorative as requested, keeps visual accuracy */
z-index: 10;
}
.c-prev {
left: 30px;
background-color: rgba(255, 255, 255, 0.4);
border: 1px solid rgba(255, 255, 255, 0.9);
}
.c-next {
right: 30px;
background-color: rgba(255, 255, 255, 0.2);
border: 1px solid #ffffff;
}
/* Responsive Setup for Mobile/Tablet */
@media (max-width: 1024px) {
.custom-split-hero {
flex-direction: column-reverse;
height: auto;
}
.c-hero-image-side {
flex: none;
width: 100%;
height: 350px;
}
.c-hero-content-side {
flex: none;
width: 100%;
padding: 60px 20px;
}
.c-hero-arrow {
display: none; /* Hidden on mobile for cleaner UX */
}
}
`;
document.head.appendChild(style);
// Safely hide the original slider and insert the new one in its exact place
originalSlider.style.display = 'none';
originalSlider.parentNode.insertBefore(newHero, originalSlider.nextSibling);
}
// Initialize logic safely
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', buildCustomHero);
} else {
buildCustomHero();
}
// Fallback execution to catch Salla's lazy-loaded slider components
window.addEventListener('load', buildCustomHero);
setTimeout(buildCustomHero, 1500);
})();
document.addEventListener('DOMContentLoaded', function() {
const searchBtn = document.querySelector('button[data-selia="header-search-button"]');
if (searchBtn) {
// 1. Inject CSS for pure Flexbox layout (no absolute positioning)
const style = document.createElement('style');
style.textContent = `
/* Hide any pseudo-element text injected previously */
button[data-selia="header-search-button"]::before,
button[data-selia="header-search-button"]::after {
display: none !important;
content: none !important;
}
/* Desktop Layout - Pure Flexbox */
@media (min-width: 1024px) {
button[data-selia="header-search-button"] {
display: flex !important;
flex-direction: row !important; /* Native RTL places first child on the right */
align-items: center !important;
justify-content: space-between !important; /* Pushes text Right, Icon Left */
width: 220px !important; /* Width of the bottom line */
border-bottom: 1px solid #e0e0e0 !important;
padding-bottom: 6px !important;
background: transparent !important;
padding-left: 0 !important;
padding-right: 0 !important;
}
.custom-search-svg {
width: 20px !important;
height: 20px !important;
fill: var(--store-text-primary, #111827) !important;
flex-shrink: 0 !important; /* Prevents icon from squishing */
}
.js-search-text {
font-family: var(--font-main), sans-serif;
font-weight: 700;
font-size: 14px;
color: var(--store-text-primary, #111827);
white-space: nowrap !important;
}
}
/* Mobile Layout (Hide text, center icon) */
@media (max-width: 1023px) {
.js-search-text {
display: none !important;
}
button[data-selia="header-search-button"] {
border: none !important;
width: auto !important;
padding: 0 !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
}
.custom-search-svg {
width: 24px !important;
height: 24px !important;
fill: var(--store-text-primary, #111827) !important;
}
}
`;
document.head.appendChild(style);
// 2. Inject HTML Structure
searchBtn.innerHTML = `
البحث
`;
}
});