/* Wrapper generale */
.wdv-carousel {
    position: relative;
    display: flex;
    max-width: 100%;
    box-sizing: border-box;
}

/* Layout base per thumbs bottom */
.wdv-carousel.wdv-thumbs-bottom {
    flex-direction: column;
    gap: 0.75rem;
}

/* Layout base per thumbs left/right */
.wdv-carousel.wdv-thumbs-left,
.wdv-carousel.wdv-thumbs-right {
    gap: 1rem;
    align-items: stretch;
}

/* MAIN SLIDER */
.wdv-main-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wdv-main-slider {
    width: 100%;
    height: 100%;
    flex: 1;
}

.wdv-main-img-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
/*     background: #000; */
}

/* Stile per il link lightbox */
.wdv-main-img-wrapper a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: zoom-in;
    transition: opacity 0.3s ease;
}

.wdv-main-img-wrapper a:hover {
    opacity: 0.95;
}

.wdv-main-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Indicatore visivo per lightbox */
.wdv-main-img-wrapper a::after {
    content: '🔍'; /* Questo è il carattere della lente */
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0; /* Inizialmente nascosto */
    transition: opacity 0.3s ease;
    z-index: 5;
}

.wdv-main-img-wrapper a:hover::after {
    opacity: 1; /* Appare all'hover */
}

/* THUMBS WRAPPER */
.wdv-thumbs-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Thumbs BOTTOM */
.wdv-carousel.wdv-thumbs-bottom .wdv-thumbs-wrapper {
    flex-direction: row;
    width: 100%;
}

/* Thumbs LEFT/RIGHT - DEFAULT (DESKTOP) */
.wdv-carousel.wdv-thumbs-left .wdv-thumbs-wrapper,
.wdv-carousel.wdv-thumbs-right .wdv-thumbs-wrapper {
    flex-direction: column;
    width: 110px;
    flex-shrink: 0;
}

/* Thumbs slider */
.wdv-thumbs-slider {
    flex: 1 1 auto;
    width: 100%;
}

.wdv-thumbs-slider .swiper-slide {
    width: 80px !important;
    height: auto !important;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.wdv-thumbs-slider .swiper-slide-thumb-active {
    opacity: 1;
}

/* Thumb images */
.wdv-thumb-img-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.wdv-thumbs-slider .swiper-slide-thumb-active .wdv-thumb-img-wrapper {
    border-color: #007cba;
}

.wdv-thumb-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Navigation buttons */
.wdv-nav-btn {
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    padding: 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    font-weight: bold;
}

.wdv-nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.wdv-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Main navigation */
.wdv-main-prev,
.wdv-main-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
}

.wdv-main-prev {
    left: 15px;
}

.wdv-main-next {
    right: 15px;
}

/* Thumbs navigation */
.wdv-thumbs-wrapper .wdv-nav-btn {
    position: absolute;
    z-index: 25;
    left: 50%;
    transform: translateX(-50%);
}

/* Thumbs bottom navigation */
.wdv-carousel.wdv-thumbs-bottom .wdv-thumbs-prev,
.wdv-carousel.wdv-thumbs-bottom .wdv-thumbs-next {
    margin: 0;
}

.wdv-carousel.wdv-thumbs-bottom .wdv-thumbs-prev {
    top: -40px;
    left: 10px;
    transform: translateX(0);
}

.wdv-carousel.wdv-thumbs-bottom .wdv-thumbs-next {
    top: -40px;
    right: 10px;
    left: auto;
    transform: translateX(0);
}

/* Thumbs left/right navigation */
.wdv-carousel.wdv-thumbs-left .wdv-thumbs-prev,
.wdv-carousel.wdv-thumbs-left .wdv-thumbs-next,
.wdv-carousel.wdv-thumbs-right .wdv-thumbs-prev,
.wdv-carousel.wdv-thumbs-right .wdv-thumbs-next {
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}

.wdv-carousel.wdv-thumbs-left .wdv-thumbs-prev,
.wdv-carousel.wdv-thumbs-right .wdv-thumbs-prev {
    top: -35px;
}

.wdv-carousel.wdv-thumbs-left .wdv-thumbs-next,
.wdv-carousel.wdv-thumbs-right .wdv-thumbs-next {
    bottom: -35px;
    top: auto;
}

/* Freccia su per prev, freccia giù per next */
.wdv-thumbs-prev::after {
    content: '↑';
}

.wdv-thumbs-next::after {
    content: '↓';
}

/* Per layout orizzontale (tablet), usa frecce sinistra/destra */
.wdv-carousel.wdv-tablet .wdv-thumbs-prev::after {
    content: '←';
}

.wdv-carousel.wdv-tablet .wdv-thumbs-next::after {
    content: '→';
}

/* ✅ DESKTOP (≥1025px) */
@media (min-width: 1025px) {
    .wdv-carousel.wdv-thumbs-left {
        flex-direction: row;
        height: 500px;
    }
    
    .wdv-carousel.wdv-thumbs-left .wdv-main-wrapper {
        order: 2;
        height: 100%;
    }
    
    .wdv-carousel.wdv-thumbs-left .wdv-thumbs-wrapper {
        order: 1;
        height: 100%;
    }
    
    .wdv-thumbs-slider .swiper-wrapper {
        flex-direction: column;
    }
    
    .wdv-carousel.wdv-thumbs-left .wdv-main-img-wrapper {
        height: 100%;
    }
    
    .wdv-carousel.wdv-thumbs-left .wdv-main-img-wrapper img {
        object-fit: contain;
        max-width: 100%;
        max-height: 100%;
    }
}

/* ✅ TABLET (768–1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .wdv-carousel.wdv-thumbs-left {
        flex-direction: column;
    }
    
    .wdv-carousel.wdv-thumbs-left .wdv-thumbs-wrapper {
        width: 100%;
        flex-direction: row;
    }
    
    .wdv-main-img-wrapper {
        aspect-ratio: 4 / 3;
    }
    
    /* Forza direzione orizzontale per le thumbs su tablet */
    .wdv-carousel.wdv-thumbs-left .wdv-thumbs-slider .swiper-wrapper {
        flex-direction: row !important;
    }
    
    /* Riposiziona frecce thumbs per layout orizzontale */
    .wdv-carousel.wdv-thumbs-left .wdv-thumbs-prev,
    .wdv-carousel.wdv-thumbs-left .wdv-thumbs-next {
        top: 50%;
        transform: translateY(-50%);
    }
    
    .wdv-carousel.wdv-thumbs-left .wdv-thumbs-prev {
        left: -35px;
        right: auto;
    }
    
    .wdv-carousel.wdv-thumbs-left .wdv-thumbs-next {
        right: -35px;
        left: auto;
    }
}

/* ✅ MOBILE (≤767px) */
@media (max-width: 767px) {
    .wdv-carousel.wdv-thumbs-left {
        flex-direction: column;
    }
    
    .wdv-main-img-wrapper {
        aspect-ratio: 4 / 3;
    }
    
    /* NASCONDI THUMBS SU MOBILE */
    .wdv-carousel.wdv-mobile .wdv-thumbs-wrapper {
        display: none !important;
    }
    
    /* Nascondi frecce thumbs su mobile */
    .wdv-carousel.wdv-mobile .wdv-thumbs-wrapper .wdv-nav-btn {
        display: none;
    }
    
    /* Su mobile, mostra sempre l'icona lightbox */
    .wdv-main-img-wrapper a::after {
        opacity: 1;
        background: rgba(0, 0, 0, 0.5);
    }
}

/* Classi JS per controllo responsive */
.wdv-carousel.wdv-mobile .wdv-thumbs-wrapper {
    display: none !important;
}

.wdv-carousel.wdv-tablet .wdv-th

/* --- INIZIO BLOCCO STILI LIGHTBOX PER WDV-CAROUSEL --- */

/* Assicura che la "X" di chiusura sia sempre visibile e ben formattata */
.lightbox .lb-close {
    opacity: 1 !important; /* Forza la visibilità */
    display: block !important; /* Assicura che sia visualizzato */
    width: 36px; /* Aumenta leggermente la dimensione */
    height: 36px;
    top: 10px; /* Spostalo leggermente in alto */
    right: 10px; /* Spostalo leggermente a destra */
    /* Lightbox2 usa uno sfondo per la 'X'. Se non si vede, si può forzare.
       Il CSS originale di Lightbox2 usa un'immagine in un percorso specifico:
       url(../images/close.png) no-repeat;
       Se il tuo plugin sposta le immagini, questo potrebbe non funzionare.
       Manteniamo il fallback con il carattere per sicurezza. */
    background: rgba(0, 0, 0, 0.6); /* Sfondo per la 'X' */
    border-radius: 50%;
    text-indent: -9999px; /* Nasconde il testo predefinito "Close" */
    z-index: 10002; /* Assicura che sia sopra tutto */
    transition: all 0.2s ease-in-out;
}

.lightbox .lb-close:after {
    content: '✖'; /* Il carattere X come fallback/miglioramento */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-indent: 0;
    color: white;
    font-size: 24px; /* Dimensione della X */
    line-height: 36px; /* Centra verticalmente */
    text-align: center;
}

.lightbox .lb-close:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.8);
}


/* Stili per i pulsanti di navigazione (frecce) */
.lightbox .lb-prev,
.lightbox .lb-next {
    /* Questi stili dovrebbero essere gestiti dal CSS di Lightbox2.
       Se non vedi le frecce, è probabile che il percorso delle immagini
       nel CSS di Lightbox2 sia sbagliato o che ci siano conflitti.
       Disattiviamo gli stili background se il cerchio è l'unico problema
       e usiamo i caratteri come fallback robusto. */
    background: none !important; /* Rimuove lo sfondo che crea il cerchio vuoto */
    width: 80px; /* Aumenta l'area cliccabile */
    height: 100%; /* Copre l'intera altezza */
    z-index: 10001; /* Sopra l'immagine ma sotto la X */
    opacity: 0.8;
    transition: opacity 0.2s ease-in-out;
}

.lightbox .lb-prev:hover,
.lightbox .lb-next:hover {
    opacity: 1;
}

/* Freccia sinistra */
.lightbox .lb-prev:after {
    content: '←'; /* Carattere freccia sinistra */
    position: absolute;
    top: 50%;
    left: 15px; /* Sposta il carattere all'interno */
    transform: translateY(-50%);
    color: white;
    font-size: 50px; /* Rendi la freccia grande */
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9); /* Ombra per visibilità */
    z-index: 1; /* Assicura che il carattere sia sopra il bottone invisibile */
}

/* Freccia destra */
.lightbox .lb-next:after {
    content: '→'; /* Carattere freccia destra */
    position: absolute;
    top: 50%;
    right: 15px; /* Sposta il carattere all'interno */
    transform: translateY(-50%);
    color: white;
    font-size: 50px; /* Rendi la freccia grande */
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9); /* Ombra per visibilità */
    z-index: 1;
}

/* La lente di ingrandimento */
.wdv-main-img-wrapper a::after {
    content: '🔍'; /* Questo è il carattere della lente */
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 36px; /* Leggermente più grande per coerenza */
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px; /* Leggermente più grande */
    opacity: 0; /* Inizialmente nascosto */
    transition: opacity 0.3s ease;
    z-index: 5;
    pointer-events: none; /* Importante! Non deve interferire con il click */
}

.wdv-main-img-wrapper a:hover::after {
    opacity: 1; /* Appare all'hover */
}

/* Su mobile, mostra sempre l'icona lightbox (dal tuo codice originale) */
@media (max-width: 767px) {
    .wdv-main-img-wrapper a::after {
        opacity: 1;
        background: rgba(0, 0, 0, 0.5);
    }
}

/* Se ci sono problemi con il testo di numero immagine (Image 3 of 5) */
.lightbox .lb-data .lb-number {
    color: white; /* Assicura che il testo sia bianco */
    font-size: 14px;
    text-shadow: 0 0 3px rgba(0,0,0,0.7);
}

/* Assicurati che l'overlay sia scuro e copra bene */
.lb-overlay {
    background-color: rgba(0, 0, 0, 0.85); /* Leggermente più scuro per coprire */
}

/* --- FINE BLOCCO STILI LIGHTBOX PER WDV-CAROUSEL --- */
