#custom-overlay-wrapper {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999999;
    display: none; /* Inizialmente nascosto */
    justify-content: center;
    align-items: center;
}

.overlay-carousel {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.overlay-slide {
    display: none;
    text-align: center;
    padding: 20px;
}

.overlay-slide.active { display: block; }

.overlay-slide img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto 15px;
}

.overlay-slide h2 { margin: 10px 0; font-family: sans-serif; color: #333; }

/* Navigazione spostata in basso */
.ov-prev, .ov-next {
    position: absolute;
    top: auto;            /* Rimuove il centratura verticale */
    bottom: 4px;          /* Li posiziona nella fascia dei dots */
    transform: none;      /* Rimuove la trasformazione precedente */
    background: transparent; /* Li rendiamo più puliti */
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 24px;
    color: #333;          /* Colore scuro per vederli sul bianco */
    transition: 0.3s;
    z-index: 20;
}

.ov-prev { left: 15px; }  /* Al margine sinistro in basso */
.ov-next { right: 15px; } /* Al margine destro in basso */

.ov-prev:hover, .ov-next:hover { 
    color: #000; 
    transform: scale(1.2); /* Un piccolo effetto ingrandimento al passaggio */
}

.ov-dots {
    text-align: center;
    padding: 10px;
    background: #f9f9f9;
}
.ov-dot {
    height: 10px; width: 10px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
}
.ov-dot.active { background-color: #333; }

.ov-close {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 30px;
    cursor: pointer;
    color: #333;
    z-index: 10;
}

/* --- BARRA DI PROGRESSO (90% e centrata) --- */
.ov-progress-container {
    height: 2px;
    background: rgba(0,0,0,0.05);
    position: absolute;
    bottom: 48px;       /* Sopra i comandi */
    left: 50%;          /* Inizia dal centro */
    width: 80%;         /* Larghezza barra */
    transform: translateX(-50%); /* Centramento perfetto */
    z-index: 25;
}

#ov-progress-bar {
    width: 0%;
    height: 100%;
}