/* Produktové video vložené do fotogalerie */
.p-thumbnail.agmg-video-thumb {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    aspect-ratio: 1 / 1;
    background: #f3f1ed;
    cursor: pointer;
    isolation: isolate;
}

.p-thumbnail.agmg-video-thumb .agmg-video-preview {
    position: absolute;
    inset: 0;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    max-width: none;
    object-fit: cover;
    pointer-events: none;
}

.p-thumbnail.agmg-video-thumb::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
    transform: translate(-50%, -50%);
    transition: transform 160ms ease, background-color 160ms ease;
}

.p-thumbnail.agmg-video-thumb::after {
    content: "";
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 51.5%;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid #202224;
    transform: translate(-40%, -50%);
}

.p-thumbnail.agmg-video-thumb:hover::before,
.p-thumbnail.agmg-video-thumb:focus-visible::before {
    background: #fff;
    transform: translate(-50%, -50%) scale(1.08);
}

.p-thumbnail.agmg-video-thumb:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.p-thumbnail.agmg-video-thumb.is-active,
.p-thumbnail.agmg-video-thumb.highlighted {
    border-color: #202224;
}

.p-image .agmg-gallery-video {
    display: none;
    width: 100%;
    aspect-ratio: 1 / 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f3f1ed;
}

.p-image.agmg-video-active .agmg-gallery-video {
    display: flex;
}

.p-image.agmg-video-active #wrap,
.p-image.agmg-video-active > a.p-main-image,
.p-image.agmg-video-active > img.p-main-image,
.p-image.agmg-video-active > video.p-main-image,
.p-image.agmg-video-active > .mousetrap {
    display: none !important;
}

.p-image .agmg-gallery-video video {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #f3f1ed;
}

@media (max-width: 767px) {
    .p-thumbnail.agmg-video-thumb::before {
        width: 36px;
        height: 36px;
    }

    .p-thumbnail.agmg-video-thumb::after {
        border-top-width: 6px;
        border-bottom-width: 6px;
        border-left-width: 9px;
    }

    .p-image .agmg-gallery-video {
        min-height: min(100vw, 640px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .p-thumbnail.agmg-video-thumb::before {
        transition: none;
    }
}
