/* ==========================================================
   CATALOGO MODULI FOTOVOLTAICI
   ========================================================== */

.fv-card-componente li.rf2-fv-produttore {
    cursor: pointer;
    border-radius: 7px;
    padding: 5px 7px;
    margin-left: -7px;
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.fv-card-componente li.rf2-fv-produttore:hover,
.fv-card-componente li.rf2-fv-produttore:focus {
    background: #edf7ed;
    color: #195d24;
    outline: none;
    transform: translateX(3px);
}

.fv-card-componente li.rf2-fv-produttore::after {
    content: "›";
    float: right;
    font-weight: 900;
    color: #398743;
}

.fv-card-componente li.rf2-fv-produttore-selezionato {
    background: #dff1df;
    color: #14551d;
    font-weight: 700;
}

.rf2-fv-modulo-selezionato {
    margin-top: 14px;
    padding: 12px 13px;
    border: 1px solid #9fc8a3;
    border-left: 6px solid #398743;
    border-radius: 9px;
    background: #f3faf3;
    color: #193d1e;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
}

.rf2-fv-modulo-selezionato strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.rf2-fv-popup {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.68);
}

.rf2-fv-popup.rf2-fv-popup-aperto {
    display: flex;
}

.rf2-fv-popup-box {
    position: relative;
    width: min(680px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    overflow-y: auto;
    box-sizing: border-box;
    padding: 28px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
}

.rf2-fv-popup-chiudi {
    position: absolute;
    top: 10px;
    right: 13px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #eeeeee;
    color: #222222;
    font-size: 24px;
    line-height: 38px;
    cursor: pointer;
}

.rf2-fv-popup-chiudi:hover {
    background: #dddddd;
}

.rf2-fv-popup-titolo {
    margin: 0 46px 8px 0;
    color: #263238;
    font-size: 27px;
}

.rf2-fv-popup-sottotitolo {
    margin: 0 0 22px;
    color: #555555;
    font-size: 15px;
}

.rf2-fv-modello {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 13px;
    padding: 17px;
    border: 1px solid #dddddd;
    border-radius: 12px;
    background: #fafafa;
}

.rf2-fv-modello:last-child {
    margin-bottom: 0;
}

.rf2-fv-modello-nome {
    margin-bottom: 6px;
    color: #263238;
    font-size: 18px;
    font-weight: 800;
}

.rf2-fv-modello-dati {
    color: #444444;
    font-size: 14px;
    line-height: 1.55;
}

.rf2-fv-modello-prezzo {
    color: #176122;
    font-size: 18px;
    font-weight: 800;
}

.rf2-fv-seleziona-modello {
    min-width: 118px;
    padding: 11px 16px;
    border: 0;
    border-radius: 9px;
    background: #398743;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.rf2-fv-seleziona-modello:hover {
    background: #2d7035;
}

.rf2-fv-riepilogo-calcolo {
    margin: 12px 20px 2px;
    padding: 12px 15px;
    border-radius: 10px;
    background: rgba(255,255,255,0.16);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

.rf2-fv-riepilogo-calcolo strong {
    font-size: 15px;
}

@media (max-width: 620px) {
    .rf2-fv-popup {
        padding: 12px;
    }

    .rf2-fv-popup-box {
        padding: 23px 17px 18px;
    }

    .rf2-fv-modello {
        grid-template-columns: 1fr;
    }

    .rf2-fv-seleziona-modello {
        width: 100%;
    }
}

/* RF2 FV MODULI LATERALI COMPATTI - START */

/* Riquadri laterali */
.fv-layout-3col .fv-card-componente {
    box-sizing: border-box;
    margin-bottom: 12px;
    padding: 15px 17px;
    border-radius: 15px;
}

/* Titoli */
.fv-layout-3col .fv-card-componente h3 {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.08;
}

/* Elenchi */
.fv-layout-3col .fv-card-componente ul {
    margin: 0;
    padding-left: 18px;
}

/* Singole righe */
.fv-layout-3col .fv-card-componente li {
    margin: 0;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 15px;
    line-height: 1.18;
}

/* Marchi cliccabili */
.fv-layout-3col .fv-card-componente li.rf2-fv-produttore {
    margin-left: -5px;
    padding: 4px 7px;
    border-radius: 7px;
}

/* Riduce lo spostamento al passaggio del mouse */
.fv-layout-3col .fv-card-componente li.rf2-fv-produttore:hover,
.fv-layout-3col .fv-card-componente li.rf2-fv-produttore:focus {
    transform: translateX(2px);
}

/* Riepilogo del prodotto selezionato */
.fv-layout-3col .rf2-fv-modulo-selezionato {
    margin-top: 9px;
    padding: 9px 10px;
    border-left-width: 5px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.22;
}

/* Nome del prodotto */
.fv-layout-3col .rf2-fv-modulo-selezionato strong {
    margin-bottom: 4px;
    font-size: 12.5px;
    line-height: 1.2;
}

/* Colonne laterali più ravvicinate verticalmente */
.fv-colonna-componenti,
.fv-colonna-destra-componenti {
    gap: 12px;
}

/* Adattamento per schermi meno larghi */
@media (max-width: 1450px) {
    .fv-layout-3col .fv-card-componente {
        padding: 13px 14px;
    }

    .fv-layout-3col .fv-card-componente h3 {
        font-size: 20px;
    }

    .fv-layout-3col .fv-card-componente li {
        font-size: 14px;
    }
}

/* RF2 FV MODULI LATERALI COMPATTI - END */

/* RF2 FV COLONNA DESTRA AFFIANCATA - START */

/* Desktop: Colonnine a sinistra, Batterie e Componenti a destra */
.fv-layout-3col > aside:last-of-type {
    display: grid !important;
    grid-template-columns: minmax(340px, 1.45fr) minmax(230px, 1fr) !important;
    gap: 18px !important;
    align-items: start !important;
    align-content: start !important;
}

/* 1 = Batterie */
.fv-layout-3col > aside:last-of-type .fv-card-componente:nth-child(1) {
    grid-column: 2 !important;
    grid-row: 1 !important;
}

/* 2 = Colonnine auto */
.fv-layout-3col > aside:last-of-type .fv-card-componente:nth-child(2) {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
}

/* 3 = Componenti del sistema */
.fv-layout-3col > aside:last-of-type .fv-card-componente:nth-child(3) {
    grid-column: 2 !important;
    grid-row: 2 !important;
}

/* Il modulo colonnine sfrutta meglio lo spazio */
.fv-layout-3col > aside:last-of-type .fv-card-componente:nth-child(2) ul {
    margin: 0 !important;
    padding-left: 18px !important;
}

.fv-layout-3col > aside:last-of-type .fv-card-componente:nth-child(2) .rf2-fv-modulo-selezionato,
.fv-layout-3col > aside:last-of-type .fv-card-componente:nth-child(2) #rf2FvColonninaSelezionata {
    margin-top: 14px !important;
}

/* Tablet e schermi medi: torna in colonna */
@media (max-width: 1200px) {
    .fv-layout-3col > aside:last-of-type {
        display: flex !important;
        flex-direction: column !important;
        gap: 18px !important;
    }

    .fv-layout-3col > aside:last-of-type .fv-card-componente:nth-child(1),
    .fv-layout-3col > aside:last-of-type .fv-card-componente:nth-child(2),
    .fv-layout-3col > aside:last-of-type .fv-card-componente:nth-child(3) {
        grid-column: auto !important;
        grid-row: auto !important;
    }
}

/* RF2 FV COLONNA DESTRA AFFIANCATA - END */

/* RF2 FV TUTTI I MODULI ENTRO PAGINA - START */

/* Evita qualsiasi allargamento oltre lo schermo */
html,
body,
.pagina-fv-hero {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Griglia principale equilibrata */
.fv-layout-3col {
    display: grid !important;

    grid-template-columns:
        minmax(245px, 285px)
        minmax(540px, 1fr)
        minmax(500px, 590px) !important;

    gap: 18px !important;
    align-items: start !important;

    width: calc(100vw - 36px) !important;
    max-width: 1740px !important;

    margin-left: auto !important;
    margin-right: auto !important;

    padding-left: 0 !important;
    padding-right: 0 !important;

    box-sizing: border-box !important;
}

/* Tutti i figli della griglia possono restringersi */
.fv-layout-3col > *,
.fv-layout-3col aside,
.fv-layout-3col section {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Colonna sinistra */
.fv-layout-3col > aside:first-of-type {
    width: 100% !important;

    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
}

/* Preventivatore centrale */
.fv-layout-3col > .box-preventivatore-incentivi {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Colonna destra */
.fv-layout-3col > aside:last-of-type {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    display: grid !important;

    grid-template-columns:
        minmax(0, 1.32fr)
        minmax(0, 0.88fr) !important;

    gap: 16px !important;
    align-items: start !important;

    box-sizing: border-box !important;
}

/* Colonnine auto: colonna principale */
.fv-layout-3col > aside:last-of-type
.fv-card-componente:nth-child(2) {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
}

/* Batterie: in alto a destra */
.fv-layout-3col > aside:last-of-type
.fv-card-componente:nth-child(1) {
    grid-column: 2 !important;
    grid-row: 1 !important;
}

/* Componenti: sotto Batterie */
.fv-layout-3col > aside:last-of-type
.fv-card-componente:nth-child(3) {
    grid-column: 2 !important;
    grid-row: 2 !important;
}

/* Tutti i riquadri laterali */
.fv-layout-3col .fv-card-componente {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    margin: 0 !important;
    padding: 15px 16px !important;

    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Titoli */
.fv-layout-3col .fv-card-componente h3 {
    max-width: 100% !important;

    margin: 0 0 11px !important;

    font-size: 20px !important;
    line-height: 1.12 !important;

    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

/* Elenchi */
.fv-layout-3col .fv-card-componente ul {
    width: 100% !important;
    max-width: 100% !important;

    margin: 0 !important;
    padding-left: 17px !important;

    box-sizing: border-box !important;
}

/* Singoli prodotti */
.fv-layout-3col .fv-card-componente li {
    width: auto !important;
    max-width: 100% !important;

    margin: 0 !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;

    font-size: 13px !important;
    line-height: 1.22 !important;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Prodotti cliccabili */
.fv-layout-3col .fv-card-componente
li.rf2-fv-produttore {
    margin-left: -4px !important;
    padding: 5px 7px !important;

    box-sizing: border-box !important;
}

/* Riepiloghi dei prodotti selezionati */
.fv-layout-3col .rf2-fv-modulo-selezionato {
    width: 100% !important;
    max-width: 100% !important;

    margin-top: 11px !important;
    padding: 10px 11px !important;

    box-sizing: border-box !important;

    font-size: 11.5px !important;
    line-height: 1.27 !important;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Nome del prodotto selezionato */
.fv-layout-3col .rf2-fv-modulo-selezionato strong {
    max-width: 100% !important;

    font-size: 12px !important;
    line-height: 1.22 !important;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Componenti del sistema più compatti */
.fv-layout-3col > aside:last-of-type
.fv-card-componente:nth-child(3) {
    padding-left: 13px !important;
    padding-right: 13px !important;
}

.fv-layout-3col > aside:last-of-type
.fv-card-componente:nth-child(3) li {
    font-size: 12px !important;
}

/* ---------------------------------------------------
   NOTEBOOK E SCHERMI MEDI
   --------------------------------------------------- */

@media (max-width: 1450px) {

    .fv-layout-3col {
        grid-template-columns:
            minmax(230px, 260px)
            minmax(500px, 1fr)
            minmax(430px, 500px) !important;

        gap: 14px !important;
        width: calc(100vw - 24px) !important;
    }

    .fv-layout-3col .fv-card-componente {
        padding: 13px 14px !important;
    }

    .fv-layout-3col .fv-card-componente h3 {
        font-size: 18px !important;
    }

    .fv-layout-3col .fv-card-componente li {
        font-size: 12px !important;
    }
}

/* ---------------------------------------------------
   SOTTO 1280 PX: COLONNA DESTRA SOTTO
   --------------------------------------------------- */

@media (max-width: 1280px) {

    .fv-layout-3col {
        grid-template-columns:
            minmax(230px, 270px)
            minmax(0, 1fr) !important;
    }

    .fv-layout-3col > aside:first-of-type {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .fv-layout-3col > .box-preventivatore-incentivi {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .fv-layout-3col > aside:last-of-type {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;

        grid-template-columns:
            repeat(3, minmax(0, 1fr)) !important;
    }

    .fv-layout-3col > aside:last-of-type
    .fv-card-componente:nth-child(1) {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .fv-layout-3col > aside:last-of-type
    .fv-card-componente:nth-child(2) {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .fv-layout-3col > aside:last-of-type
    .fv-card-componente:nth-child(3) {
        grid-column: 3 !important;
        grid-row: 1 !important;
    }
}

/* ---------------------------------------------------
   SMARTPHONE
   --------------------------------------------------- */

@media (max-width: 760px) {

    .fv-layout-3col {
        display: flex !important;
        flex-direction: column !important;

        width: calc(100vw - 18px) !important;
        gap: 14px !important;
    }

    .fv-layout-3col > .box-preventivatore-incentivi {
        order: -1 !important;
    }

    .fv-layout-3col > aside:first-of-type,
    .fv-layout-3col > aside:last-of-type {
        display: flex !important;
        flex-direction: column !important;

        width: 100% !important;
    }
}

/* RF2 FV TUTTI I MODULI ENTRO PAGINA - END */

/* RF2 FV MODULO CENTRALE PIU STRETTO - START */

/* Restringe il preventivatore e lo centra */
.fv-layout-3col > .box-preventivatore-incentivi,
.box-preventivatore-incentivi {
    width: min(100%, 860px) !important;
    max-width: 860px !important;
    min-width: 0 !important;

    justify-self: center !important;
    align-self: start !important;

    margin-left: auto !important;
    margin-right: auto !important;

    box-sizing: border-box !important;
}

/* I campi interni seguono la nuova larghezza */
.box-preventivatore-incentivi .griglia-incentivi,
.box-preventivatore-incentivi .campo-incentivi,
.box-preventivatore-incentivi select,
.box-preventivatore-incentivi .campo-ponteggio-fv {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Su schermi più piccoli torna fluido */
@media (max-width: 980px) {
    .fv-layout-3col > .box-preventivatore-incentivi,
    .box-preventivatore-incentivi {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* RF2 FV MODULO CENTRALE PIU STRETTO - END */

/* RF2 FV CAMPI SELECT PIU STRETTI - START */

/* Restringe solo i campi bianchi del preventivatore */
.box-preventivatore-incentivi .campo-incentivi select,
.box-preventivatore-incentivi select {
    width: min(100%, 620px) !important;
    max-width: 620px !important;
    min-width: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* Anche il riquadro ponteggio segue una larghezza più compatta */
.box-preventivatore-incentivi .campo-ponteggio-fv {
    width: min(100%, 650px) !important;
    max-width: 650px !important;
    box-sizing: border-box !important;
}

/* Il pulsante può restare centrato sotto */
.box-preventivatore-incentivi button[onclick*="calcolaIncentivoFotovoltaico"],
.box-preventivatore-incentivi .btn-calcola-incentivi {
    display: block !important;
}

/* Su schermi piccoli i campi tornano pieni */
@media (max-width: 760px) {
    .box-preventivatore-incentivi .campo-incentivi select,
    .box-preventivatore-incentivi select,
    .box-preventivatore-incentivi .campo-ponteggio-fv {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* RF2 FV CAMPI SELECT PIU STRETTI - END */

/* RF2 FV PREVENTIVATORE COMPATTO UNIFORME - START */

/* Riquadro centrale più stretto */
.fv-layout-3col > .box-preventivatore-incentivi,
.pagina-fv-hero .box-preventivatore-incentivi,
.box-preventivatore-incentivi {
    width: 780px !important;
    max-width: 100% !important;
    min-width: 0 !important;

    justify-self: center !important;
    align-self: start !important;

    margin-left: auto !important;
    margin-right: auto !important;

    padding-left: 28px !important;
    padding-right: 28px !important;

    box-sizing: border-box !important;
}

/* Griglia interna centrata */
.box-preventivatore-incentivi .griglia-incentivi {
    width: 660px !important;
    max-width: 100% !important;

    margin-left: auto !important;
    margin-right: auto !important;

    box-sizing: border-box !important;
}

/* Tutti i campi, compresa la prima riga */
.box-preventivatore-incentivi #potenzaKw,
.box-preventivatore-incentivi #tipoCoperturaFV,
.box-preventivatore-incentivi #configurazionePannelliFV,
.box-preventivatore-incentivi #numeroColonnineFV,
.box-preventivatore-incentivi #batteriaAccumuloFV {
    display: block !important;

    width: 660px !important;
    max-width: 100% !important;
    min-width: 0 !important;

    margin-left: auto !important;
    margin-right: auto !important;

    box-sizing: border-box !important;
}

/* Contenitori delle cinque righe */
.box-preventivatore-incentivi .campo-incentivi {
    width: 660px !important;
    max-width: 100% !important;

    margin-left: auto !important;
    margin-right: auto !important;

    box-sizing: border-box !important;
}

/*
 * Neutralizza eventuali regole precedenti che
 * rendevano la prima select più larga.
 */
.box-preventivatore-incentivi
.griglia-incentivi
.campo-incentivi:first-child,
.box-preventivatore-incentivi
.griglia-incentivi
.campo-incentivi:first-child select,
.box-preventivatore-incentivi select:first-of-type {
    width: 660px !important;
    max-width: 100% !important;
}

/* Ponteggio allineato ai campi */
.box-preventivatore-incentivi .campo-ponteggio-fv {
    width: 660px !important;
    max-width: 100% !important;

    margin-left: auto !important;
    margin-right: auto !important;

    box-sizing: border-box !important;
}

/* Titolo e nota allineati alla larghezza utile */
.box-preventivatore-incentivi > h2 {
    width: 660px !important;
    max-width: 100% !important;

    margin-left: auto !important;
    margin-right: auto !important;
}

.box-preventivatore-incentivi
.testo-supporto-incentivi,
.box-preventivatore-incentivi
.nota-preventivatore-fv {
    width: 660px !important;
    max-width: 100% !important;

    margin-left: auto !important;
    margin-right: auto !important;
}

/* Tablet e smartphone */
@media (max-width: 820px) {
    .fv-layout-3col > .box-preventivatore-incentivi,
    .pagina-fv-hero .box-preventivatore-incentivi,
    .box-preventivatore-incentivi {
        width: 100% !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .box-preventivatore-incentivi .griglia-incentivi,
    .box-preventivatore-incentivi .campo-incentivi,
    .box-preventivatore-incentivi #potenzaKw,
    .box-preventivatore-incentivi #tipoCoperturaFV,
    .box-preventivatore-incentivi #configurazionePannelliFV,
    .box-preventivatore-incentivi #numeroColonnineFV,
    .box-preventivatore-incentivi #batteriaAccumuloFV,
    .box-preventivatore-incentivi .campo-ponteggio-fv,
    .box-preventivatore-incentivi > h2 {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* RF2 FV PREVENTIVATORE COMPATTO UNIFORME - END */



/* RF2 FV GRIGLIA DESTRA DEFINITIVA - START */

/*
 * Ordine dei riquadri dopo lo spostamento:
 *
 * 1 = Inverter
 * 2 = Batterie
 * 3 = Colonnine auto
 * 4 = Componenti del sistema
 */

/* Desktop e notebook larghi */
@media (min-width: 1281px) {

    .fv-layout-3col > aside:last-of-type {
        display: grid !important;

        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        grid-template-rows:
            auto auto !important;

        gap: 18px !important;

        align-items: start !important;
        align-content: start !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        position: relative !important;
        top: -30px !important;

        box-sizing: border-box !important;
    }

    /* Inverter: alto a sinistra */
    .fv-layout-3col > aside:last-of-type
    .fv-card-componente:nth-child(1) {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    /* Batterie: sotto Inverter */
    .fv-layout-3col > aside:last-of-type
    .fv-card-componente:nth-child(2) {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    /* Colonnine auto: alto a destra */
    .fv-layout-3col > aside:last-of-type
    .fv-card-componente:nth-child(3) {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    /* Componenti: sotto Colonnine */
    .fv-layout-3col > aside:last-of-type
    .fv-card-componente:nth-child(4) {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }
}

/* Tutti i riquadri della colonna destra */
.fv-layout-3col > aside:last-of-type
.fv-card-componente {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    margin: 0 !important;

    box-sizing: border-box !important;

    align-self: start !important;
}

/* Riepiloghi dei prodotti selezionati */
.fv-layout-3col > aside:last-of-type
.rf2-fv-modulo-selezionato {
    width: 100% !important;
    max-width: 100% !important;

    box-sizing: border-box !important;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Evita che i testi lunghi allarghino la griglia */
.fv-layout-3col > aside:last-of-type h3,
.fv-layout-3col > aside:last-of-type li,
.fv-layout-3col > aside:last-of-type strong {
    max-width: 100% !important;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Tablet: mantiene la disposizione 2 × 2 */
@media (min-width: 761px) and (max-width: 1280px) {

    .fv-layout-3col > aside:last-of-type {
        display: grid !important;

        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        gap: 16px !important;

        position: static !important;
        top: auto !important;
    }

    .fv-layout-3col > aside:last-of-type
    .fv-card-componente:nth-child(1) {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .fv-layout-3col > aside:last-of-type
    .fv-card-componente:nth-child(2) {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    .fv-layout-3col > aside:last-of-type
    .fv-card-componente:nth-child(3) {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .fv-layout-3col > aside:last-of-type
    .fv-card-componente:nth-child(4) {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }
}

/* Smartphone: tutti i moduli in successione */
@media (max-width: 760px) {

    .fv-layout-3col > aside:last-of-type {
        display: flex !important;
        flex-direction: column !important;

        gap: 14px !important;

        position: static !important;
        top: auto !important;
    }

    .fv-layout-3col > aside:last-of-type
    .fv-card-componente {
        grid-column: auto !important;
        grid-row: auto !important;
    }
}

/* RF2 FV GRIGLIA DESTRA DEFINITIVA - END */

/* RF2 FV ANGOLI PREVENTIVATORE VISIBILI - START */

/* Il riquadro centrale termina subito dopo i contenuti */
.fv-layout-3col > .box-preventivatore-incentivi,
.pagina-fv-hero .box-preventivatore-incentivi,
.box-preventivatore-incentivi {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    align-self: start !important;

    padding-bottom: 24px !important;
    margin-bottom: 34px !important;

    border-radius: 18px !important;
    overflow: hidden !important;

    box-sizing: border-box !important;
}

/* Riduce lo spazio vuoto sotto la nota finale */
.box-preventivatore-incentivi
.testo-supporto-incentivi,
.box-preventivatore-incentivi
.nota-preventivatore-fv {
    margin-top: 12px !important;
    margin-bottom: 0 !important;
}

/* Spazio tra il contenuto e il footer */
.fv-layout-3col {
    align-items: start !important;
    padding-bottom: 45px !important;
}

/* La pagina deve poter crescere in altezza */
.pagina-fv-hero {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

html,
body {
    overflow-y: auto !important;
}

/* RF2 FV ANGOLI PREVENTIVATORE VISIBILI - END */

/* RF2 FV RIMOZIONE GRIGIO INFERIORE - START */

/* Il riquadro termina subito dopo il contenuto effettivo */
.fv-layout-3col > .box-preventivatore-incentivi,
.pagina-fv-hero .box-preventivatore-incentivi,
.box-preventivatore-incentivi {
    height: fit-content !important;
    min-height: 0 !important;
    max-height: none !important;

    align-self: start !important;

    padding-bottom: 16px !important;
    margin-bottom: 26px !important;

    border-radius: 18px !important;
    box-sizing: border-box !important;
}

/* Nota finale più vicina al bordo inferiore */
.box-preventivatore-incentivi
.testo-supporto-incentivi,
.box-preventivatore-incentivi
.nota-preventivatore-fv {
    margin-top: 10px !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/*
 * L'area del risultato non deve occupare spazio
 * prima che venga eseguito il calcolo.
 */
.box-preventivatore-incentivi
#risultatoIncentivi {
    min-height: 0 !important;
    height: auto !important;
    margin-bottom: 0 !important;
}

.box-preventivatore-incentivi
#risultatoIncentivi:empty {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* Elimina eventuali altezze imposte alla griglia interna */
.box-preventivatore-incentivi
.griglia-incentivi {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-bottom: 0 !important;
}

/* RF2 FV RIMOZIONE GRIGIO INFERIORE - END */



/* RF2 FV POPUP INVERTER COMPATTO - START */

/*
 * Il popup rimane compreso fra intestazione e footer.
 * Lo scorrimento avviene soltanto dentro il riquadro bianco.
 */
#rf2FvPopupInverter {
    padding:
        82px
        18px
        68px !important;

    align-items: center !important;
    justify-content: center !important;

    overflow: hidden !important;
    box-sizing: border-box !important;

    z-index: 300000 !important;
}

/* Finestra principale */
#rf2FvPopupInverter .rf2-fv-popup-box {
    width: min(
        760px,
        calc(100vw - 36px)
    ) !important;

    max-width: 760px !important;

    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 150px) !important;

    padding:
        18px
        20px
        20px !important;

    border-radius: 14px !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;

    scrollbar-gutter: stable;

    box-sizing: border-box !important;
}

/* Titolo */
#rf2FvPopupInverter .rf2-fv-popup-titolo {
    margin:
        0
        42px
        6px
        0 !important;

    font-size: 25px !important;
    line-height: 1.1 !important;
}

/* Testo introduttivo */
#rf2FvPopupInverter .rf2-fv-popup-sottotitolo {
    margin:
        0
        0
        14px !important;

    font-size: 14px !important;
    line-height: 1.25 !important;
}

/* Pulsante di chiusura */
#rf2FvPopupInverter .rf2-fv-popup-chiudi {
    top: 8px !important;
    right: 10px !important;

    width: 34px !important;
    height: 34px !important;

    font-size: 21px !important;
    line-height: 34px !important;
}

/* Singola scheda inverter */
#rf2FvPopupInverter .rf2-fv-modello {
    display: grid !important;

    grid-template-columns:
        minmax(0, 1fr)
        118px !important;

    gap: 13px !important;
    align-items: center !important;

    margin-bottom: 9px !important;

    padding:
        12px
        14px !important;

    border-radius: 10px !important;

    box-sizing: border-box !important;
}

/* Nome del modello */
#rf2FvPopupInverter .rf2-fv-modello-nome {
    margin-bottom: 4px !important;

    font-size: 16px !important;
    line-height: 1.15 !important;

    overflow-wrap: anywhere !important;
}

/* Caratteristiche tecniche */
#rf2FvPopupInverter .rf2-fv-modello-dati {
    font-size: 13px !important;
    line-height: 1.28 !important;
}

/* Pulsante Seleziona */
#rf2FvPopupInverter .rf2-fv-seleziona-modello {
    min-width: 0 !important;
    width: 118px !important;

    padding:
        10px
        8px !important;

    font-size: 14px !important;
    line-height: 1.1 !important;
}

/* Smartphone */
@media (max-width: 620px) {

    #rf2FvPopupInverter {
        padding:
            74px
            10px
            55px !important;
    }

    #rf2FvPopupInverter .rf2-fv-popup-box {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100dvh - 129px) !important;

        padding:
            17px
            14px
            16px !important;
    }

    #rf2FvPopupInverter .rf2-fv-modello {
        grid-template-columns: 1fr !important;
    }

    #rf2FvPopupInverter .rf2-fv-seleziona-modello {
        width: 100% !important;
    }
}

/* RF2 FV POPUP INVERTER COMPATTO - END */

/* RF2 FV POSIZIONE VERTICALE DEFINITIVA - START */

/*
 * La barra comandi è fissa e occupa la parte alta.
 * Il contenuto viene abbassato internamente, senza
 * aumentare l'altezza della pagina.
 */
html,
body {
    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

/* Contenitore principale */
main.pagina-fv-hero,
.pagina-fv-hero {
    width: 100% !important;
    max-width: 100% !important;

    height: 100% !important;
    min-height: 0 !important;

    margin: 0 !important;

    /*
     * Circa 44 px compensano la barra nera fissa.
     * Il padding è interno e non genera scroll.
     */
    padding:
        44px
        16px
        8px !important;

    overflow-x: hidden !important;
    overflow-y: hidden !important;

    box-sizing: border-box !important;
}

/* Posizione naturale dell'intera griglia */
.fv-layout-3col {
    position: static !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    transform: none !important;

    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;

    max-height: 100% !important;

    align-items: start !important;
    box-sizing: border-box !important;
}

/* Annulla gli spostamenti dei singoli moduli */
.fv-layout-3col > aside:first-of-type,
.fv-layout-3col > aside:last-of-type,
.fv-layout-3col > .box-preventivatore-incentivi {
    position: static !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    transform: none !important;

    margin-top: 0 !important;

    align-self: start !important;
}

/* Nessuna barra nel contenitore principale */
main.pagina-fv-hero::-webkit-scrollbar,
.pagina-fv-hero::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/*
 * Lo scorrimento resta disponibile esclusivamente
 * dentro i popup con molti prodotti.
 */
.rf2-fv-popup {
    overflow: hidden !important;
}

.rf2-fv-popup .rf2-fv-popup-box {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* Su tablet e smartphone la pagina può scorrere */
@media (max-width: 1280px) {
    html,
    body {
        height: auto !important;
        overflow-y: auto !important;
    }

    main.pagina-fv-hero,
    .pagina-fv-hero {
        height: auto !important;
        padding-top: 16px !important;
        overflow-y: visible !important;
    }
}

/* RF2 FV POSIZIONE VERTICALE DEFINITIVA - END */

/* RF2 FV MODULO CENTRALE COMPATTO - START */

/* Modulo centrale molto più compatto */
.fv-layout-3col > .box-preventivatore-incentivi,
.pagina-fv-hero .box-preventivatore-incentivi,
.box-preventivatore-incentivi {
    width: min(720px, calc(100vw - 80px)) !important;
    max-width: 720px !important;

    padding: 22px 26px 18px !important;
    border-radius: 18px !important;

    box-sizing: border-box !important;
}

/* Titolo principale */
.box-preventivatore-incentivi h1,
.box-preventivatore-incentivi h2,
.box-preventivatore-incentivi .titolo-preventivatore-fv {
    font-size: 24px !important;
    line-height: 1.15 !important;
    margin-bottom: 16px !important;
}

/* Griglia interna più stretta */
.box-preventivatore-incentivi .griglia-incentivi,
.box-preventivatore-incentivi .contenuto-preventivatore-fv {
    row-gap: 10px !important;
    column-gap: 0 !important;
}

/* Etichette più compatte */
.box-preventivatore-incentivi label,
.box-preventivatore-incentivi .campo-incentivi > label {
    font-size: 13px !important;
    line-height: 1.15 !important;
    margin-bottom: 4px !important;
}

/* Select e campi */
.box-preventivatore-incentivi select,
.box-preventivatore-incentivi input[type="text"],
.box-preventivatore-incentivi input[type="number"] {
    height: 40px !important;
    min-height: 40px !important;

    padding: 6px 12px !important;

    font-size: 13px !important;
    line-height: 1.15 !important;

    border-radius: 8px !important;
    box-sizing: border-box !important;
}

/* Riga ponteggio */
.box-preventivatore-incentivi .campo-ponteggio-fv,
.box-preventivatore-incentivi .ponteggio-fv,
.box-preventivatore-incentivi .box-ponteggio-fv {
    padding: 10px 14px !important;
    margin-top: 2px !important;
    border-radius: 10px !important;
}

/* Pulsante calcolo più piccolo */
.box-preventivatore-incentivi .btn-calcola-incentivi,
.box-preventivatore-incentivi button[onclick*="calcolaIncentivoFotovoltaico"],
.box-preventivatore-incentivi button[onclick*="calcolaPreventivo"] {
    min-width: 0 !important;
    width: auto !important;

    padding: 11px 24px !important;
    font-size: 15px !important;
    line-height: 1.1 !important;

    margin-top: 10px !important;
    margin-bottom: 6px !important;

    border-radius: 10px !important;
}

/* Nota sotto il pulsante */
.box-preventivatore-incentivi .testo-supporto-incentivi,
.box-preventivatore-incentivi .nota-preventivatore-fv,
.box-preventivatore-incentivi .testo-simulazione-fv {
    font-size: 12px !important;
    line-height: 1.2 !important;
    margin-top: 8px !important;
    margin-bottom: 0 !important;
}

/* Riquadro del risultato finale meno invasivo */
.box-preventivatore-incentivi #risultatoIncentivi,
.box-preventivatore-incentivi .risultato-incentivi,
.box-preventivatore-incentivi .risultato-fv-wrapper {
    margin-top: 14px !important;
}

.box-preventivatore-incentivi .risultato-fv-totale-unico,
.box-preventivatore-incentivi .risultato-fv-totale,
.box-preventivatore-incentivi .box-risultato-fv {
    padding: 14px 16px !important;
    border-radius: 14px !important;
}

.box-preventivatore-incentivi .risultato-fv-totale-titolo,
.box-preventivatore-incentivi .risultato-fv-totale-label {
    font-size: 13px !important;
    line-height: 1.15 !important;
}

.box-preventivatore-incentivi .risultato-fv-totale-importo,
.box-preventivatore-incentivi .risultato-fv-totale-valore {
    font-size: 34px !important;
    line-height: 1 !important;
}

/* Anche su schermi medi resta compatto */
@media (max-width: 1280px) {
    .fv-layout-3col > .box-preventivatore-incentivi,
    .pagina-fv-hero .box-preventivatore-incentivi,
    .box-preventivatore-incentivi {
        width: min(680px, calc(100vw - 50px)) !important;
        max-width: 680px !important;
        padding: 18px 20px 16px !important;
    }
}

@media (max-width: 768px) {
    .fv-layout-3col > .box-preventivatore-incentivi,
    .pagina-fv-hero .box-preventivatore-incentivi,
    .box-preventivatore-incentivi {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        padding: 16px 16px 14px !important;
    }

    .box-preventivatore-incentivi h1,
    .box-preventivatore-incentivi h2,
    .box-preventivatore-incentivi .titolo-preventivatore-fv {
        font-size: 21px !important;
    }

    .box-preventivatore-incentivi .risultato-fv-totale-importo,
    .box-preventivatore-incentivi .risultato-fv-totale-valore {
        font-size: 28px !important;
    }
}

/* RF2 FV MODULO CENTRALE COMPATTO - END */

/* RF2 FV RISULTATO COMPLETO VISIBILE - START */

/*
 * Stato iniziale:
 * la pagina rimane senza scroll quando non esiste
 * ancora il risultato del calcolo.
 */
html:not(.rf2-fv-risultato-visibile),
html:not(.rf2-fv-risultato-visibile) body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/*
 * Dopo il calcolo:
 * la pagina può estendersi verticalmente e tutto
 * il risultato diventa visibile.
 */
html.rf2-fv-risultato-visibile,
html.rf2-fv-risultato-visibile body,
body.rf2-fv-risultato-visibile {
    height: auto !important;
    min-height: 100% !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* Contenitore principale libero di crescere */
html.rf2-fv-risultato-visibile
main.pagina-fv-hero,
html.rf2-fv-risultato-visibile
.pagina-fv-hero,
body.rf2-fv-risultato-visibile
main.pagina-fv-hero,
body.rf2-fv-risultato-visibile
.pagina-fv-hero {
    height: auto !important;
    min-height: calc(100vh - 105px) !important;
    max-height: none !important;

    overflow-x: hidden !important;
    overflow-y: visible !important;

    padding-bottom: 55px !important;
}

/* La griglia può assumere l'altezza del risultato */
html.rf2-fv-risultato-visibile
.fv-layout-3col,
body.rf2-fv-risultato-visibile
.fv-layout-3col {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    overflow: visible !important;
}

/* Il preventivatore centrale non taglia il risultato */
html.rf2-fv-risultato-visibile
.box-preventivatore-incentivi,
body.rf2-fv-risultato-visibile
.box-preventivatore-incentivi {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    overflow: visible !important;

    padding-bottom: 24px !important;
}

/* Risultato economico completamente visibile */
html.rf2-fv-risultato-visibile
#risultatoIncentivi,
body.rf2-fv-risultato-visibile
#risultatoIncentivi {
    display: block !important;

    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    margin-top: 14px !important;
    margin-bottom: 0 !important;

    overflow: visible !important;
}

/* Nessun taglio nei riquadri interni del risultato */
html.rf2-fv-risultato-visibile
#risultatoIncentivi *,
body.rf2-fv-risultato-visibile
#risultatoIncentivi * {
    max-height: none !important;
}

/*
 * Il footer segue il contenuto:
 * non deve sovrapporsi al risultato.
 */
html.rf2-fv-risultato-visibile footer,
html.rf2-fv-risultato-visibile .site-footer,
html.rf2-fv-risultato-visibile .footer,
body.rf2-fv-risultato-visibile footer,
body.rf2-fv-risultato-visibile .site-footer,
body.rf2-fv-risultato-visibile .footer {
    position: static !important;

    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;

    width: 100% !important;

    margin-top: 0 !important;
}

/*
 * Lo scroll interno dei popup resta invariato.
 */
.rf2-fv-popup .rf2-fv-popup-box {
    overflow-y: auto !important;
}

/* RF2 FV RISULTATO COMPLETO VISIBILE - END */

/* RF2 FV RISULTATO SOLO MATERIALI - START */

#risultatoIncentivi
.rf2-fv-esito-materiali {
    width: 100% !important;
    max-width: 100% !important;

    margin: 14px 0 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;
    box-shadow: none !important;

    overflow: visible !important;
    box-sizing: border-box !important;
}

/* Richiamo che sostituisce il totale economico */
.rf2-fv-richiesta-offerta {
    margin: 0 0 14px !important;
    padding: 16px 18px !important;

    border: 1px solid #98c99e;
    border-left: 8px solid #398743;
    border-radius: 14px;

    background: #edf8ee;

    color: #173d1d;
    box-sizing: border-box;
}

.rf2-fv-richiesta-offerta h3 {
    margin: 0 0 8px !important;

    color: #195c24;
    font-size: 20px !important;
    line-height: 1.15 !important;
}

.rf2-fv-richiesta-offerta p {
    margin: 0 !important;

    font-size: 14px !important;
    line-height: 1.38 !important;
}

.rf2-fv-richiesta-offerta
.rf2-fv-richiesta-nota {
    margin-top: 8px !important;
    color: #405644;
    font-size: 12.5px !important;
}

/* Materiali selezionati */
.rf2-fv-materiali-selezionati {
    padding: 15px 17px !important;

    border: 1px solid #dddddd;
    border-radius: 14px;

    background: #ffffff;

    box-sizing: border-box;
}

.rf2-fv-materiali-selezionati > h3 {
    margin: 0 0 12px !important;

    color: #263238;
    font-size: 18px !important;
    line-height: 1.15 !important;
}

.rf2-fv-materiali-elenco {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;
}

.rf2-fv-materiale {
    min-width: 0;

    padding: 11px 12px;

    border: 1px solid #d9e5da;
    border-radius: 10px;

    background: #f7faf7;

    box-sizing: border-box;
}

.rf2-fv-materiale h4 {
    margin: 0 0 6px !important;

    color: #245f2c;
    font-size: 14px !important;
    line-height: 1.2 !important;
}

.rf2-fv-materiale-dato {
    margin: 2px 0;

    color: #303a31;
    font-size: 12px;
    line-height: 1.28;

    overflow-wrap: anywhere;
}

/* Nessun importo deve essere mostrato */
.rf2-fv-esito-materiali
.risultato-fv-totale-importo,
.rf2-fv-esito-materiali
.risultato-fv-totale-valore,
.rf2-fv-esito-materiali
.rf2-fv-modello-prezzo {
    display: none !important;
}

@media (max-width: 700px) {
    .rf2-fv-materiali-elenco {
        grid-template-columns: 1fr;
    }

    .rf2-fv-richiesta-offerta {
        padding: 14px 15px !important;
    }
}

/* RF2 FV RISULTATO SOLO MATERIALI - END */

/* RF2 FV EMAIL OFFERTA - START */

.rf2-fv-richiesta-offerta
.rf2-fv-email-offerta {
    margin: 0 0 10px !important;

    font-size: 15px !important;
    line-height: 1.3 !important;

    text-align: center;
}

.rf2-fv-richiesta-offerta
.rf2-fv-email-offerta a {
    color: #145b20;
    font-weight: 800;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

/* RF2 FV EMAIL OFFERTA - END */

/* RF2 FV NASCONDI BOTTONE DOPO CALCOLO - START */

/*
 * Il pulsante scompare quando il risultato
 * con i materiali selezionati è stato generato.
 */
.rf2-fv-bottone-calcolo-nascosto {
    display: none !important;
    visibility: hidden !important;

    width: 0 !important;
    height: 0 !important;

    min-width: 0 !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
}

/* Riduce lo spazio tra i dati e il risultato */
.rf2-fv-bottone-calcolo-nascosto
+ .testo-supporto-incentivi,
.rf2-fv-bottone-calcolo-nascosto
+ .nota-preventivatore-fv,
.rf2-fv-bottone-calcolo-nascosto
+ .testo-simulazione-fv {
    margin-top: 0 !important;
}

/* RF2 FV NASCONDI BOTTONE DOPO CALCOLO - END */

/* RF2 FV QUANTITA BATTERIE - START */

.rf2-fv-campo-numero-batterie[hidden] {
    display: none !important;
}

.rf2-fv-campo-numero-batterie {
    width: 100%;
}

.rf2-fv-nota-capacita-batterie {
    margin-top: 6px;

    color: #315b37;
    font-size: 12px;
    line-height: 1.25;
}

.rf2-fv-dettaglio-quantita-batterie {
    margin-top: 5px;
}

/* RF2 FV QUANTITA BATTERIE - END */
