/* Estilos generales */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
}

#customizer-app {
    max-width: 1200px;
    margin: auto;
    background: white;
    padding: 20px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.title {
    text-align: center;
    color: #333;
}

#customizer-wrapper {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

#canvas-container {
    flex: 1 1 auto;
    max-width: 800px;
    position: relative;
}

#customizer-canvas {
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
    border: 1px solid #ccc;
    background-color: white;
    display: block;
}

#controls-container {
    flex: 1 1 300px;
    max-width: 350px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.control-group {
    margin-bottom: 20px;
}

label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

input, select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.btn {
    display: inline-block;
    padding: 10px 15px;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    text-align: center;
    width: 100%;
}

.btn:hover {
    background: #0056b3;
}

.btn-primary {
    width: 100%;
    margin-top: 10px;
}

/* Modal de vista previa */
.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    width: 60%;
    max-width: 500px;
    border-radius: 10px;
    text-align: center;
    position: relative;
}

.modal-content img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #555;
}

.close:hover {
    color: black;
}

#product-selector {
    display: block !important;
}

#canvas-container canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* RESPONSIVE para pantallas pequeñas */
@media screen and (max-width: 1200px) {
    #customizer-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    #canvas-container,
    #controls-container {
        width: 100%;
        max-width: 100%;
    }

    #controls-container {
        margin-top: 20px;
    }

    .control-group {
        margin-bottom: 15px;
    }

    .btn {
        width: 100%;
    }

    #customizer-canvas {
        max-width: 100%;
        height: auto;
    }

    .modal-content {
        width: 90%;
    }
}

/* Ajustes para tablets en vertical */
@media screen and (min-width: 601px) and (max-width: 900px) {
    #canvas-container {
        margin: 0 auto;
    }
}

/* Ajustes específicos para móviles */
@media screen and (max-width: 600px) {
    #customizer-app {
        padding: 10px;
    }

    #canvas-container {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        aspect-ratio: 4 / 3;
        position: relative;
    }

    #customizer-canvas {
        width: 100% !important;
        height: auto !important;
        display: block;
        border: 1px solid #ccc;
    }

    #controls-container {
        width: 100%;
        padding: 15px;
        margin-top: 20px;
    }

    input, select, .btn {
        font-size: 14px;
    }
}

#text-color-picker {
    max-width: 100%;
    margin-bottom: 20px;
}
