/* =========================================================
   MACRIGI 2027 — FOOTER V3.2
   LIGHT • FULL WIDTH • ACCORDION • RESPONSIVE
   ========================================================= */

.macrigi-footer-v32{
    --mac-blue:#5FAECE;
    --mac-dark:#173247;
    --mac-dark-2:#0F2535;
    --mac-bg:#F3F7F9;
    --mac-white:#FFFFFF;
    --mac-text:#536875;
    --mac-muted:#748894;
    --mac-line:#DCE6EB;

    width:100%;
    background:var(--mac-bg);
    color:var(--mac-dark);
    font-family:inherit;
    overflow:hidden;
}

.macrigi-footer-v32 *,
.macrigi-footer-v32 *::before,
.macrigi-footer-v32 *::after{
    box-sizing:border-box;
}

.macrigi-v32-wrap{
    width:100%;
    max-width:none;
    margin:0;
    padding-left:clamp(24px,4vw,72px);
    padding-right:clamp(24px,4vw,72px);
}


/* =========================================================
   TOP AREA
   ========================================================= */

.macrigi-v32-top{
    display:grid;
    grid-template-columns:.88fr 1.12fr;
    gap:70px;
    align-items:center;
    padding:25px 0 22px;
}


/* =========================================================
   COMPANY
   ========================================================= */

.macrigi-v32-company{
    display:flex;
    align-items:center;
    gap:27px;
}

.macrigi-v32-logo{
    display:block;
    width:148px;
    max-width:100%;
    height:auto;
    flex:0 0 auto;
}

.macrigi-v32-company-data{
    padding-left:26px;
    border-left:1px solid var(--mac-line);
}

.macrigi-v32-company-data strong{
    display:block;
    margin-bottom:5px;

    color:var(--mac-dark);
    font-size:13px;
    line-height:1.3;
    font-weight:700;
}

.macrigi-v32-company-data p{
    margin:0;

    color:var(--mac-text);
    font-size:11px;
    line-height:1.55;
}

.macrigi-v32-company-data .macrigi-v32-registration{
    display:block;
    margin-top:3px;
    color:var(--mac-muted);
    font-size:10px;
}


/* =========================================================
   NEWSLETTER
   ========================================================= */

.macrigi-v32-newsletter{
    background:var(--mac-white);
    border:1px solid var(--mac-line);
    border-radius:13px;

    padding:15px 17px;

    box-shadow:0 7px 22px rgba(23,50,71,.05);
}

.macrigi-v32-news-inner{
    display:grid;
    grid-template-columns:40px 1fr;
    gap:13px;
    align-items:center;
}

.macrigi-v32-mail-icon{
    width:40px;
    height:40px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:10px;

    background:rgba(95,174,206,.13);
    color:var(--mac-blue);
}

.macrigi-v32-mail-icon svg{
    width:19px;
    height:19px;
}

.macrigi-v32-news-content{
    min-width:0;
}

.macrigi-v32-news-heading{
    margin-bottom:7px;
}

.macrigi-v32-news-heading h3{
    margin:0;

    color:var(--mac-dark);
    font-size:15px;
    line-height:1.25;
    font-weight:700;
}

.macrigi-v32-news-heading p{
    margin:2px 0 0;

    color:var(--mac-muted);
    font-size:10.5px;
    line-height:1.35;
}


/* =========================================================
   NEWSLETTER FORM
   ========================================================= */

.macrigi-v32-form{
    margin:0;
}

.macrigi-v32-form-row{
    display:grid;
    grid-template-columns:1fr auto;
    gap:7px;
}

.macrigi-v32-form-row input[type="email"]{
    width:100%;
    height:39px !important;

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

    border:1px solid #D6E1E6 !important;
    border-radius:8px !important;

    outline:none !important;
    box-shadow:none !important;

    background:#fff !important;
    color:var(--mac-dark) !important;

    font-family:inherit;
    font-size:12.5px;
}

.macrigi-v32-form-row input[type="email"]:focus{
    border-color:var(--mac-blue) !important;
}

.macrigi-v32-form-row button{
    height:39px;
    padding:0 19px;

    border:0;
    border-radius:8px;

    background:var(--mac-blue);
    color:#fff;

    font-family:inherit;
    font-size:11px;
    font-weight:700;

    cursor:pointer;
    transition:.2s ease;
}

.macrigi-v32-form-row button:hover{
    filter:brightness(1.05);
    transform:translateY(-1px);
}

.macrigi-v32-consent{
    display:flex;
    align-items:flex-start;
    gap:7px;

    margin-top:7px;

    color:#778995;
    font-size:9.5px;
    line-height:1.4;
}

.macrigi-v32-consent input{
    margin:2px 0 0;
    flex:0 0 auto;
    accent-color:var(--mac-blue);
}

.macrigi-v32-consent a{
    color:var(--mac-dark);
    font-weight:600;
    text-decoration:underline;
    text-underline-offset:2px;
}


/* =========================================================
   ACCORDION NAVIGATION
   ========================================================= */

.macrigi-v32-navigation{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;

    padding:19px 0 21px;

    border-top:1px solid var(--mac-line);
}

.macrigi-v32-section{
    margin:0;

    background:#fff;
    border:1px solid var(--mac-line);
    border-radius:10px;

    overflow:hidden;

    transition:border-color .2s ease,
               box-shadow .2s ease;
}

.macrigi-v32-section:hover{
    border-color:#C5DCE6;
    box-shadow:0 4px 14px rgba(23,50,71,.035);
}


/* SUMMARY */

.macrigi-v32-section summary{
    min-height:46px;

    padding:0 14px;

    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;

    list-style:none;

    color:var(--mac-dark);
    font-size:12px;
    line-height:1.35;
    font-weight:700;

    cursor:pointer;
    user-select:none;
}

.macrigi-v32-section summary::-webkit-details-marker{
    display:none;
}


/* ARROW */

.macrigi-v32-arrow{
    width:8px;
    height:8px;

    flex:0 0 auto;

    border-right:1.5px solid var(--mac-blue);
    border-bottom:1.5px solid var(--mac-blue);

    transform:rotate(45deg);
    transition:transform .2s ease;
}

.macrigi-v32-section[open] .macrigi-v32-arrow{
    transform:rotate(225deg);
}


/* LINKS */

.macrigi-v32-links{
    padding:0 14px 13px;
}

.macrigi-v32-links a{
    display:block;

    width:fit-content;
    max-width:100%;

    margin-bottom:7px;

    color:var(--mac-text);
    font-size:11.2px;
    line-height:1.45;

    text-decoration:none;

    transition:.18s ease;
}

.macrigi-v32-links a:last-child{
    margin-bottom:0;
}

.macrigi-v32-links a:hover{
    color:var(--mac-blue);
    transform:translateX(2px);
}


/* =========================================================
   BOTTOM BAR
   ========================================================= */

.macrigi-v32-bottom{
    width:100%;
    background:var(--mac-dark-2);
}

.macrigi-v32-bottom-inner{
    width:100%;
    max-width:none;
    min-height:46px;

    margin:0;
    padding-left:clamp(24px,4vw,72px);
    padding-right:clamp(24px,4vw,72px);

    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:25px;

    padding-top:9px;
    padding-bottom:9px;
}

.macrigi-v32-copyright{
    color:#B8C6CF;
    font-size:10.8px;
    line-height:1.4;
}

.macrigi-v32-legal{
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end;
    gap:7px 18px;
}

.macrigi-v32-legal a{
    color:#B8C6CF;
    font-size:10.8px;
    line-height:1.4;
    text-decoration:none;
}

.macrigi-v32-legal a:hover{
    color:var(--mac-blue);
}


/* =========================================================
   TABLET
   ========================================================= */

@media(max-width:900px){

    .macrigi-v32-wrap,
    .macrigi-v32-bottom-inner{
        width:100%;
        padding-left:23px;
        padding-right:23px;
    }

    .macrigi-v32-top{
        grid-template-columns:1fr;
        gap:17px;
        padding:23px 0 19px;
    }

    .macrigi-v32-navigation{
        grid-template-columns:1fr 1fr;
    }

}


/* =========================================================
   IPHONE / MOBILE
   ========================================================= */

@media(max-width:600px){

    .macrigi-v32-wrap,
    .macrigi-v32-bottom-inner{
        width:100%;
        padding-left:17px;
        padding-right:17px;
    }


    /* TOP */

    .macrigi-v32-top{
        padding:18px 0 16px;
        gap:14px;
    }


    /* COMPANY */

    .macrigi-v32-company{
        gap:16px;
    }

    .macrigi-v32-logo{
        width:118px;
    }

    .macrigi-v32-company-data{
        padding-left:16px;
    }

    .macrigi-v32-company-data strong{
        font-size:11.5px;
    }

    .macrigi-v32-company-data p{
        font-size:9.3px;
        line-height:1.45;
    }

    .macrigi-v32-company-data .macrigi-v32-registration{
        font-size:8.8px;
    }


    /* NEWSLETTER */

    .macrigi-v32-newsletter{
        padding:13px;
        border-radius:11px;
    }

    .macrigi-v32-news-inner{
        grid-template-columns:1fr;
        gap:6px;
    }

    .macrigi-v32-mail-icon{
        width:34px;
        height:34px;
    }

    .macrigi-v32-news-heading h3{
        font-size:14px;
    }

    .macrigi-v32-news-heading p{
        font-size:10px;
    }

    .macrigi-v32-form-row{
        grid-template-columns:1fr;
        gap:6px;
    }

    .macrigi-v32-form-row input[type="email"],
    .macrigi-v32-form-row button{
        width:100%;
        height:38px !important;
    }

    .macrigi-v32-consent{
        font-size:8.8px;
    }


    /* ACCORDION */

    .macrigi-v32-navigation{
        grid-template-columns:1fr;
        gap:7px;

        padding:13px 0 15px;
    }

    .macrigi-v32-section summary{
        min-height:43px;
        font-size:12px;
    }

    .macrigi-v32-links{
        padding-bottom:12px;
    }

    .macrigi-v32-links a{
        font-size:10.8px;
    }


    /* BOTTOM */

    .macrigi-v32-bottom-inner{
        min-height:0;

        flex-direction:column;
        align-items:flex-start;

        gap:6px;

        padding:11px 0 13px;
    }

    .macrigi-v32-legal{
        justify-content:flex-start;
    }

}


/* =========================================================
   SMALL IPHONE
   ========================================================= */

@media(max-width:390px){

    .macrigi-v32-company{
        display:block;
    }

    .macrigi-v32-logo{
        width:120px;
        margin-bottom:9px;
    }

    .macrigi-v32-company-data{
        padding-left:0;
        border-left:0;
    }

}

/* =========================================================
   MOBILE — PROTEZIONE BOTTOM BAR DA PULSANTI FLOTTANTI
   ========================================================= */
@media (max-width:600px){

    .macrigi-v32-bottom-inner{
        align-items:center;
        text-align:center;
        padding:12px 55px 14px;
        width:100%;
    }

    .macrigi-v32-legal{
        justify-content:center;
        width:100%;
    }

    .macrigi-v32-copyright{
        width:100%;
        text-align:center;
    }
}

/* Core Theme owns the global footer. Prevent duplicate Elementor Theme Builder footer. */
.elementor-location-footer{display:none!important;}

/* v0.5.1 — il footer Core deve restare visibile anche in presenza di CSS legacy */
footer.macrigi-footer-v32{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    position:relative;
    z-index:1;
    clear:both;
}


/* v0.5.4 — footer full width desktop, padding fluido e coerente con il Core */


/* v0.5.5 — Footer V3.3 approvato, realmente full width su desktop */
@media (min-width:901px){
    .macrigi-footer-v32 .macrigi-v32-wrap{
        width:100%!important;
        max-width:none!important;
        margin:0!important;
        padding-left:32px!important;
        padding-right:32px!important;
    }
    .macrigi-footer-v32 .macrigi-v32-bottom-inner{
        width:100%!important;
        max-width:none!important;
        margin:0!important;
        padding:9px 32px!important;
    }
    .macrigi-footer-v32 .macrigi-v32-top{
        grid-template-columns:minmax(430px,.9fr) minmax(620px,1.1fr);
        gap:clamp(38px,4vw,76px);
    }
    .macrigi-footer-v32 .macrigi-v32-navigation{
        width:100%;
    }
}

/* Il logo del footer deve essere l'originale orizzontale, senza riquadri aggiunti. */
.macrigi-v32-logo{
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    object-fit:contain;
}

/* v0.5.6 — rifinitura desktop finale: footer più equilibrato e pienamente fluido */
@media (min-width:1181px){
    .macrigi-footer-v32 .macrigi-v32-wrap{
        padding-left:clamp(28px,3.2vw,64px)!important;
        padding-right:clamp(28px,3.2vw,64px)!important;
    }
    .macrigi-footer-v32 .macrigi-v32-top{
        grid-template-columns:minmax(390px,.82fr) minmax(680px,1.18fr);
        gap:clamp(48px,4.4vw,88px);
        align-items:center;
    }
    .macrigi-footer-v32 .macrigi-v32-company{
        justify-content:flex-start;
        min-width:0;
    }
    .macrigi-footer-v32 .macrigi-v32-newsletter{
        width:100%;
        max-width:none;
    }
}


/* =========================================================
   v0.6.7 — Footer accordion visibility on tablet/mobile
   When a section opens, footer.js scrolls its summary into view.
   scroll-margin keeps a comfortable gap from the viewport edge.
   ========================================================= */
@media (max-width:900px){
    .macrigi-footer-v32 .macrigi-v32-section{
        scroll-margin-top:18px;
    }
    .macrigi-footer-v32 .macrigi-v32-section[open]{
        border-color:#BFD9E4;
        box-shadow:0 8px 24px rgba(23,50,71,.07);
    }
}


/* =========================================================
   v0.6.12 — Footer UX finale
   Desktop: quattro colonne sempre aperte, senza dropdown.
   Tablet/mobile: accordion singolo; footer.js scorre solo
   quanto serve per mantenere visibile il pannello aperto.
   ========================================================= */
@media (min-width:901px){
    .macrigi-footer-v32{
        overflow:visible;
    }
    .macrigi-footer-v32 .macrigi-v32-section > summary{
        cursor:default;
        pointer-events:none;
    }
    .macrigi-footer-v32 .macrigi-v32-section > .macrigi-v32-links{
        display:block!important;
    }
    .macrigi-footer-v32 .macrigi-v32-section > summary .macrigi-v32-arrow{
        display:none!important;
    }
    .macrigi-footer-v32 .macrigi-v32-section[open]{
        box-shadow:none;
    }
    .macrigi-footer-v32 .macrigi-v32-links{
        padding-top:1px;
    }
}

@media (max-width:900px){
    .macrigi-footer-v32 .macrigi-v32-section{
        scroll-margin-top:18px;
    }
    .macrigi-footer-v32 .macrigi-v32-section[open]{
        border-color:#BFD9E4;
        box-shadow:0 8px 24px rgba(23,50,71,.07);
    }
}
