.pv-video-thumb {
    display: block;
    position: relative;
    cursor: pointer;
    max-width: 100%;
    z-index: 1; /* Lifts widget above Elementor's editor overlay */
}

.pv-video-thumb .pvt-inner {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    transform: scale(1);
    transform-origin: center;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-mask-image: -webkit-radial-gradient(white, black); /* Prevents jagged edges on scale */
}

.pv-video-thumb .pvt-media-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    background-color: #000;
}

/* --- FIX: Consolidated and corrected all layer styles --- */

.pv-video-thumb .pvt-preview-wrap,
.pv-video-thumb .pvt-cover,
.pv-video-thumb .pvt-playbtn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.pv-video-thumb .pvt-preview,
.pv-video-thumb .pvt-preview-iframe-placeholder,
.pv-video-thumb iframe.pvt-iframe-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}

.pv-video-thumb .pvt-preview-wrap {
    z-index: 1; /* Bottom layer: Video */
}

.pv-video-thumb .pvt-cover {
    background-size: cover;
    background-position: center;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
    z-index: 2; /* Middle layer: Cover Image */
}

.pvt-playbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Allows clicks to pass through to the parent */
    z-index: 3; /* Top layer: Play Icon */
}

.pvt-playbtn svg {
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    color: #fff;
    padding: 12px;
    box-sizing: content-box;
    transition: transform 0.2s ease;
}

/* --- FIX: Correctly targets the .hovered class for the effect --- */

/* --- UPDATED SELECTOR --- */
/* This class now controls the cover fade */
.pv-video-thumb.video-active .pvt-cover {
    opacity: 0;
}
/* --- END UPDATED SELECTOR --- */

/* This class still controls the hover zoom/scale effects */
.pv-video-thumb.hovered .pvt-playbtn svg {
    transform: scale(1.1);
}

/* Lightbox Styles */
.pvt-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 24px;
}
.pvt-lightbox .pvt-lb-inner {
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    background: #000;
}
.pvt-lightbox .pvt-lb-inner iframe {
    width: 100%;
    height: 100%;
    border: 0;
}
.pvt-lightbox .pvt-close {
    position: absolute;
    right: 20px;
    top: 20px;
    background: none;
    border: 0;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
.pvt-lightbox .pvt-close:hover {
    opacity: 1;
}