/* 1. المتغيرات الأساسية */
:root {
    --bs-font-sans-serif: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
    --bs-body-color: #1a3047;
    --bs-body-bg: #f8f9fa;
}
*, ::after, ::before { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--bs-body-font-family);
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
}

/* 2. الهوية (النافبار والصورة) */
.navbar { 
    background-color: #ffffff; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); /* ظل أنعم للنافبار */
}
.navbar-brand img { max-height: 60px; }

/* 3. قسم الهيرو (الترحيب) - اللمسة العصرية */
.hero-section { 
    background: linear-gradient(135deg, #1a3047 0%, #2a4a6b 100%); /* تدرج لوني أزرق فخم */
    color: white; 
    padding: 60px 0; 
    text-align: center; 
    border-bottom: 4px solid #d1202f; /* شريط أحمر يعكس هوية كندش */
}
.hero-section h1 { 
    color: #ffffff; /* أبيض ناصع بدلاً من الأحمر ليبرز على الخلفية الزرقاء */
    font-weight: 900; 
    margin-bottom: 20px; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.3); /* ظل خفيف للنص لسهولة القراءة */
}
.hero-section p.lead { 
    font-size: 20px; 
    color: #e2e8f0; 
}

/* 4. مربعات الأقسام (تصميم Soft UI) */
.category-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #f1f5f9; /* حدود ناعمة جداً بدلاً من الصلبة */
    border-radius: 16px; /* حواف أكثر دائرية وانسيابية */
    height: 80px;
    padding: 0 20px;
    text-decoration: none;
    color: #1a3047;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.04), 0 2px 4px -1px rgba(0,0,0,0.02); /* ظل ناعم */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* 5. تأثيرات التحويم (Hover) التفاعلية */
.category-box:hover {
    transform: translateY(-5px); /* ارتفاع ناعم للأعلى */
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    border-color: #e2e8f0;
}

.category-box:hover h5 {
    color: #d1202f;
}

.category-box h5 {
    margin: 0;
    font-weight: bold;
    font-size: 16px;
    transition: color 0.3s ease;
    z-index: 1;
}

/* شريط أحمر جمالي يظهر من اليمين عند التحويم */
.category-box::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #d1202f;
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: bottom;
}
.category-box:hover::before {
    transform: scaleY(1);
}

/* 6. تنسيق أيقونات الأقسام داخل المربع */
.cat-icon, .category-box i {
    background: #f8f9fa; /* خلفية دائرية خفيفة للأيقونة */
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #d1202f;
    font-size: 20px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    z-index: 1;
}

.category-box:hover i, .category-box:hover .cat-icon {
    background: #d1202f;
    color: #ffffff;
    transform: scale(1.1); /* تكبير الأيقونة قليلاً عند تمرير الماوس */
}

/* --- 7. التحكم المباشر بحجم أيقونات الأقسام (SVG) --- */
.category-box svg {
    width: 75px !important;  /* قم بزيادة هذا الرقم لتكبير الأيقونة */
    height: 75px !important; /* يجب أن يكون نفس الرقم السابق */
    transition: all 0.3s ease;
}

/* تأثير تكبير إضافي وناعم للأيقونة عند تمرير الماوس */
.category-box:hover svg {
    transform: scale(1.15);
}

.hero-section svg {
    max-width: 50px !important;
    max-height: 50px !important;
    margin: 0 auto 15px auto; /* لتوسيطها وإبعاد النص عنها قليلاً */
    display: block;
}

/* =========================================
   8. تنسيقات البطاقات المصغرة جداً (Mini Cards)
   ========================================= */
.product-card { 
    border: 1px solid #e9ecef; 
    border-radius: 15px; 
    overflow: hidden; 
    transition: 0.3s; 
    display: flex; 
    flex-direction: column; 
    height: 100%;
    background: white;
    position: relative; /* لعمل الرابط الممتد */
}
.product-card:hover { 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
    border-color: #d1202f; 
}

/* الحاوية المربعة الذكية (مربع داخل البطاقة) لثبات الأبعاد وتجاوبها */
.image-wrapper {
    width: 100%;
    position: relative;
    padding-top: 100%; /* نسبة 1:1 تجعلها مربعة تماماً دائماً */
    background: #ffffff;
    overflow: hidden;
}
.image-wrapper img, .image-wrapper .no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* إظهار الصورة كاملة دون أي قص */
    padding: 12px; /* مسافة أمان داخلية لتنفس الصورة */
}

.card-body {
    padding: 10px 12px; 
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-name { 
    font-weight: 800; 
    color: #1a3047; 
    font-size: 13px; 
    margin-bottom: 4px; 
    /* تنسيق السطر الواحد الموحد للخط */
    white-space: nowrap;       
    overflow: hidden;          
    text-overflow: ellipsis;   
    display: block;            
    height: 20px;              
}

.product-price-container {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.product-price { 
    font-weight: 900; 
    color: #d1202f; 
    font-size: 14px; 
}
.product-unit {
    font-weight: 800;
    color: #1a3047;
    font-size: 12px;
}

.btn-details { 
    border: 2px solid #1a3047; 
    color: #1a3047; 
    font-weight: bold; 
    border-radius: 8px; 
    padding: 6px 0; 
    font-size: 12px;
    width: 100%; 
    transition: 0.3s; 
    text-decoration: none;
    display: inline-block;
    position: relative;
    z-index: 2; /* ليبقى الزر أعلى رابط المربع */
}
.btn-details:hover { 
    background: #1a3047; 
    color: white; 
}

/* =========================================
   9. تنسيق شريط الصور (Swiper Filmstrip)
   ========================================= */
.swiper.mySwiper {
    width: 100% !important;
    height: 200px !important;
    padding-bottom: 35px !important;
}

.swiper-slide.custom-slide {
    border-radius: 12px !important;
    overflow: hidden !important;
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    height: 100% !important;
}

.swiper-slide.custom-slide img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.swiper-slide-active {
    transform: scale(1);
    opacity: 1;
}

.swiper-slide:not(.swiper-slide-active) {
    transform: scale(0.88);
    opacity: 0.5;
}

/* Navigation Buttons */
.swiper-button-next,
.swiper-button-prev {
    color: #d1202f !important;
    background-color: rgba(255, 255, 255, 0.85) !important; 
    width: 35px !important;
    height: 35px !important;
    border-radius: 50% !important; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 14px !important;
    font-weight: bold !important;
}

/* Mobile Compatibility */
@media (max-width: 768px) {
    .swiper.mySwiper {
        height: 90px !important;
    }
}