* { margin: 0; padding: 0 }

body {
    font-family: Arial, sans-serif;
    background-color: #fff;
    color: #333;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.no-scroll { overflow: hidden; }

main { flex: 1; padding: 20px; }

/* ------------------- IMMAGINI PRINCIPALI ------------------- */
#wrap-img-row { height: 45vh; position: relative; top: 80px; }

.img-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.img-container {
    width: 18%;
    border-radius: 20px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.6);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.img-container img { width: 100%; height: auto; border-radius: 20px; }
.img-container:hover { transform: scale(0.98); box-shadow: none; }

.caption {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background-color: rgba(0,0,0,0.5);
    color: #fff;
    padding: 10px 0;
    font-size: 1em;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

/* ------------------- LOGHI ------------------- */
.loghi {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 90px;
}

.loghi-col {
/*    width: 22%; !* desktop: 4 colonne per riga *!*/
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.loghi-col img { max-width: 120px; }

/* ------------------- PULSANTE INSTALLA APP ------------------- */
#wrapInstallaAppLink { padding-top:30px }

#installAppLink {
    display: none;
    background-color: #2bace3;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#installAppLink:hover { background-color: #229bcf; transform: scale(0.98); box-shadow: 0 0 0 0; }

/* ------------------- FOOTER ------------------- */
footer {
    height: 70px;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

footer a { color: #fff; text-decoration: none; font-size: 16px; transition: color 0.3s ease; }
footer a:hover { color: #ccc; }

/* ------------------- POPUP ------------------- */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.popup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.popup-box {
    width: 80%;
    max-width: 95vw;
    height: auto;
    background: #fff;
    border-radius: 12px;
    padding: 20px 30px 0 30px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, .35);
    position: relative;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.choose-app {
    margin: 6px 0 0 0;
    display: flex;
    justify-content: center;
}


.closePopUp {
    position: relative;
    margin-bottom: 55px;
}

.closePopUp span {
    position: relative;
    top: 10px;
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    text-shadow: 2px 1px 2px rgba(0,0,0,0.39);
    transition: text-shadow 0.3s ease;
}

.closePopUp span:hover {
    text-shadow: none;
    cursor: pointer;
}

.closePopUp img {
    width: 170px;
    position: absolute;
    top: 0;
    left: calc(50% - 82px);
    display: block;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    color: #666;
}

.close-btn:hover { color: #000; }

.tabs {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    justify-content: center;
}

.tab-flag {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.tab-flag:hover { transform: scale(1.1); }

.tab-flag.active { border-color: #007bff; }

.tab-content {
    display: none;
    margin-top: 10px;
    padding: 10px 0 2% 0;
}

.tab-content.active {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tab-content p { display: contents; }

.tab-content ol {
    text-align: left;
    margin-left: 0;
    padding-left: 0;
    list-style-position: inside;
}

.tab-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}


/* ------------------- RESPONSIVE ------------------- */

@media screen and (min-width: 1367px) and (max-width: 1536px) {
    #wrap-img-row { height: 40vh }
}
@media screen and (max-width: 1366px) {
    #wrap-img-row { height: 31vh }

    #wrap-img-row {
        top: 38px;
    }

    .loghi {
        gap: 12px;
    }
}

@media screen and (max-width: 1024px) {

    #wrapInstallaAppLink { padding-top:20px; padding-bottom: 20px  }

    /* Immagini principali: una sotto l'altra */
    #wrap-img-row {
        height: auto;       /* altezza automatica per scroll */
        top: 0;
        padding: 20px 0;
    }

    .img-row {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .img-container {
        width: 80%;  /* prende quasi tutta la larghezza */
    }

    /* Loghi: due colonne per riga, sotto le immagini */
    .loghi {
        margin-top: 40px;
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .loghi-col {
        width: 45%;      /* due loghi per riga */
        margin-bottom: 20px;
    }

    /* Footer sempre in fondo */
    main {
        flex: 1 0 auto;
        display: flex;
        flex-direction: column;
    }
}


@media screen and (max-width: 600px) {
    .loghi { margin-top: 60px; }
    .loghi-col { width: 45%; }
    #installAppLink { font-size: 0.9rem; padding: 8px 16px; }
}
