/* Estilos generales */
body {
    text-align: center;
    font-family: Arial, sans-serif;
    background-color: #faf2e7; /* Color de fondo principal */
    color: #333;
    padding: 20px;
    margin: 0;
}

/* Títulos */
h1 {
    color: #f96094;
}

/* Contenedor principal */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap; /* Permite que los elementos se ajusten en pantallas pequeñas */
}

/* Contenedor de imágenes */
.image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 800px;
    flex-wrap: wrap;
}

/* Caja donde se muestra la imagen */
.image-box {
    width: 90%;
    max-width: 400px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #fca55c; /* Melocotón */
    padding: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}

canvas {
    width: 100%;
    height: auto;
}

/* Controles */
.controls {
    margin-top: 20px;
}

/* Inputs y botones */
input[type="file"],
input[type="color"],
button {
    padding: 12px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    margin: 5px;
    transition: all 0.3s ease;
}

input[type="file"] {
    background: #fff;
    border: 2px solid #fca55c; /* Borde melocotón */
}

input[type="color"] {
    width: 50px;
    height: 50px;
    border: none;
    padding: 5px;
    background-color: #faf2e7; /* Fondo beige */
}

button {
    background: #f96094; /* Rosa */
    color: white;
    font-weight: bold;
}

button:hover {
    background: #d84872; /* Rosa más oscuro */
    transform: scale(1.05);
}

/* Galería de imágenes */
.gallery {
    display: flex;
    overflow-x: auto; /* Scroll horizontal en móviles */
    white-space: nowrap; /* Evita que las imágenes se apilen */
    scroll-snap-type: x mandatory; /* Desplazamiento más suave */
    gap: 10px;
    padding: 10px;
    max-width: 100%;
    justify-content: center;
}

.gallery img {
    width: 100px;
    height: auto;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
    scroll-snap-align: start; /* Permite un desplazamiento más fluido */
}

/* Imagen seleccionada */
.gallery img.selected {
    border: 3px solid #f96094; /* Borde rosa */
    box-shadow: 0px 0px 10px rgba(249, 96, 148, 0.5);
    transform: scale(1.1);
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        align-items: center;
    }

    .image-container {
        flex-direction: column;
        align-items: center;
    }

    .image-box {
        width: 100%;
        max-width: 320px; /* Más compacto en móviles */
    }

    .gallery {
        overflow-x: auto;
        display: flex;
        flex-wrap: nowrap;
        padding: 10px;
        -webkit-overflow-scrolling: touch; /* Scroll más fluido en iOS */
        justify-content: normal;
    }

    .gallery img {
        width: 80px; /* Reduce el tamaño en móviles */
    }

    input[type="file"],
    input[type="color"],
    button {
        width: 90%;
    }
}
