/* ============================================
   PRODUCTS PAGE - COLORS & CTA (Phase P2)
   صفحة المنتجات - الألوان والأزرار فقط
   ============================================ */

/* 🎯 Phase P2: Colors & CTA Hierarchy Only

   ✅ مسموح في P2:
   - تغيير لون Header
   - تحديد Primary CTA واحد
   - تحويل باقي الأزرار Secondary

   ❌ ممنوع في P2:
   - تغيير Cards
   - تغيير Layout
   - تغيير Spacing
   - تغيير Typography

*/

/* ====================================
   🎯 NAMESPACE: body.page-products
   ==================================== */

/* 1️⃣ Header - توحيد مع المنصة */
body.page-products .navbar.eco,
.page-products .navbar.eco,
body.page-products header.navbar,
.page-products header.navbar {
    background: #013B2B !important;
    background-color: #013B2B !important;
    background-image: none !important;
}

/* 2️⃣ Primary CTA - "بحث" (Search Button) ONLY */
body.page-products .search-section .btn-primary,
.page-products .search-section button[type="submit"].btn-primary {
    background-color: #065F46 !important;
    background: #065F46 !important;
    border-color: #065F46 !important;
    color: #FFFFFF !important;
}

body.page-products .search-section .btn-primary:hover,
.page-products .search-section button[type="submit"].btn-primary:hover {
    background-color: #047857 !important;
    background: #047857 !important;
    border-color: #047857 !important;
    color: #FFFFFF !important;
}

/* 3️⃣ Secondary CTAs - Product Card Buttons (التفاصيل) */
body.page-products .product-card .btn-primary,
.page-products .product-card a.btn-primary,
.page-products .product-card-footer .btn-primary {
    background-color: transparent !important;
    background: transparent !important;
    border: 2px solid #065F46 !important;
    color: #065F46 !important;
}

body.page-products .product-card .btn-primary:hover,
.page-products .product-card a.btn-primary:hover,
.page-products .product-card-footer .btn-primary:hover {
    background-color: #065F46 !important;
    background: #065F46 !important;
    color: #FFFFFF !important;
}

/* 4️⃣ Other Buttons - Keep as Secondary/Neutral */
body.page-products .btn-outline-primary {
    border-color: #065F46 !important;
    color: #065F46 !important;
    background: transparent !important;
}

body.page-products .btn-outline-primary:hover {
    background-color: #065F46 !important;
    color: #FFFFFF !important;
}

/* ====================================
   🚫 PROTECTED AREAS
   ==================================== */

/* لا تعديل على:
   - .product-card (structure)
   - .product-image
   - .product-card-footer (layout)
   - spacing/padding
   - typography
*/

/* ====================================
   🎨 Phase P3: Product Card Refinement
   ==================================== */

/* ✅ P3: Typography & Spacing داخل كارت المنتج فقط */

/* 1️⃣ Product Name - اسم المنتج */
body.page-products .product-card .product-name,
.page-products .product-card .product-name a {
    font-weight: 600 !important;
    color: #111827;
}

/* 2️⃣ Secondary Text - نصوص ثانوية */
body.page-products .product-card .product-meta,
.page-products .product-card .factory-name {
    font-weight: 400 !important;
    color: #6B7280;
}

/* 3️⃣ Price - السعر */
body.page-products .product-card .product-price {
    font-weight: 500 !important;
    color: #111827;
}

/* 4️⃣ Details Button Enhancement - تحسين وضوح زر التفاصيل */
body.page-products .product-card-footer .btn-primary {
    padding: 0.5rem 1rem !important;
    font-weight: 500 !important;
    border-width: 2px !important;
    transition: all 0.2s ease !important;
}

/* Icon inside button */
body.page-products .product-card-footer .btn-primary i {
    margin-left: 0.25rem;
}

/* 5️⃣ Spacing داخل الكارت - تحسينات خفيفة */
body.page-products .product-card-body {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

body.page-products .product-card .product-name {
    margin-bottom: 0.5rem !important;
}

body.page-products .product-card .product-meta {
    margin-bottom: 0.5rem !important;
}

body.page-products .product-card-footer {
    padding-top: 0.75rem !important;
}

/* ====================================
   🔧 Phase P3.1: Product Cards Fix
   ==================================== */

/* ✅ P3.1: إصلاح مشاكل ناتجة عن P3 فقط */

/* 1️⃣ Re-add hover effect - إعادة تأثير الـ hover */
body.page-products .product-card {
    transition: all 0.2s ease !important;
}

body.page-products .product-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* 2️⃣ Fixed Image Area Height - تثبيت ارتفاع منطقة الصورة */
body.page-products .product-card .product-image {
    height: 200px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    background-color: #F9FAFB !important;
}

body.page-products .product-card .product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

body.page-products .product-card .product-image .image-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 3️⃣ Product Name - max 2 lines with ellipsis */
body.page-products .product-card .product-name,
.page-products .product-card .product-name a {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.4 !important;
    max-height: calc(1.4em * 2) !important; /* 2 lines */
}

/* ====================================
   🎨 Phase P3.2: Visual Alignment & Consistency
   ==================================== */

/* ✅ P3.2: محاذاة بصرية وتوحيد الألوان */

/* 1️⃣ Page Title - عنوان الصفحة */
body.page-products .products-hero h1,
.page-products .products-hero h1 {
    color: #1F2937 !important;
}

/* 2️⃣ Product Card - Flex Column Alignment */
body.page-products .product-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Push footer to bottom */
body.page-products .product-card .product-card-footer {
    margin-top: auto !important;
}

/* 3️⃣ Activities Section - كروت الأنشطة الصناعية */

/* Activity Card Container */
body.page-products .activity-category-card {
    background: #FFFFFF !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 8px !important;
    padding: 1rem !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
}

body.page-products .activity-category-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-2px) !important;
}

/* Activity Icon - توحيد اللون */
body.page-products .activity-icon {
    background: #F0FDF4 !important; /* Light green background */
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 0.75rem !important;
}

body.page-products .activity-icon i {
    color: #065F46 !important; /* Unified green */
    font-size: 1.25rem !important;
}

/* Activity Name */
body.page-products .activity-name {
    color: #1F2937 !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    margin-bottom: 0.5rem !important;
}

/* Activity Count Badge */
body.page-products .activity-count {
    background: #F0FDF4 !important; /* Light green */
    color: #065F46 !important; /* Unified green */
    border: 1px solid #D1FAE5 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 4px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    display: inline-block !important;
}

/* ====================================
   📊 Status
   ==================================== */

/* Phase: P3.2 - Visual Alignment & Consistency
   Date: 2025-12-25
   Status: ✅ Active
   
   Changes:
   - Page title: #1F2937 (removed blue)
   - Product cards: flex column with footer pushed to bottom
   - Activity cards: unified #065F46 icons, white background, #E5E7EB border
   
   ❌ No grid changes
   ❌ No layout changes
   ❌ No size changes
*/
