# .htaccess (root of your project)
RewriteEngine On

# Serve existing files/directories directly
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Product detail: /product/123
RewriteRule ^product/([0-9]+)/?$ product.php?id=$1 [L,QSA]

# Category page: /category/laptops
RewriteRule ^category/([^/]+)/?$ category.php?slug=$1 [L,QSA]

# Search page: /search
RewriteRule ^search/?$ search.php [L,QSA]

# Cart page: /cart
RewriteRule ^cart/?$ cart.php [L,QSA]

# Checkout page: /checkout
RewriteRule ^checkout/?$ checkout.php [L,QSA]

# Admin dashboard: /admin
RewriteRule ^admin/?$ admin/index.php [L,QSA]
