/* 🎨 تنسيقات مكوّن بطاقة المنتج الموحّد */
/* 📅 تم الإنشاء: 1 أغسطس 2025 */

/* تنسيق البطاقة الأساسية */
.product-card {
    background: var(--white, #ffffff);
    border-radius: var(--radius-xl, 16px);
    overflow: hidden;
    box-shadow: var(--shadow-md, 0 4px 20px rgba(0,0,0,0.08));
    transition: all var(--transition-normal, 0.3s ease);
    border: 1px solid var(--gray-200, #e9ecef);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl, 0 10px 40px rgba(0,0,0,0.15));
}

/* تنسيق صورة المنتج */
.product-image {
    width: 100%;
    height: 200px;
    background: var(--gradient-primary, linear-gradient(135deg, #3498db, #2980b9));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--white, #ffffff);
    position: relative;
    overflow: hidden;
}

/* معرف المنتج في البطاقة */
.product-id-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #2c3e50;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Arial', sans-serif;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.product-card:hover .product-id-badge {
    background: var(--primary-color, #3498db);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 3px 12px rgba(52, 152, 219, 0.3);
}

/* للغة العربية */
[dir="rtl"] .product-id-badge {
    right: auto;
    left: 12px;
}

.product-image .default-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.product-image .product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.product-card:hover .product-image .default-icon {
    transform: scale(1.1);
    opacity: 1;
}

/* تنسيق تفاصيل المنتج */
.product-details {
    padding: var(--space-xl, 24px);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-sm, 12px);
    color: var(--text-dark, #2c3e50);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    color: var(--gray-600, #6c757d);
    margin-bottom: var(--space-lg, 20px);
    font-size: 0.875rem;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* تنسيق أزرار الإجراءات */
.product-actions {
    display: flex;
    gap: var(--space-sm, 8px);
    margin-top: auto;
}

.action-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs, 6px);
    padding: var(--space-md, 12px);
    border: none;
    border-radius: var(--radius-md, 8px);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 44px;
    position: relative;
    white-space: nowrap;
}

/* تأثيرات hover خفيفة ومحسوبة */
.action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}

/* تنسيق زر الاستعلام */
.quote-btn {
    background: var(--primary-color, #3498db);
    color: var(--white, #ffffff);
    flex: 2; /* جعل زر الاستعلام أكبر لاحتواء النص */
}

.quote-btn:hover {
    background: #2980b9;
    box-shadow: 0 3px 12px rgba(52, 152, 219, 0.3);
}

.quote-btn .btn-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.quote-btn.added {
    background: #27ae60;
    color: white;
}

.quote-btn.added:hover {
    background: #219a52;
    box-shadow: 0 3px 12px rgba(39, 174, 96, 0.3);
}

.quote-btn.added i {
    color: white !important;
}

/* تنسيق زر واتساب */
.whatsapp-btn {
    background: #25D366;
    color: var(--white, #ffffff);
    flex: 0.8; /* أصغر لأنه أيقونة فقط */
}

.whatsapp-btn:hover {
    background: #1da851;
    box-shadow: 0 3px 12px rgba(37, 211, 102, 0.3);
}

/* تنسيق زر التفاصيل */
.details-btn {
    background: var(--gray-700, #495057);
    color: var(--white, #ffffff);
    flex: 0.8; /* أصغر لأنه أيقونة فقط */
}

.details-btn:hover {
    background: #343a40;
    box-shadow: 0 3px 12px rgba(73, 80, 87, 0.3);
    color: var(--white, #ffffff);
    text-decoration: none;
}

/* تنسيقات الـ Tooltip المخصص */
.custom-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 10000;
    pointer-events: none;
    max-width: 200px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    white-space: nowrap;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-tooltip.rtl {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
}

.custom-tooltip.ltr {
    font-family: 'Poppins', sans-serif;
    direction: ltr;
}

/* سهم الـ tooltip */
.custom-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* tooltip عندما يظهر في الأسفل */
.custom-tooltip.tooltip-bottom::after {
    top: -10px;
    border-top-color: transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
}

/* تنسيق أيقونات الأزرار */
.action-button i {
    font-size: 1rem;
    transition: all 0.2s ease;
}

.quote-btn i {
    margin-right: 0.25rem;
}

[dir="rtl"] .quote-btn i {
    margin-right: 0;
    margin-left: 0.25rem;
}

/* تأثيرات خاصة للأيقونات عند hover */
.action-button:hover i {
    transform: scale(1.05);
}

.whatsapp-btn:hover i {
    animation: pulseWhatsApp 0.6s ease;
}

.details-btn:hover i {
    animation: pulseDetails 0.5s ease;
}

@keyframes pulseWhatsApp {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes pulseDetails {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .product-image {
        height: 160px;
        font-size: 2rem;
    }
    
    .product-id-badge {
        top: 8px;
        right: 8px;
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    [dir="rtl"] .product-id-badge {
        right: auto;
        left: 8px;
    }
    
    .product-details {
        padding: var(--space-lg, 16px);
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-description {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    
    .action-button {
        padding: var(--space-sm, 10px);
        font-size: 1rem;
        min-height: 40px;
    }
}

/* تحسينات RTL */
[dir="rtl"] .product-card {
    text-align: right;
}

[dir="rtl"] .product-actions {
    direction: rtl;
}

/* رسوم متحركة للتحميل */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* تأخير الرسوم المتحركة للبطاقات المتعددة */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
