/* OVERLAY SCURO (Sfondo dietro al popup) */
#cuamm-modale-overlay {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* CONTENITORE PRINCIPALE (Il box bianco) */
#cuamm-modale-contenitore {
    width: 90%;
    height: auto;
    position: relative;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 1536px;
    background: var(--color-background-white);
}

/* PULSANTE CHIUDI (X) */
#cuamm_chiudi_modale {
    position: absolute;
    top: 20px;
    right: 25px;
    border: none;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--color-text-black);
    background: transparent;
}

/* TITOLO */
.cuamm-titolo-modale {
    text-align: left;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

/* LAYOUT A 2 COLONNE */
.cuamm-layout-colonne {
    display: flex;
    gap: 50px;
    height: auto;
    overflow: hidden;
}

/* COLONNA SINISTRA (Form) */
.cuamm-col-sinistra {
    flex: 1;
    overflow-y: auto; /* Scorrimento solo a sinistra se il form è lungo */
    padding-right: 20px;
}

/* STILE DEI CAMPI FORM */
.cuamm-step { margin-bottom: 25px; }
.cuamm-step label {
    display: block;
    margin-bottom: 8px;
}
.cuamm-step input[type="text"],
.cuamm-step input[type="email"],
.cuamm-step input[type="date"],
.cuamm-step textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 15px;
    background: var(--color-background-white);
    box-sizing: border-box;
}
.cuamm-step input:focus, .cuamm-step textarea:focus {
    outline: none;
    border-color: unset;
}
.cuamm-step textarea { height: 120px; resize: vertical; }

.cuamm-radio-group { margin-bottom: 10px; }
.cuamm-radio-group label { display: inline-block; margin-right: 20px; font-weight: normal; }

.cuamm-radio-group label input { 
    display: inline-block;
    margin-right: 5px;
    font-weight: normal; 
}

.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) button#cuamm_btn_conferma{
    width: 100%;
    color: var(--color-background-white);
    padding: 13px 40px;
    text-decoration: none;
    text-transform: uppercase;
    border: none;
    border-radius: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
	background-color: var(--color-primary);
}

.woocommerce:where(body:not(.woocommerce-block-theme-has-button-styles)) button#cuamm_btn_conferma:hover{
    background-color: var(--color-secondary);
}

/* COLONNA DESTRA (Anteprima Rossa) */
.cuamm-col-destra {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

#cuamm-preview {
    color: var(--color-background-white);
    width: 100%;
    max-width: 400px;
    max-height: 100%;
    text-align: center;
    border-radius: 8px;
    display: inline-flex;
    position: relative;
    justify-content: center;
}

#cuamm-preview img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Assicura la scalatura proporzionale senza tagli */
}

#cuamm-preview .content{
    position: absolute;
    top: 18%;
    transform: translateX(-50%);
    left: 50%;
    width: 100%;
}

#cuamm-preview #prev_nome {
    width: 100%;
    text-align: center;
    margin: 0;
    padding-bottom: 1.5vmin; /* Spazio elastico invece di pixel fissi */
    font-size: clamp(12px, 3vmin, 20px);
}

#cuamm-preview #prev_testo {
    width: 80%;
    text-align: center;
    margin: 0 auto;
    padding-bottom: 1.5vmin;
    word-break: break-word;
    font-size: clamp(10px, 2.2vmin, 18px);
}

#cuamm-preview #prev_firma {
    text-align: center;
    width: 100%;
    font-size: clamp(12px, 3vmin, 20px);
}

/* RESPONSIVE: Su mobile metti le colonne in verticale */
@media (max-width: 768px) {
    .cuamm-layout-colonne { flex-direction: column; overflow-y: auto; }
    .cuamm-col-sinistra { overflow-y: visible; padding-right: 0; }
    #cuamm-modale-contenitore { height: 95vh; padding: 20px; }

    .cuamm-col-destra{
        min-height: fit-content;
    }
}