/* Details Modal Styles */
.details-modal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.details-modal.show {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: absolute;
    top: 0;
    right: -600px;
    width: 600px;
    max-width: 90%;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    animation: slideInRight 0.3s ease forwards;
    direction: rtl;
}

.details-modal.show .modal-content {
    right: 0;
}

.modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #f44336;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: #d32f2f;
}

#modal-body {
    padding: 20px;
    padding-top: 70px;
}

/* التخطيط الرئيسي: صورة + تفاصيل */
.modal-main-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
    flex-direction:column;
}

.modal-image-container {
    flex: 0 0 45%;
    min-width: 0;
}

.modal-details-container {
    flex: 1;
    width: 100%;
    min-width: 0;
}

.modal-image-gallery {
    margin-bottom: 0;
}

.modal-main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.modal-no-image {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 8px;
    color: #999;
    font-size: 18px;
    flex-direction: column;
    gap: 10px;
}

.modal-no-image i {
    font-size: 48px;
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.modal-thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.modal-thumbnail:hover {
    border-color: #007bff;
}

.modal-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.modal-section h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.modal-price {
    font-size: 28px;
    color: #007bff;
    font-weight: bold;
    margin: 15px 0;
}

.modal-badge {
    background: #ff6b6b;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 15px;
}

.modal-info {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #666;
}

.modal-contact {
    text-align: center;
    padding: 20px;
    background: #e3f2fd;
    border-radius: 8px;
    margin-top: 20px;
}

.modal-contact a {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
}

.modal-contact a:hover {
    background: #0056b3;
}

/* أزرار الإجراءات */
.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.modal-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    min-width: 140px;
}

.modal-call-btn {
    background: #28a745;
    color: white;
}

.modal-call-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.modal-whatsapp-btn {
    background: #25D366;
    color: white;
}

.modal-whatsapp-btn:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

.modal-email-btn {
    background: #667eea;
    color: white;
}

.modal-email-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { right: -600px; }
    to { right: 0; }
}

@media (max-width: 768px) {
    .modal-content {
        width: 100%;
    }
    
    /* على الموبايل: ترتيب رأسي */
    .modal-main-layout {
        flex-direction: column;
    }
    
    .modal-image-container {
        flex: 1;
        width: 100%;
    }
    
    .modal-details-container {
        flex: 1;
        width: 100%;
    }
    
    .modal-main-image {
        height: 250px;
    }
    
    .modal-no-image {
        height: 250px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-action-btn {
        width: 100%;
    }
}

/* Pagination Styles */
.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.pagination-btn:hover:not(:disabled) {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 8px 12px;
    color: #666;
}

