/**
 * EMG Products Section - Caza Souq
 * قسم منتجات EMG للصفحة الرئيسية
 */

/* تنسيق قسم منتجات EMG */
.emg-section {
    padding: 40px 0;
    direction: rtl;
}

.emg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
}

.emg-title {
    font-size: 24px;
    font-weight: 600;
    color: #222;
    margin: 0;
    position: relative;
}

.emg-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 40px;
    height: 3px;
    background-color: #f2b200;
}

.emg-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

/* بطاقة المنتج */
.emg-product-card {
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    padding: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.emg-product-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* شارة مميزة (Hot) */
.emg-product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #f2b200;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 3px;
    z-index: 2;
}

/* صورة المنتج */
.emg-product-image {
    text-align: center;
    margin-bottom: 8px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
    border-radius: 8px 8px 0 0;
}

.emg-product-image img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
}

.emg-product-image img:hover {
    transform: scale(1.05);
}

/* معلومات المنتج */
.emg-product-info {
    text-align: right;
}

.emg-product-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    margin-bottom: 8px;
}

/* حاوية الأسعار */
.emg-product-price-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
    gap: 8px;
}

.emg-product-price {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.emg-product-old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
}

.emg-product-discount {
    margin-right: 5px;
}

.emg-product-discount .badge {
    font-size: 12px;
    padding: 3px 6px;
    background-color: #8b0000;
}

/* شريط الإجراءات */
.emg-product-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #f5f5f5;
}

.emg-product-icons {
    display: flex;
    gap: 10px;
}

.emg-icon-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    transition: color 0.3s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emg-icon-button:hover {
    color: #666;
}

.emg-icon-button.favorite.active {
    color: #ff4747;
}

/* زر إضافة للسلة والكمية */
.emg-cart-actions {
    display: flex;
    align-items: center;
}

.emg-quantity {
    width: 40px;
    height: 30px;
    margin-left: 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.emg-add-to-cart {
    background-color: #f2b200;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 15px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.emg-add-to-cart:hover {
    background-color: #e0a500;
}

/* زر اشتر الآن */
.emg-buy-now {
    margin-top: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.emg-buy-now-button {
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.emg-buy-now-button:hover {
    color: #f2b200;
}

.emg-buy-now-button i {
    font-size: 12px;
}

/* التجاوب مع الشاشات المختلفة */
@media (max-width: 992px) {
    .emg-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .emg-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        width: 90vw;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    .emg-product-card {
        width: 93%;
        box-sizing: border-box;
        margin: 0 auto 6px auto;
        padding: 8px;
    }
    .emg-product-image {
        height: 140px;
        min-height: 130px;
        max-height: 150px;
    }
    .emg-product-image img {
        height: 120px;
        max-height: 140px;
    }
    .emg-product-title {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .emg-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .emg-product-actions {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .emg-product-icons {
        width: 100%;
        justify-content: space-between;
    }
    
    .emg-cart-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .emg-buy-now {
        justify-content: flex-start;
    }
}
}
