.quote_builder_wrapper {
    position: relative;
}

.quote_builder_wrapper .panel {
    border: 1px solid #eee;
    margin-bottom: 10px;
}

.quote_builder_wrapper #ddg-page-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, .6);
    display: none;
    z-index: 99;
    transition: all 0.6s ease;
}

.quote_builder_wrapper #ddg-page-overlay .loader-container {
    position: fixed;
    width: 100%;
    height: 100vh;
    top: 0;
    left: 0;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99;
    transition: all 0.6s ease;
}

.quote_builder_wrapper .plugins-overlay#ddg-page-overlay .loader-container {
    height: 400px;
    position: absolute;
}

.quote_builder_wrapper #ddg-page-overlay .plgsspinner {
    width: 56px;
    height: 56px;
    display: grid;
    border-radius: 50%;
    /* -webkit-mask: radial-gradient(farthest-side, #0000 40%, #cbcbcd 41%);
    background: linear-gradient(0deg, rgba(203, 203, 205, 0.5) 50%, rgba(203, 203, 205, 1) 0) center/4.5px 100%,
        linear-gradient(90deg, rgba(203, 203, 205, 0.25) 50%, rgba(203, 203, 205, 0.75) 0) center/100% 4.5px;
    background-repeat: no-repeat; */
   -webkit-mask: radial-gradient(farthest-side,#0000 40%,#c81f24 41%);
   mask: radial-gradient(farthest-side,#0000 40%,#c81f24 41%);
   background: linear-gradient(0deg ,rgba(200,31,36,0.5) 50%,rgba(200,31,36,1) 0) center/4.5px 100%,
        linear-gradient(90deg,rgba(200,31,36,0.25) 50%,rgba(200,31,36,0.75) 0) center/100% 4.5px;
   background-repeat: no-repeat;

    animation: spinner-d3o0rx 1s infinite steps(12);
}

.quote_builder_wrapper #ddg-page-overlay .plgsspinner::before,
.quote_builder_wrapper #ddg-page-overlay .plgsspinner::after {
    content: "";
    grid-area: 1/1;
    border-radius: 50%;
    background: inherit;
    opacity: 0.915;
    transform: rotate(30deg);
}

.quote_builder_wrapper #ddg-page-overlay .plgsspinner::after {
    opacity: 0.83;
    transform: rotate(60deg);
}

@keyframes spinner-d3o0rx {
    100% {
        transform: rotate(1turn);
    }
}

.overlay-visible {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.quote_builder_wrapper .bold {
    font-weight: 900;
}

.quote_builder_wrapper .btn-wrapper {
    padding: 10px 0;
}

#ddg-main-modal .btn.btn-primary,
.quote_builder_wrapper .btn.btn-primary {
    background: #C81F24;
}

.quote_builder_wrapper .data {
    margin-top: 40px;
}

.quote_builder_wrapper .map {
    position: relative;
    width: 100%;
    height: 300px;
    border: 2px solid #ccc;
}

.quote_builder_wrapper .tabcontent {
    display: none;
    padding: 6px 12px;
    border: 1px solid #ccc;
    animation: fadeIn 0.3s ease-in-out; /* Un piccolo tocco di classe */
    /* border-top: none; */
}

.quote_builder_wrapper .tabcontent.active {
    display: block;
}

.quote_builder_wrapper input[type="text"] {
    flex-grow: 0;
    /* flex-basis: 70%; */
}

.quote_builder_wrapper .input-group {
    flex-wrap: nowrap;
}

.quote_builder_wrapper button.disabled {
    background: #eee;
}

.quote_builder_wrapper button,
.quote_builder_wrapper input[type="submit"] {
    border-radius: 0 !important;
}

.quote_builder_wrapper .custom_quote {
    display: none;
}

.quote_builder_wrapper table.quote_summary_table {
    border: 1px solid #ccc;
}

.quote_builder_wrapper table.quote_summary_table tr {
    border-bottom: 1px solid #ccc;
}

.quote_builder_wrapper table.quote_summary_table td {
    text-align: center;
}

.quote_builder_wrapper table.quote_summary_table td:first-child {
    border-right: 1px solid #ccc;
    text-align: left;
}

.quote_builder_wrapper table.quote_summary_table td:last-child {
    border-left: 1px solid #ccc;
    text-align: right;
}

.quote_builder_wrapper table.quote_summary_table thead {
    background-color: #eee;
}

.quote_builder_wrapper table.quote_summary_table tfoot {
    background-color: #eee;
    font-weight: bold;
}

.quote_builder_wrapper #gdpr_check
/*,.quote_builder_wrapper .cancel_quote_button*/
    {
    margin-right: 20px;
}

.quote_builder_wrapper #gdpr_check:checked {
    border-color: #C81F24 !important;
    background-color: #C81F24 !important;
    box-shadow: none;
}

.quote_builder_wrapper .save_del_buttons {
    width: 100%;
}

.quote_builder_wrapper #quote_personal_data {
    display: none;
}

/* .quote_builder_wrapper .input-group {
    margin-bottom: 20px;
} */

.quote_builder_wrapper .error {
    border: 1px solid red !important;
}

.quote_builder_wrapper .validate_error {
    margin-left: 10px;
    color: red;
    font-size: .9em;
}

.quote_builder_wrapper label {
  display: inline-block;
  margin-bottom: 20px;
}

.quote_builder_wrapper .required_msg {
    margin-right: 10px;
    color: red;
    font-weight: bold;
}

.quote_builder_wrapper input[type="radio"]:checked,
.quote_builder_wrapper input[type="checkbox"]:checked,
.quote_builder_wrapper input[type="checkbox"]:hover:checked,
.quote_builder_wrapper input[type="checkbox"]:focus:checked {
    border-color: #C81F24 !important;
    background-color: #C81F24 !important;
    background: #C81F24 !important;
    box-shadow: none;
}

.quote_builder_wrapper input[type="radio"] {
    border: 1px solid #ccc;
}

@media (min-width: 280px) and (max-width: 768px) {

    .quote_builder_wrapper ul.ddg-list {
        padding-left: 0px !important;
        margin-left: 1rem !important;
    }

    .quote_builder_wrapper table.quote_summary_table {
        font-size: .7em;
    }

    .swal2-title {
        font-size: 22px !important;
    }
}

div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus {
    box-shadow: none !important;
}

.quote_builder_wrapper span.quote_id {
    font-weight: bold;
}

.quote_builder_wrapper .warning {
    background: #F9DADA;
    padding: 10px;
}

.quote_builder_wrapper .warning {
    margin-bottom: 0;
}

#ddg_quote_form {
    font-size: .9em;
}

#ddg_quote_form img {
    max-width: 200px;
    height: auto;
}

#ddg_quote_form img.bolletta {
    max-width: 100%;
    height: auto;
}

@media (max-width: 1024px) {
    #ddg_quote_form img {
        max-width: 200px;
        height: auto;
    }
}

/* Regola specifica del contenitore del form per risolvere il problema di altezza/scroll su MOBILE */
@media (max-width: 768px) {
    

    /* Garantire che il contenuto si espanda all'interno del contenitore scorrevole */
    .quote_builder_wrapper {
        display: flex;
        flex-direction: column;
        min-height: 100%; /* Si espande all'altezza massima del genitore scorrevole */
    }

    /* Le regole sul tabcontent, ddg_quote_form, e btn-wrapper che avevamo definito */
    
    #ddg_quote_form {
        display: flex;
        flex-direction: column;
        flex-grow: 1; /* Permette al form di usare lo spazio rimanente */
    }

    .quote_builder_wrapper .tabcontent.active {
        display: flex;
        flex-direction: column;
        flex-grow: 1; 
        flex-basis: 0; 
        overflow-y: visible !important; /* Deve scorrere il genitore, non lo step */
    }

    /* Proteggere i Pulsanti */
    .quote_builder_wrapper .btn-wrapper {
        flex-shrink: 0; 
        margin-top: auto; 
        padding-bottom: 20px;
    }
    
    /* (Mantenere le regole per il form dati personali dello Step 5) */
    .quote_builder_wrapper #quote_personal_data {
        flex-shrink: 0; 
        margin-top: 15px; 
        padding-bottom: 10px;
    }
}

/* --- CSS per la Tabella Responsive (Step 5) --- */
@media (max-width: 768px) {

    .quote_builder_wrapper table.quote_summary_table {
        border: none; /* Rimuovi i bordi esterni della tabella */
        border-collapse: separate; /* Permette di dare margine tra le righe */
        border-spacing: 0 10px; /* Aggiunge spazio verticale tra le "schede" */
        width: 100%;
        font-size: .8em; /* Torna a font normale per migliorare la leggibilità */
    }

    /* Nascondi le intestazioni della tabella */
    .quote_builder_wrapper table.quote_summary_table thead {
        display: none;
    }

    /* Trasforma ogni riga (tr) in un blocco/scheda */
    .quote_builder_wrapper table.quote_summary_table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 5px;
        background-color: #f9f9f9;
    }

    /* Trasforma ogni cella (td) in un blocco, usa flexbox per allineamento etichetta/valore */
    .quote_builder_wrapper table.quote_summary_table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right !important; /* Allineamento del valore a destra */
        padding: 5px 10px;
        border: none;
    }

    /* Aggiungi le etichette delle colonne usando gli attributi data-* e il pseudo-elemento ::before */
    .quote_builder_wrapper table.quote_summary_table td::before {
        /* Questo è il trucco: usiamo i nomi delle colonne come etichette su mobile */
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        flex-basis: 50%; /* Diamo spazio all'etichetta */
    }
    
    /* Regola l'elemento "Elemento" (prima colonna) */
    .quote_builder_wrapper table.quote_summary_table td:first-child {
        text-align: left !important;
        font-weight: bold; /* Evidenzia il nome dell'elemento */
        border-right: none;
    }

    /* Gestisci il footer (Totale) */
    .quote_builder_wrapper table.quote_summary_table tfoot tr {
        display: flex;
        justify-content: space-between;
        border: 1px solid #C81F24;
        background-color: #f0f0f0;
        padding: 10px;
        font-size: 1.1em;
    }
    .quote_builder_wrapper table.quote_summary_table tfoot td {
        display: block;
        padding: 0;
        text-align: right !important;
    }
    
    .quote_builder_wrapper table.quote_summary_table tfoot td:first-child {
        text-align: left !important;
    }
}

/*custom-modal*/
/* Container modale */
#ddg-custom-modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 2rem 1rem;
    /* per margine su piccoli schermi */
    box-sizing: border-box;
    animation: fadeIn 0.2s ease-in-out;
}

/* Box interno */
#ddg-custom-modal>div {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.25s ease-out;
    font-family: sans-serif;
}

/* Titolo */
#ddg-custom-modal h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

/* Messaggio */
#ddg-custom-modal p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 2rem;
}

/* Pulsanti */
#ddg-custom-modal button {
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    margin: 0 0.5rem;
    transition: background 0.2s, transform 0.2s;
}

/* Pulsante conferma */
#ddg-modal-confirm {
    background: #C81F24;
    color: white;
}

#ddg-modal-confirm:hover {
    background: #EC252B;
    transform: scale(1.05);
}

/* Pulsante annulla */
.ddg-modal-cancel {
    background: #e0e0e0;
    color: #333;
}

.ddg-modal-cancel:hover {
    background: #c6c6c6;
    transform: scale(1.05);
}

/* Animazioni */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}
.quote_builder_wrapper .get-my-quote {
    cursor: pointer;
}

.quote_builder_wrapper .email-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ddg-main-modal */
/* Container Principale */
#ddg-main-modal {
    display: none; /* Nascosta di default */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

/* Overlay scuro */
.ddg-main-modal-overlay {
    position: absolute;
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

/* Corpo della Modal */
.ddg-main-modal-body {
    position: relative;
    background: #fff;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    margin: 0 auto !important; /* Forza il centro orizzontale */
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow: hidden;
}

#ddg-main-modal .progress-bar {
  background-color: #C81F24;
}

/* Header e Footer fissi */
.ddg-main-modal-header, .ddg-main-modal-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}
.ddg-main-modal-footer {
    border-bottom: none;
    border-top: 1px solid #dee2e6;
}

/* Contenuto scrollabile */
.ddg-main-modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

/* Bottone chiusura */
.ddg-close {
    float: right;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

/* Loader Overlay */
#ddg-page-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    z-index: 10;
    align-items: center;
    justify-content: center;
}
#ddg-page-overlay.overlay-visible { display: flex; }

#deleting-data {
    background: #fff;
    padding: 20px;
    font-weight: bold;
    border: 2px solid #C81F24;
}
/* fine ddg-main-modal */