<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('servicios', function (Blueprint $table) {
            $table->id();
            $table->string('nombre');
            $table->text('descripcion')->nullable();
            $table->text('caracteristicas')->nullable(); // JSON
            $table->string('icono')->nullable();
            $table->string('imagen')->nullable();
            $table->string('precio_desde')->nullable();
            $table->string('tipo')->default('venta'); // venta, alquiler, ambos
            $table->string('badge')->nullable(); // "Más vendido", "Nuevo", etc.
            $table->string('badge_color')->nullable();
            $table->string('url_demo')->nullable();
            $table->integer('orden')->default(0);
            $table->boolean('destacado')->default(false);
            $table->boolean('activo')->default(true);
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('servicios');
    }
};
