/* Contenitore slide video */
.nr-video-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Poster centrato */
.nr-video-poster {
    display: block;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    border-radius: inherit;
    object-fit: contain;
}

/* Trigger (poster + overlay) */
.nr-video-trigger {
    display: inline-block;
    position: relative;
}
.nr-video-trigger.is-hidden { display: none; }

/* CTA sopra al play */
.nr-video-cta {
    position: absolute;
    left: 50%;
    top: calc(50% - 88px); /* ~ un po' sopra il badge play */
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    letter-spacing: .2px;
    white-space: nowrap;
    pointer-events: none; /* il click passa al link/trigger */
}

/* Play badge centrato */
.nr-play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 84px;
    height: 84px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
}
.nr-play-badge:after {
    content: "";
    position: absolute;
    left: 34px;
    top: 27px;
    border-style: solid;
    border-width: 15px 0 15px 24px;
    border-color: transparent transparent transparent #fff;
}
@media (hover:hover){
    .nr-video-trigger:hover .nr-play-badge { background: rgba(0,0,0,.6); }
    .nr-video-trigger:hover .nr-video-cta { background: rgba(0,0,0,.7); }
}

/* Evidenzia la thumbnail del video con un badge "play" */
.nr-video-thumb {
    position: relative;
}
.nr-video-thumb::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: rgba(0,0,0,.55);
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    pointer-events: none;
}
.nr-video-thumb::before {
    content: "";
    position: absolute;
    left: calc(50% + 1px);
    top: 50%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 7px 0 7px 11px;
    border-color: transparent transparent transparent #fff;
    pointer-events: none;
    z-index: 2;
}
/* Hover */
.avada-product-gallery-thumbs-wrapper .nr-video-thumb:hover::after {
    background: rgba(0,0,0,.75);
}


/* ---------------- Lightbox ---------------- */

/* Disabilita scroll sotto la modale */
.nr-vl--open { overflow: hidden; }

/* Variabili di origine dell'animazione (impostate via JS) */
.nr-vl { --nr-ox: 50%; --nr-oy: 50%; }

/* Overlay + contenitore flex per centratura verticale/orizzontale */
.nr-vl {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;          /* centratura verticale */
    justify-content: center;      /* centratura orizzontale */
    padding: 2vh 1vw;
    pointer-events: none;           /* default: no click-through */
}
.nr-vl.is-open {
    display: flex;                /* NON usare .show() in JS */
    pointer-events: auto;           /* solo da aperta prende i click */
}

.nr-vl__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(2px);
    opacity: 1;
    pointer-events: none;
}

.nr-vl.anim-out {
    pointer-events: none;           /* durante l’uscita non blocca la pagina */
}
.nr-vl.is-open .nr-vl__backdrop {
    pointer-events: auto;
}


/* Dialog centrato dal flex container */
.nr-vl__dialog {
    position: relative;
    width: min(92vw, 1100px);
    background: transparent;
    outline: none;
    z-index: 100001;
    transform-origin: var(--nr-ox) var(--nr-oy);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Area media 16:9 */
.nr-vl__media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    z-index: 100001;
}

/* Video */
.nr-vl__video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

/* Pulsante chiudi */
.nr-vl__close {
    position: absolute;
    right: -8px;
    top: -8px;
    width: 44px;
    height: 44px;
    padding: 0;                    /* no padding nativo iOS */
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 0;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,.95);
    color: #111;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    z-index: 100002;
    line-height: 1;
}
.nr-vl__close:hover { background: #fff; }
.nr-vl__close svg { display:block; pointer-events:none; }

/* Bottone Mute/Unmute (posizione attuale) */
.nr-vl__mute{
    position: absolute;
    left: 0px;
    top: -52px;
    width: 48px;
    height: 48px;
    padding: 0;
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 0;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0,0,0,.65);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,.35);
    z-index: 100002;
    line-height: 1;
    font-size: 0; /* nasconde eventuali spazi testuali */
}
.nr-vl__mute:hover { background: rgba(0,0,0,.8); }

.nr-vl__mute svg{
    width: 26px;
    height: 26px;
    display: block;
    pointer-events:none;
}

/* Mostra/nascondi le icone correttamente */
.nr-vl__mute .icon-sound-off{ display:none; }
.nr-vl__mute.is-muted .icon-sound-on{ display:none; }
.nr-vl__mute.is-muted .icon-sound-off{ display:block; }

/* Messaggio "ESC" sotto al video */
.nr-vl__hint {
    margin-top: 10px;
    text-align: center;
    color: rgba(255,255,255,.85);
    font-size: 12px;
    line-height: 1.2;
    user-select: none;
}

/* === Animazioni === */
@keyframes nr-dialog-in {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
@keyframes nr-dialog-out {
    from { transform: scale(1);   opacity: 1; }
    to   { transform: scale(0.5); opacity: 0; }
}

@keyframes nr-backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes nr-backdrop-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.nr-vl.anim-in .nr-vl__dialog { animation: nr-dialog-in 1.08s cubic-bezier(.2,.65,.25,1) both; }
.nr-vl.anim-out .nr-vl__dialog { animation: nr-dialog-out .32s cubic-bezier(.2,.65,.25,1) both; }

.nr-vl.anim-in .nr-vl__backdrop { animation: nr-backdrop-in 1.08s ease-out both; }
.nr-vl.anim-out .nr-vl__backdrop { animation: nr-backdrop-out .32s ease-in both; }

/* Fallback Tawk: se attivo "tawk-sanitize", nascondi overlay full-screen non-open */
body.tawk-sanitize div.widget-visible > iframe[title="chat widget"]:not(.open)[style*="width: 100%"][style*="height: 100%"]{
    display: none !important;
    pointer-events: none !important;
}

/* Quando la lightbox è aperta, Tawk non intercetta click */
.nr-vl--open iframe[title="chat widget"],
.nr-vl--open #tawk_iframe_container,
.nr-vl--open .tawk-min-container {
    pointer-events: none !important;
}

/* Mobile tweak */
@media (max-width: 640px){
    .nr-vl { padding: 6vh 2vw; }
    .nr-vl__dialog { width: 96vw; }
    .nr-vl__close {
        right: 0;
        top: -50px;
    }

    .nr-vl__hint{display:none;}
}
