/* ملف: assets/css/style.css */

/* التنسيق الأساسي CSS */
:root {
/* ألوان محدثة */
--primary-yellow: #f8c000;
--dark-grey: #343A40;
--header-dark: #2a2f35;
--background-white: #ffffff;
--text-dark: #111111;
--light-gray-bg: #f4f4f4;
--product-card-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
--product-card-hover-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);

/* 🔴🔴 إضافة لون Header جديد أقرب للرمادي الداكن/الأسود مثل أمازون 🔴🔴 */
--amazon-dark: #232f3e;
}

/* خط عربي إضافي لخط أكثر جمالية */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&display=swap');

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Cairo', 'Arial', sans-serif;
}

body {
background-color: var(--light-gray-bg);
color: var(--text-dark);
line-height: 1.6;
overflow-x: hidden;
}

a {
text-decoration: none;
color: var(--dark-grey);
transition: color 0.3s;
}

a:hover {
color: var(--primary-yellow);
}

/* 1. رأس الصفحة (Header) - تنسيقات الكمبيوتر والموبايل */
.header {
/* 🔴🔴 استخدام اللون الداكن الجديد 🔴🔴 */
background-color: var(--amazon-dark);
color: var(--background-white);
/* تقليل التباعد العلوي والسفلي في الكمبيوتر */
padding: 5px 30px;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
position: sticky;
top: 0;
z-index: 1000;
}

/* ⭐️⭐️ تم التعديل: زيادة حجم الخط للشعار في وضع الكمبيوتر إلى 48px ⭐️⭐️ */
.logo {
font-size: 48px;
font-weight: 900;
color: var(--primary-yellow);
margin-left: 20px;
letter-spacing: 0.5px;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* شريط البحث - تنسيقات الكمبيوتر */
.search-bar {
flex-grow: 1;
display: flex;
max-width: 700px;
border-radius: 6px;
overflow: hidden;
border: 1px solid transparent;
transition: border-color 0.3s ease;
margin: 0 20px;
}
.search-bar:focus-within {
border-color: var(--primary-yellow);
box-shadow: 0 0 8px rgba(248, 192, 0, 0.6);
}

.search-input {
width: 100%;
padding: 12px 15px;
border: none;
background-color: var(--background-white);
color: var(--text-dark);
font-size: 16px;
border-radius: 6px 0 0 6px;
}

.search-button {
background-color: var(--primary-yellow);
color: var(--dark-grey);
border: none;
padding: 12px 20px;
cursor: pointer;
font-size: 18px;
transition: background-color 0.3s;
border-radius: 0 6px 6px 0;
}

.search-button:hover {
background-color: #ffda5a;
}

/* عناصر التنقل في الرأس */
.header-nav {
display: flex;
align-items: center;
}
.header-nav a {
color: var(--background-white);
padding: 8px 10px;
margin-right: 5px;
font-size: 15px;
display: flex;
flex-direction: column;
align-items: center;
line-height: 1.2;
transition: color 0.3s, transform 0.2s;
/* إخفاء افتراضي لأيقونات الكمبيوتر (غير تتبع الشحنة) */
display: none;
}

/* إظهار أيقونة تتبع الشحنة فقط في وضع الكمبيوتر */
.header-nav .track-shipment-link {
display: flex !important;
position: relative;
}

.header-nav a:hover {
color: var(--primary-yellow);
transform: translateY(-2px);
}

.header-nav a i {
font-size: 20px;
margin-bottom: 3px;
}

.cart-count {
background-color: #ff0000;
color: var(--background-white);
padding: 2px 6px;
border-radius: 50%;
font-size: 12px;
position: absolute;
top: 5px;
right: 0px;
}


/* ---------------------------------------------------------------------------------- */
/* 2. المحتوى الرئيسي والسلايدر (Hero Banner) */

.main-content {
/* تم تقليل التباعد العلوي لتقريب البانر من الهيدر */
padding: 5px 0 10px 0;
max-width: 1400px;
margin: 0 auto;
}

/* تنسيقات السلايدر: عرض كامل (Full Width Banner) */
.hero-slider.two-column-layout {
display: block;
position: relative;
/* المسافة أسفل البانر */
margin-bottom: 10px;
border-radius: 0;
box-shadow: none;
overflow: hidden;
background-color: transparent;
min-height: unset;
}

/* الشريحة الواحدة (slide) */
.hero-slider .slide {
display: none;
width: 100%;
/* 🔴🔴 زيادة ارتفاع البانر في الكمبيوتر إلى 400 بكسل 🔴🔴 */
height: 400px;
position: relative;
align-items: center;
justify-content: center;
text-align: right;
direction: rtl;
background-color: transparent;
}

.hero-slider .slide.active {
display: flex;
}

/* إخفاء مربع النص بالكامل في جميع الشاشات */
.hero-text-content {
display: none !important;
}

/* الصورة الخلفية تملأ الشريحة بالكامل */
.hero-animated-image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
/* الأهم: ضمان تغطية الصورة لمساحة البانر بالكامل */
object-fit: cover;
border-radius: 0;
box-shadow: none;
animation: none;
}

/* ---------------------------------------------------- */
/* 3. تنسيقات قسم الأيقونات الدائرية الثابتة (بدون عنوان) */
/* ---------------------------------------------------- */

.category-slider-section {
max-width: 1400px;
/* 🔴🔴 التعديل لزيادة المسافة العلوية (margin-top: 20px) 🔴🔴 */
margin: 20px auto 30px;
/* 🔴🔴 التعديل لزيادة المساحة العلوية (padding-top: 15px) لاستيعاب الحركة 🔴🔴 */
padding: 15px 30px 0;
}

.category-slider {
display: flex;
/* توزيع الأيقونات بالتساوي عبر المساحة المتاحة */
justify-content: space-around;
gap: 15px;
flex-wrap: wrap;
}

.category-card {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
/* تثبيت عرض الأيقونة */
width: 100px;
transition: transform 0.3s, box-shadow 0.3s;
/* مهم جداً لجعل الروابط الثابتة لا تؤثر على شكل المؤثرات */
cursor: default;
}

/* 💀 مؤثر "موت الموت" عند المرور بالماوس 💀 */
.category-card:hover {
/* الارتفاع لأعلى هو 5px */
transform: translateY(-5px) scale(1.05);
cursor: pointer; /* إرجاع مؤشر اليد عند المرور */
}

.category-icon-wrapper {
/* حجم الدائرة (أكبر قليلاً في الكمبيوتر) */
width: 100px;
height: 100px;
border-radius: 50%;
background-color: var(--background-white);
box-shadow: var(--product-card-shadow);
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 0;
overflow: hidden;
border: 3px solid transparent;
transition: border-color 0.4s, box-shadow 0.4s;
}

/* 💀 مؤثر "موت الموت" على الدائرة نفسها 💀 */
.category-card:hover .category-icon-wrapper {
border-color: var(--primary-yellow);
box-shadow: 0 0 15px var(--primary-yellow); /* توهج أصفر */
}

.category-image {
width: 100%; /* جعل الصورة 100% من حجم الحاوية */
height: 100%;
/* 🔴🔴 الأهم: جعل الصورة تملأ الدائرة بالكامل دون تشوه (مع اقتصاص الأجزاء الزائدة) 🔴🔴 */
object-fit: cover;
transition: transform 0.4s;
}

/* تكبير بسيط للصورة داخل الدائرة عند المرور بالماوس */
.category-card:hover .category-image {
transform: scale(1.1);
}

/* إخفاء اسم الفئة */
.category-name {
display: none;
}
/* ---------------------------------------------------- */


/* باقي تنسيقات المنتجات والتذييل */

@keyframes pulse {
from { transform: scale(1); }
to { transform: scale(1.02); }
}

/* قائمة المنتجات */
h2 {
font-size: 28px;
color: var(--dark-grey);
margin-bottom: 20px;
padding: 0 30px 5px;
border-bottom: 2px solid #e0e0e0;
max-width: 1400px;
margin: 0 auto 20px;
}

.product-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 25px;
padding: 0 30px;
}

.product-card {
background-color: var(--background-white);
padding: 15px;
border-radius: 8px;
box-shadow: var(--product-card-shadow);
text-align: right;
transition: transform 0.4s, box-shadow 0.4s;
border: 1px solid transparent;
}

.product-card:hover {
transform: translateY(-8px) scale(1.01);
box-shadow: var(--product-card-hover-shadow);
border-color: var(--primary-yellow);
}

.product-image {
width: 100%;
/* زيادة ارتفاع الصورة لتكون أكبر */
height: 220px;
/* التعديل الثاني: استخدام 'cover' لملء المساحة بالكامل */
object-fit: cover;
margin-bottom: 15px;
border-radius: 4px;
/* إضافة تأثير تكبير عند مرور الماوس على الصورة */
transition: transform 0.3s ease-in-out;
}

.product-card:hover .product-image {
transform: scale(1.05); /* تكبير الصورة قليلاً عند التحويم */
}

.product-card h3 {
font-size: 17px;
color: var(--dark-grey);
margin-bottom: 5px;
height: 40px;
overflow: hidden;
font-weight: 700;
}

.product-rating {
color: #ffc107;
margin-bottom: 10px;
font-size: 14px;
}

.product-price {
font-size: 24px;
color: #cc0000;
font-weight: 900;
margin-bottom: 15px;
direction: ltr;
text-align: left;
}
.product-price span {
font-size: 16px;
font-weight: 400;
color: #555;
margin-right: 5px;
text-decoration: line-through;
}

/* 🔴🔴 تم تعديل الزر ليناسب وسم <a> بدلاً من <button> 🔴🔴 */
.add-to-cart {
background-color: var(--primary-yellow);
color: var(--dark-grey);
border: none;
padding: 10px 15px;
border-radius: 50px;
cursor: pointer;
font-weight: bold;
font-size: 15px;
/* مهم جداً لجعل الرابط يملأ عرض البطاقة */
width: 100%;
display: block;
text-align: center;
transition: background-color 0.3s, transform 0.2s;
}

.add-to-cart:hover {
background-color: #ffda5a;
transform: translateY(-2px);
}

/* تذييل الصفحة (Footer) */
.footer {
background-color: var(--dark-grey);
color: #ccc;
padding: 30px 20px 15px;
margin-top: 40px;
}
.footer-content {
display: flex;
justify-content: space-around;
max-width: 1200px;
margin: 0 auto 15px;
text-align: right;
flex-wrap: wrap;
}
.footer-column {
flex: 1;
min-width: 200px;
margin-bottom: 20px;
padding: 0 15px;
}
.footer-column h4 {
color: var(--primary-yellow);
margin-bottom: 12px;
font-size: 17px;
border-bottom: 1px solid #555;
padding-bottom: 5px;
}
.footer-column a {
display: block;
color: #ccc;
margin-bottom: 6px;
font-size: 13px;
transition: color 0.2s;
}
.footer-column a:hover {
color: var(--primary-yellow);
}

.footer-bottom {
text-align: center;
border-top: 1px solid #555;
padding-top: 15px;
margin-top: 15px;
}

.footer-bottom p {
font-size: 13px;
color: #888;
}

/* ---------------------------------------------------------------------------------- */
/* 4. تنسيقات صفحة الشراء (checkout.php) */
/* ---------------------------------------------------------------------------------- */

.checkout-container {
  max-width: 600px;
  margin: 40px auto;
  padding: 30px;
  background-color: var(--background-white);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: right;
  direction: rtl;
}

.checkout-title {
  font-size: 30px;
  color: var(--dark-grey);
  margin-bottom: 25px;
  border-bottom: 2px solid var(--light-gray-bg);
  padding-bottom: 10px;
}

.product-details-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.checkout-product-img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
}

.details-text {
  flex-grow: 1;
}

.details-text h3 {
  font-size: 20px;
  margin-bottom: 5px;
  color: var(--text-dark);
}

.details-text p {
  font-size: 16px;
  color: #555;
}

#unit-price {
  font-weight: bold;
  color: #008000;
}

.quantity-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  padding: 10px 0;
  border-top: 1px dashed #e0e0e0;
}

.quantity-selector label {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark-grey);
}

.quantity-selector input {
  width: 80px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  text-align: center;
  font-size: 16px;
}

.total-price-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-top: 2px solid var(--primary-yellow);
  margin-bottom: 30px;
}

.total-price-section h4 {
  font-size: 24px;
  color: var(--text-dark);
}

.total-price-value {
  font-size: 32px;
  font-weight: 900;
  color: #cc0000;
}

.whatsapp-button {
  width: 100%;
  padding: 15px 20px;
  background-color: #25D366; /* لون الواتساب */
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.whatsapp-button:hover {
  background-color: #128C7E;
}

.whatsapp-button i {
  font-size: 24px;
  margin-left: 10px;
}

.alert-message {
  text-align: center;
  margin-top: 20px;
  padding: 15px;
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  border-radius: 5px;
  font-size: 14px;
}

/* ---------------------------------------------------------------------------------- */
/* تنسيقات قسم المنتجات الأكثر مبيعاً (بعد إزالة الـ inline styles من PHP) */
/* ---------------------------------------------------------------------------------- */
.topsellers-section {
    margin-top: 40px;
    padding: 25px 0;
    background-color: transparent;
    border-top: none;
}
.topsellers-title {
    text-align: right;
    color: var(--dark-grey);
    margin-bottom: 30px;
    font-weight: bold;
    font-size: 1.8em;
    max-width: 1200px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 20px;
    border-bottom: 2px solid #e0e0e0;
}
.topsellers-title i {
    color: #ffc107;
    margin-left: 10px;
}
.topseller-card {
    position: relative;
}
.topseller-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
    z-index: 10;
}
.no-products-message {
    grid-column: 1 / -1; 
    text-align: center; 
    padding: 50px; 
    color: #777;
    width: 100%;
}


/* ---------------------------------------------------------------------------------- */
/* Media Queries للتجاوبية (Responsive Design) */
/* ---------------------------------------------------------------------------------- */
@media (max-width: 1200px) {
.product-grid {
grid-template-columns: repeat(3, 1fr);
}
}

@media (max-width: 992px) {
.product-grid {
grid-template-columns: repeat(2, 1fr);
}
}

/* 🔴🔴🔴 التعديلات الخاصة بالهاتف المحمول (Mobile - أقل من 768 بكسل) 🔴🔴🔴 */
@media (max-width: 768px) {

    /* تنسيقات صفحة الشراء في الموبايل */
    .checkout-container {
        margin: 20px 15px;
        padding: 20px;
    }
    .total-price-value {
        font-size: 26px;
    }
    .whatsapp-button {
        font-size: 18px;
    }
    .product-details-summary {
        flex-direction: column;
        text-align: center;
    }
    .checkout-product-img {
        width: 150px;
        height: 150px;
        margin-bottom: 10px;
    }


/* [كود الهيدر والمحتويات الأخرى] */
.header {
flex-wrap: wrap;
justify-content: space-between;
padding: 3px 15px;
}

/* ⭐️⭐️ تم التعديل: زيادة حجم الخط للشعار في وضع الموبايل إلى 32px ⭐️⭐️ */
.logo {
width: auto;
text-align: right;
margin: 0;
order: 1;
font-size: 32px;
}

.search-bar {
order: 3;
width: 100%;
margin: 5px 0 0;
}

.search-input {
padding: 6px 15px;
}

.search-button {
padding: 6px 15px;
font-size: 14px;
}

.header-nav .track-shipment-link {
font-size: 12px;
}
.header-nav .track-shipment-link i {
font-size: 18px;
}

.header-nav {
order: 2;
width: auto;
justify-content: flex-end;
margin-right: 0;
}

.header-nav a {
display: none !important;
}

.main-content {
padding: 5px 0 15px 0;
}

/* 🔴🔴 زيادة ارتفاع البانر في الموبايل إلى 200 بكسل 🔴🔴 */
.hero-slider .slide {
height: 200px;
}

/* تنسيقات الأيقونات الدائرية في الموبايل */
.category-slider-section {
margin: 15px auto 20px;
padding: 15px 15px 0;
}

.category-slider {
flex-wrap: nowrap;
justify-content: space-between;
overflow-x: auto;
gap: 5px;
padding-bottom: 5px;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
}

.category-slider::-webkit-scrollbar {
display: none;
}

.category-card {
min-width: 80px;
width: 80px;
flex-shrink: 0;
}

.category-icon-wrapper {
width: 80px;
height: 80px;
}

/* 🔴🔴 التعديلات على صور المنتجات في الموبايل 🔴🔴 */
h2 {
padding: 0 15px 5px;
}

/* ❌❌ التعديل الحاسم: تحويل من Grid إلى Flexbox لضمان 2 في السطر ❌❌ */
.product-grid {
/* إلغاء تنسيق Grid */
display: flex; 
flex-wrap: wrap;
justify-content: space-between; /* للتوزيع على الطرفين */
gap: 10px; /* مسافة بين العناصر */
padding: 0 15px;
/* تم حذف: grid-template-columns: repeat(2, 1fr); */
}

/* ❌❌ التعديل الحاسم: فرض العرض على بطاقة المنتج لتكون 2 في السطر ❌❌ */
.product-card {
width: 48%; /* 48% + 48% = 96%، تاركاً 4% للمسافة/الهوامش */
min-width: 150px; /* لضمان ألا تضيق جداً */
box-sizing: border-box; /* للتأكد من حساب الحشو والحدود ضمن العرض 48% */
padding: 10px;
margin-bottom: 10px; /* مسافة بين صفوف المنتجات */
}

.product-image {
/* زيادة ارتفاع الصورة في الموبايل */
height: 150px;
object-fit: cover; /* لضمان ملء المساحة */
margin-bottom: 8px;
}

.product-card h3 {
font-size: 15px;
height: 35px;
}
.product-price {
font-size: 20px;
margin-bottom: 10px;
}
.add-to-cart {
padding: 8px 10px;
font-size: 13px;
}

.footer-content {
flex-direction: column;
text-align: center;
}
.footer-column {
min-width: unset;
width: 100%;
}
}