/**
 * 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: 12px;
    border: 1px solid #e8e8e8;
    padding: 0;
    position: relative;
    transition: all 0.35s ease;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

.emg-product-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
    border-color: #d0d0d0;
}

/* شارة مميزة (Hot) */
.emg-product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #f2b200;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(242, 178, 0, 0.3);
}

.emg-product-badge.limited {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.emg-product-badge.out-of-stock {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

/* شارة الخصم فوق الصورة */
.emg-discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    padding: 8px 12px;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4);
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

.emg-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: block;
}

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

/* معلومات المنتج */
.emg-product-info {
    text-align: right;
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.emg-product-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    margin-bottom: 12px;
    min-height: 42px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.emg-product-title:hover {
    color: #f2b200;
}

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

.emg-product-price {
    font-size: 20px;
    font-weight: 800;
    color: #dc3545;
    letter-spacing: -0.5px;
}

.emg-product-old-price {
    font-size: 15px;
    color: #aaa;
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: 500;
}

/* شريط الإجراءات */
.emg-product-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

/* زر إضافة للسلة والكمية */
.emg-cart-actions {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: 6px;
}

.emg-quantity {
    flex: 0 0 32px;
    height: 40px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    color: #333;
    transition: all 0.3s ease;
    background: #fff;
    padding: 0;
}

.emg-quantity:focus {
    outline: none;
    border-color: #f2b200;
    box-shadow: 0 0 0 2px rgba(242, 178, 0, 0.15);
}

.emg-quantity:hover {
    border-color: #f2b200;
}

.emg-add-to-cart {
    flex: 1;
    min-width: 0;
    background: linear-gradient(135deg, #f2b200 0%, #e0a500 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 10px rgba(242, 178, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.emg-add-to-cart:hover:not(:disabled) {
    background: linear-gradient(135deg, #e0a500 0%, #c99200 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(242, 178, 0, 0.35);
}

.emg-add-to-cart:active:not(:disabled) {
    transform: translateY(0);
}

.emg-add-to-cart:disabled {
    background: linear-gradient(135deg, #ccc 0%, #aaa 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

.emg-add-to-cart i {
    font-size: 13px;
}

/* التجاوب مع الشاشات المختلفة */

/* تابلت (992px - 769px) */
@media (max-width: 992px) and (min-width: 769px) {
    .emg-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
    .emg-product-actions {
        padding: 10px;
    }
    .emg-cart-actions {
        gap: 5px;
    }
    .emg-quantity {
        flex: 0 0 30px;
        height: 38px;
        font-size: 12px;
    }
    .emg-add-to-cart {
        font-size: 12px;
        padding: 9px 12px;
        gap: 5px;
    }
    .emg-add-to-cart i {
        font-size: 12px;
    }
}

/* موبايل (768px وأقل) */
@media (max-width: 768px) {
    .emg-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .emg-product-card {
        padding: 0;
    }
    .emg-product-image {
        height: 170px;
        padding: 8px;
    }
    .emg-product-info {
        padding: 8px;
    }
    .emg-product-title {
        font-size: 12px;
        min-height: 34px;
        line-height: 1.3;
    }
    .emg-product-price {
        font-size: 15px;
    }
    .emg-product-old-price {
        font-size: 12px;
    }
    .emg-discount-badge {
        min-width: 38px;
        min-height: 38px;
        font-size: 11px;
        padding: 5px 6px;
    }
    .emg-product-badge {
        font-size: 9px;
        padding: 4px 8px;
        top: 8px;
        right: 8px;
    }
    .emg-product-actions {
        padding: 8px;
    }
    .emg-cart-actions {
        gap: 5px;
    }
    .emg-quantity {
        flex: 0 0 28px;
        height: 34px;
        font-size: 12px;
        border-width: 1px;
    }
    .emg-add-to-cart {
        font-size: 11px;
        padding: 8px 10px;
        gap: 4px;
    }
    .emg-add-to-cart i {
        font-size: 11px;
    }
}

/* موبايل صغير (480px وأقل) */
@media (max-width: 480px) {
    .emg-products-grid {
        gap: 8px;
    }
    .emg-product-info {
        padding: 6px;
    }
    .emg-product-actions {
        padding: 6px;
    }
    .emg-cart-actions {
        gap: 4px;
    }
    .emg-quantity {
        flex: 0 0 26px;
        height: 32px;
        font-size: 11px;
    }
    .emg-add-to-cart {
        font-size: 10px;
        padding: 7px 8px;
        gap: 3px;
    }
    .emg-add-to-cart i {
        font-size: 10px;
    }
}

