.jolo-product-video {
    position: relative;
    width: 100%;
    margin: 18px 0;
    overflow: hidden;
    border-radius: 4px;
    background: #111;
    aspect-ratio: 16 / 9;
}

.jolo-product-video--gallery {
    margin: 0;
}

.jolo-product-video__poster,
.jolo-product-video__frame,
.jolo-product-video__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.jolo-product-video__poster {
    cursor: pointer;
    border: 0;
    background-position: center;
    background-size: cover;
}

.jolo-product-video__poster::after {
    position: absolute;
    inset: 0;
    content: '';
    background: rgba(0, 0, 0, 0.18);
}

.jolo-product-video__poster span {
    position: relative;
    z-index: 1;
    display: inline-grid;
    place-items: center;
    width: 68px;
    height: 48px;
    padding-left: 4px;
    border-radius: 12px;
    background: #f03;
    color: #fff;
    font-size: 23px;
}

.jolo-product-video.is-loaded .jolo-product-video__poster {
    display: none;
}

.jolo-video-slide {
    position: fixed;
    z-index: 100000;
    right: 18px;
    bottom: 18px;
    width: min(520px, calc(100vw - 36px));
    padding: 10px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(calc(100% + 30px));
    transition: opacity 220ms ease, transform 300ms ease;
}

.jolo-video-slide.is-open {
    opacity: 1;
    transform: translateX(0);
}

.jolo-video-slide.is-closed {
    display: none;
}

.jolo-video-slide .jolo-product-video {
    margin: 0;
}

.jolo-video-slide__close {
    position: absolute;
    z-index: 2;
    top: -14px;
    right: -10px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #1d2327;
    color: #fff;
    font-size: 24px;
    line-height: 1;
}

.jolo-video-slide__sound {
    position: absolute;
    z-index: 3;
    right: 14px;
    bottom: 14px;
    padding: 9px 13px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 4px;
    background: rgba(29, 35, 39, 0.9);
    color: #fff;
    font-weight: 600;
}

.jolo-video-slide__sound.is-confirmed {
    background: #008a20;
}

@media (max-width: 600px) {
    .jolo-video-slide {
        top: 50%;
        right: auto;
        bottom: auto;
        left: 50%;
        width: min(90vw, calc(90vh * 9 / 16));
        height: min(90vh, calc(90vw * 16 / 9));
        padding: 8px;
        transform: translate(-50%, -46%);
    }

    .jolo-video-slide.is-open {
        transform: translate(-50%, -50%);
    }

    .jolo-video-slide .jolo-product-video {
        height: 100%;
        aspect-ratio: 9 / 16;
    }

    .jolo-video-slide__close {
        top: -12px;
        right: -12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jolo-video-slide {
        transition: none;
    }
}
