/* ========================================== */
/* تنسيقات قسم التصنيفات الرئيسية */
/* ========================================== */

.categories-section {
    padding: 60px 0;
    background-color: #fff;
    direction: rtl;
}

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 60px;
    height: 3px;
    background-color: #e9e1dd; /* نفس لون الهوية */
    border-radius: 2px;
}

.categories-grid {
    display: grid;
    /* 4 أعمدة في الشاشات الكبيرة */
    grid-template-columns: repeat(4, 1fr); 
    gap: 20px;
}

.category-card {
    position: relative;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
}

/* الصورة الخلفية */
.cat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover .cat-img {
    transform: scale(1.1); /* زوم للصورة عند الهوفر */
}

/* الطبقة الشفافة والمحتوى */
.cat-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    color: #fff;
    transition: background 0.3s ease;
}

.category-card:hover .cat-overlay {
    background: rgba(0, 0, 0, 0.7); /* تغميق الخلفية بالكامل عند الهوفر */
}

.cat-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

/* عند الهوفر، العنوان يطلع فوق شوية */
.category-card:hover .cat-title {
    transform: translateY(-10px);
}

/* التصنيفات الفرعية (مخفية افتراضياً) */
.sub-categories {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease;
}

.category-card:hover .sub-categories {
    max-height: 200px; /* اسمح بظهور المحتوى */
    opacity: 1;
}

.sub-categories ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.sub-categories ul li {
    margin-bottom: 8px;
    transform: translateX(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

/* أنيميشن لظهور العناصر واحد تلو الآخر */
.category-card:hover .sub-categories ul li:nth-child(1) { transition-delay: 0.1s; transform: translateX(0); opacity: 1; }
.category-card:hover .sub-categories ul li:nth-child(2) { transition-delay: 0.2s; transform: translateX(0); opacity: 1; }
.category-card:hover .sub-categories ul li:nth-child(3) { transition-delay: 0.3s; transform: translateX(0); opacity: 1; }
.category-card:hover .sub-categories ul li:nth-child(4) { transition-delay: 0.4s; transform: translateX(0); opacity: 1; }

.sub-categories a {
    color: #ddd;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.sub-categories a:hover {
    color: #fff;
    padding-right: 5px; /* حركة بسيطة لليسار */
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #e9e1dd; /* لون الهوية */
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-top: 5px;
}

.view-all-btn:hover {
    text-decoration: underline;
}

/* ========================================== */
/* التجاوب (Media Queries) */
/* ========================================== */

/* تابلت (2 عمود) */
@media (max-width: 992px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* موبايل (1 عمود) */
@media (max-width: 576px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        height: 300px; /* تقليل الارتفاع في الموبايل */
    }

    /* في الموبايل، مفيش هوفر، فا نظهر جزء من المحتوى أو نخليه يظهر باللمس */
    .cat-overlay {
        background: rgba(0, 0, 0, 0.6);
    }
    
    .cat-title {
        transform: translateY(0);
        margin-bottom: 5px;
    }
    
    /* ممكن نخلي القائمة ظاهرة دايماً في الموبايل لو حابب، 
       أو نخلي المستخدم يضغط عشان تظهر (السلوك الافتراضي هنا الضغط = هوفر في الموبايل) */
}
