* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Cairo', sans-serif; }
:root { 
    --brand-green: #a1cc4a; 
    --header-bg: #2a2a2a; 
    --bg-white: #ffffff; 
    --bg-light: #f9f9f9; 
    --text-dark: #111111;
    --text-gray: #555555;
}

body { background-color: var(--bg-white); color: var(--text-dark); overflow-x: hidden; }

/* --- الهيدر والسلة في الشريط العلوي --- */
.main-header { background-color: var(--header-bg); width: 100%; position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 5%; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 13px; color: #ccc; }
.lang-switch button { background: none; border: none; color: #888; cursor: pointer; font-family: inherit; font-weight: bold; }
.lang-switch button.active { color: var(--brand-green); }
.contact-quick { cursor: pointer; transition: color 0.3s; }
.contact-quick:hover { color: var(--brand-green); }

.cart-icon { position: relative; color: #fff; font-size: 18px; cursor: pointer; transition: 0.3s; margin: 0 15px; display: flex; align-items: center;}
.cart-icon:hover { color: var(--brand-green); transform: scale(1.1); }
#cart-count { position: absolute; top: -6px; right: -10px; background: var(--brand-green); color: #000; font-size: 10px; font-weight: bold; width: 16px; height: 16px; border-radius: 50%; display: flex; justify-content: center; align-items: center; }

.navbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 5%; }
.logo img { max-width: 160px; cursor: pointer; }
.nav-links { display: flex; gap: 25px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; position: relative; white-space: nowrap; transition: 0.3s; }
.nav-links a:hover, .nav-links a.active-link { color: var(--brand-green); }
.nav-links a.highlight-link { color: var(--brand-green); font-weight: 800; }

/* --- البنر --- */
.hero-lifestyle {
    height: 70vh;
    min-height: 400px;
    background-color: #333; 
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background-image 1.5s ease-in-out;
    background-image: url('../images/banners/bg.jpg'); /* الصورة الافتراضية قبل التحميل */
}
.hero-lifestyle::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); }

.hero-content-box { 
    position: relative; 
    z-index: 10; 
    text-align: center; 
    color: #fff; 
    width: 95%; 
    padding: 20px 10px; 
    overflow: hidden; 
}

/* إجبار العبارة الرئيسية على سطر واحد باستخدام nowrap */
.hero-content-box h1 { 
    font-size: clamp(1rem, 3.5vw, 4rem); 
    font-weight: 800; 
    margin-bottom: 25px; 
    color: #fff; 
    white-space: nowrap; 
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    width: 100%;
}

/* إجبار العبارة الفرعية (المستطيل) على سطر واحد باستخدام nowrap */
.subtitle-box {
    display: inline-block;
    background-color: var(--brand-green);
    color: #000;
    padding: 8px 25px;
    border-radius: 4px;
    font-size: clamp(0.8rem, 1.5vw, 1.3rem);
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    white-space: nowrap; 
    max-width: 100%; 
}

/* --- شبكة المربعات الأفقية --- */
.slider-wrapper { padding: 50px 0; background: var(--bg-white); overflow: hidden; direction: ltr; }
.products-track { display: flex; gap: 20px; padding-right: 20px; width: max-content; animation: scroll-left 40s linear infinite; }
.products-track:hover { animation-play-state: paused; }
@keyframes scroll-left { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.cat-card { width: 200px; text-align: center; cursor: pointer; flex-shrink: 0; transition: 0.3s; }
.cat-img-wrap { width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 15px; overflow: hidden; border: 2px solid #eee; transition: 0.3s; }
.cat-card:hover .cat-img-wrap { border-color: var(--brand-green); transform: scale(1.05); }
.cat-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.cat-title { font-weight: 700; color: var(--text-dark); font-size: 1.1rem;}

/* --- شبكة المنتجات --- */
.section-header h2 { font-size: clamp(2rem, 4vw, 3rem); color: var(--text-dark); margin-bottom: 10px; font-weight: 800;}
.masonry-grid { column-count: 4; column-gap: 25px; padding: 20px 0; }
.product-item { break-inside: avoid; margin-bottom: 25px; background: var(--bg-white); border: 1px solid #eee; border-radius: 12px; overflow: hidden; transition: 0.3s; text-align: right; }
.product-item:hover { box-shadow: 0 15px 35px rgba(0,0,0,0.08); border-color: #ddd; transform: translateY(-5px);}
.p-img-wrap { position: relative; overflow: hidden; background: var(--bg-light); cursor: pointer;}
.p-img-wrap img { width: 100%; display: block; transition: transform 0.5s ease; }
.product-item:hover .p-img-wrap img { transform: scale(1.08); }
.p-details { padding: 20px; }
.p-price-box { margin-bottom: 15px; }
.p-price-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 14px; color: var(--text-gray); font-weight: 600;}
.p-flag { width: 18px; height: 18px; border-radius: 50%; }
.p-val { color: var(--text-dark); font-weight: 800; font-size: 16px; }
.add-cart-btn { width: 100%; background: var(--bg-light); color: var(--text-dark); border: 1px solid #ddd; padding: 12px 0; border-radius: 8px; font-weight: 700; font-size: 15px; cursor: pointer; transition: 0.3s; display: flex; justify-content: center; align-items: center; gap: 8px; }
.add-cart-btn:hover { background: var(--brand-green); color: #000; border-color: var(--brand-green); }

/* --- السلة الجانبية --- */
.cart-sidebar { position: fixed; top: 0; right: -400px; width: 400px; max-width: 100%; height: 100vh; background: #fff; z-index: 2000; box-shadow: -5px 0 30px rgba(0,0,0,0.1); transition: right 0.4s ease; display: flex; flex-direction: column; }
.cart-sidebar.open { right: 0; }
.cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1999; display: none; }
.cart-header { padding: 25px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.cart-header h2 { font-size: 1.5rem; color: var(--text-dark); font-weight: 700;}
.close-cart { background: none; border: none; font-size: 30px; color: var(--text-gray); cursor: pointer; }
.cart-items { flex-grow: 1; overflow-y: auto; padding: 20px; }
.cart-item { display: flex; gap: 15px; border-bottom: 1px solid #f5f5f5; padding-bottom: 15px; margin-bottom: 15px; }
.cart-item img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
.cart-item-info { flex-grow: 1; }
.cart-item-info p { font-size: 13px; color: var(--text-gray); margin-bottom: 5px; font-weight: 600;}
.cart-item-info h4 { color: var(--text-dark); font-size: 15px; font-weight: 700;}
.del-btn { color: #ff4d4d; background: none; border: none; cursor: pointer; font-size: 16px; margin-top: 5px;}
.cart-footer { padding: 25px; background: var(--bg-light); border-top: 1px solid #eee; }
.cart-total { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 20px; color: var(--text-dark); font-size: 1.2rem;}
.checkout-btn { width: 100%; background: #25D366; color: #fff; border: none; padding: 15px; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; margin-bottom: 10px; display: flex; justify-content: center; gap: 10px; }
.clear-cart-btn { width: 100%; background: transparent; color: var(--text-gray); border: 1px solid #ddd; padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer; }

/* أزرار التحميل --- */
.load-more-btn { background: var(--text-dark); color: #fff; border: none; padding: 12px 40px; border-radius: 30px; font-weight: 700; font-size: 16px; cursor: pointer; }
.back-to-home-btn { background: none; color: var(--text-dark); border: 2px solid var(--text-dark); padding: 10px 30px; border-radius: 30px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; transition: 0.3s; }
.back-to-home-btn:hover { background: var(--text-dark); color: #fff; }

/* --- المودال والتذييل --- */
.modal { display: none; position: fixed; z-index: 3000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); justify-content: center; align-items: center; padding: 20px; }
.modal-content { background: #fff; padding: 40px; border-radius: 20px; text-align: center; max-width: 400px; position: relative; }
.c-card { background: var(--bg-light); padding: 20px; border-radius: 15px; margin-bottom: 20px; border: 1px solid #eee;}
.c-actions { display: flex; gap: 10px; margin-top: 15px;}
.c-btn { flex: 1; padding: 10px; border-radius: 8px; color: #fff; text-decoration: none; font-weight: bold; }
.c-btn.call { background: #333; } .c-btn.wa { background: #25D366; }
.close-btn { position: absolute; top: 15px; left: 20px; font-size: 30px; cursor: pointer; color: #333; }
.modal-img-content { max-width: 90%; max-height: 90vh; border-radius: 10px; }
.footer { background: var(--bg-light); padding: 60px 5% 30px; text-align: center; border-top: 1px solid #eee; }
.social-icons { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; }
.social-icons a { width: 45px; height: 45px; border-radius: 50%; background: #eee; color: var(--text-dark); display: flex; justify-content: center; align-items: center; font-size: 1.2rem; transition: 0.3s; }
.social-icons a:hover { background: var(--brand-green); color: #000; transform: translateY(-5px); }

/* --- التجاوب مع الجوال --- */
@media (max-width: 992px) { .masonry-grid { column-count: 3; } }
@media (max-width: 768px) {
    .top-bar { padding: 12px 10px; }
    .cart-icon { margin: 0; font-size: 20px; }
    .navbar { flex-direction: column; gap: 15px; padding: 15px; }
    .nav-links { width: 100%; justify-content: flex-start; padding-bottom: 10px; }
    .masonry-grid { column-count: 2; column-gap: 15px; }
    
    /* في الجوال: إبقاء سطر واحد مع تصغير ذكي للخط (vw) */
    .hero-content-box h1 { font-size: 4.5vw; }
    .subtitle-box { font-size: 3.5vw; padding: 5px 15px; }
    
    .cart-sidebar { width: 100%; right: -100%; }
}
@media (max-width: 480px) { .masonry-grid { column-count: 1; } }