/*
 * LDM Produit & Simulateur - VideographyWP / PhotoSwipe
 * La vidéo est ajoutée à la lightbox WooCommerce sans modifier le lecteur
 * inline géré par VideographyWP PRO.
 */

.ldm-pswp-video-shell {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 72px 56px;
}

.ldm-pswp-video-frame {
    position: relative;
    width: min(92vw, 1200px, calc((100vh - 120px) * 16 / 9));
    aspect-ratio: 16 / 9;
    max-width: 100%;
    max-height: calc(100vh - 120px);
    background: #000;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.ldm-pswp-video-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

/* Sur une slide vidéo, le zoom et le partage PhotoSwipe sont sans objet. */
.pswp.ldm-pswp-video-active .pswp__button--zoom,
.pswp.ldm-pswp-video-active .pswp__button--share {
    display: none !important;
}

/*
 * Les iframes capturent naturellement les gestes tactiles : PhotoSwipe ne peut
 * donc pas toujours interpréter un swipe démarré directement sur la vidéo.
 * Deux commandes latérales sont proposées sur interfaces tactiles pour garantir
 * la navigation vidéo <-> image sans masquer les contrôles du lecteur.
 */
.ldm-pswp-video-nav {
    display: none;
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ldm-pswp-video-nav--prev {
    left: 10px;
}

.ldm-pswp-video-nav--next {
    right: 10px;
}

@media (hover: none), (max-width: 768px) {
    .ldm-pswp-video-shell {
        padding: 58px 12px 48px;
    }

    .ldm-pswp-video-frame {
        width: min(96vw, calc((100vh - 106px) * 16 / 9));
        max-height: calc(100vh - 106px);
    }

    .ldm-pswp-video-nav {
        display: flex;
    }
}
