/* === تنسيق البطاقة (مطابق للصورة تماماً) === */

.custom-card-item {
    display: flex; /* ترتيب أفقي */
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px; /* More rounded */
    padding: 10px;
    margin-bottom: 12px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    align-items: flex-start;
    direction: rtl; /* لضمان الاتجاه العربي */
    overflow: hidden;
}

.custom-card-item:hover {
    transform: translateY(-4px); /* Subtle lift */
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: #27ae60;
}

/* === تنسيق الصورة (يمين) === */
/* === تنسيق الصورة (يمين) === */
.custom-card-img-box {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    margin-left: 12px; /* مسافة بين الصورة والنص */
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    display: block !important; /* Force display */
    position: relative;
}

.custom-card-thumb {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.custom-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 24px;
    background: #f3f4f6;
}

/* === تنسيق المحتوى (يسار) === */
.custom-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
}

/* العنوان */
.custom-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 6px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Strict height enforcement */
    height: 2.8em; /* 1.4 * 2 lines */
}

/* السعر */
.custom-card-price {
    font-size: 16px;
    font-weight: 800;
    color: #27ae60; /* اللون الأخضر */
    margin-bottom: 8px;
}

/* معلومات إضافية (البائع والموقع) */
.custom-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

/* كبسولة البائع */
.custom-author-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f3f4f6;
    padding: 2px 8px 2px 4px;
    border-radius: 20px;
    text-decoration: none;
    color: #4b5563;
    font-size: 11px;
    transition: background 0.2s;
}

.custom-author-pill:hover {
    background: #e5e7eb;
}

.custom-author-pill img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.custom-meta-txt {
    font-size: 11px;
    color: #6b7280;
}

/* الفوتر */
.custom-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    border-top: 1px dashed #e5e7eb;
    padding-top: 6px;
}

/* تصنيف */
.custom-cat-badge {
    font-size: 10px;
    color: #6b7280;
    background: #f9fafb;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* أيقونات المشاهدة والوقت */
.custom-stats {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #9ca3af;
}

.custom-stats i {
    font-size: 10px;
}

/* View Label Text */
.view-label {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 500;
}

/* === زر المفضلة (يسار علوي) === */
.custom-card-fav {
    position: absolute;
    top: 10px;
    left: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #d1d5db;
    padding: 0;
    z-index: 5;
    transition: all 0.2s;
}

.custom-card-fav:hover {
    transform: scale(1.1);
    color: #ef4444;
}

.custom-card-fav.active i {
    color: #ef4444;
    font-weight: 900;
}

/* Short Description (Mobile & Desktop) */
.custom-card-short-desc {
    font-size: 11px; /* Smaller on mobile */
    color: #6b7280;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Strict height enforcement */
    height: 2.6em; /* 1.3 * 2 lines */
}

@media (min-width: 768px) {
    .custom-card-short-desc {
        font-size: 13px; /* Slightly larger on desktop */
        margin-bottom: 8px;
        line-height: 1.4;
        /* Strict height enforcement desktop */
        height: 2.8em; /* 1.4 * 2 lines */
    }
}

/* Responsive للجوال */
@media (max-width: 480px) {
    .custom-card-img-box {
        width: 90px;
        height: 90px;
    }
    
    .custom-card-title {
        font-size: 14px;
    }
    
    .custom-card-price {
        font-size: 15px;
    }
}

/* === Verified Merchant Styles === */

.verified-merchant .author-info {
    display: flex;
    flex-direction: column;
    margin-right: 6px;
    line-height: 1.1;
}

.verified-merchant .author-name {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: bold;
    color: #4b5563;
}

.verified-badge {
    color: #3b82f6; /* Blue badge */
    font-size: 12px;
}

.verified-label {
    font-size: 9px;
    color: #27ae60;
    font-weight: bold;
}

/* Visit Store Button */
.visit-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: #001f3f;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    text-decoration: none;
    font-weight: bold;
    margin-right: auto; /* Push to the left (RTL) */
    transition: background-color 0.2s;
}

.visit-store-btn:hover {
    background-color: #003366;
    color: #fff;
}

.visit-store-btn i {
    font-size: 10px;
}

/* Modify Author Pill for Verified */
.custom-author-pill.verified-merchant {
    background: transparent;
    padding: 0;
}

.custom-author-pill.verified-merchant img {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
}