/* Mobile spezifische Anpassungen für weißen Hintergrund */
@media screen and (max-width: 768px) {
    .dcs-w2v-video-wrapper,
    .dcs-w2v-kadence-video-wrapper,
    .dcs-w2v-gallery-player {
        background: #fff !important;
    }
    
    /* Falls das Video kleiner als der Container ist */
    .dcs-w2v-video-wrapper video,
    .dcs-w2v-kadence-video-wrapper video {
        background: #fff;
    }
    
    /* WICHTIG: Native Mobile Controls komplett verstecken */
    video::-webkit-media-controls-start-playback-button {
        display: none !important;
        -webkit-appearance: none;
    }
    
    /* Großen Play-Button in der Mitte verstecken */
    video::-webkit-media-controls-overlay-play-button {
        display: none !important;
    }
    
    /* Alle Media Controls verstecken beim Start */
    video::-webkit-media-controls {
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Nach User-Interaktion Controls zeigen (falls gewünscht) */
    video.user-interacted::-webkit-media/**
 * DCS-Woo2Video Frontend Styles
 * 
 * Styling für die Video-Darstellung im Shop-Frontend
 */

/* Video Wrapper */
.dcs-w2v-video-wrapper {
    position: relative;
    width: 100%;
    background: #fff; /* Geändert von #000 auf #fff für weißen Hintergrund */
    overflow: visible !important; /* Geändert von hidden zu visible für den Button */
}

.dcs-w2v-video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}

/* Embed Container für YouTube/Vimeo */
.dcs-w2v-embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.dcs-w2v-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Play Button */
.dcs-w2v-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.dcs-w2v-play-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.dcs-w2v-play-button svg {
    width: 40px;
    height: 40px;
    fill: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
}

.dcs-w2v-play-button.playing {
    opacity: 0;
    pointer-events: none;
}

/* Sound/Restart Icon - NEUE STYLES */
.dcs-w2v-sound-restart-icon {
    position: absolute !important;
    bottom: 15px !important;
    right: 15px !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    outline: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

.dcs-w2v-sound-restart-icon:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: #fff;
    transform: scale(1.1);
}

.dcs-w2v-sound-restart-icon:active {
    transform: scale(0.95);
}

.dcs-w2v-sound-restart-icon svg {
    width: 20px !important;
    height: 20px !important;
    fill: #fff !important;
    pointer-events: none !important;
    display: block !important;
}

/* Sound Icon Animation beim Toggle */
.dcs-w2v-sound-restart-icon .dcs-w2v-icon-sound-off,
.dcs-w2v-sound-restart-icon .dcs-w2v-icon-sound-on {
    transition: opacity 0.2s ease;
}

/* Minimale Controls */
.dcs-w2v-custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    padding: 20px 10px 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dcs-w2v-video-wrapper:hover .dcs-w2v-custom-controls {
    opacity: 1;
}

.dcs-w2v-progress {
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.dcs-w2v-progress-bar {
    height: 100%;
    background: #fff;
    border-radius: 3px;
    width: 0;
    transition: width 0.1s linear;
}

/* Hauptbild mit Video */
.dcs-w2v-main-media {
    position: relative;
}

.dcs-w2v-main-video {
    width: 100%;
}

/* Galerie Items */
.dcs-w2v-gallery-item {
    position: relative;
    cursor: pointer;
}

.dcs-w2v-gallery-video {
    position: relative;
    display: block;
}

.dcs-w2v-video-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dcs-w2v-video-indicator svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* Video Placeholder */
.dcs-w2v-video-placeholder {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.dcs-w2v-video-placeholder svg {
    width: 60px;
    height: 60px;
    fill: #999;
}

/* Play Overlay für Galerie */
.dcs-w2v-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.dcs-w2v-gallery-item:hover .dcs-w2v-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.dcs-w2v-play-overlay svg {
    width: 30px;
    height: 30px;
    fill: #fff;
    margin-left: 3px;
}

/* Close Video Button */
.dcs-w2v-close-video {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 30;
    transition: all 0.3s ease;
}

.dcs-w2v-close-video:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Loading State */
.dcs-w2v-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
}

.dcs-w2v-loading:after {
    content: " ";
    display: block;
    width: 40px;
    height: 40px;
    margin: 5px;
    border-radius: 50%;
    border: 3px solid #fff;
    border-color: #fff transparent #fff transparent;
    animation: dcs-w2v-loading 1.2s linear infinite;
}

@keyframes dcs-w2v-loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Body Classes */
.has-product-videos .woocommerce-product-gallery {
    position: relative;
}

.has-main-product-video .woocommerce-product-gallery__image:first-child {
    position: relative;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .dcs-w2v-play-button {
        width: 60px;
        height: 60px;
    }
    
    .dcs-w2v-play-button svg {
        width: 30px;
        height: 30px;
    }
    
    .dcs-w2v-video-indicator {
        width: 30px;
        height: 30px;
    }
    
    .dcs-w2v-video-indicator svg {
        width: 15px;
        height: 15px;
    }
    
    /* Sound/Restart Icon - Mobile */
    .dcs-w2v-sound-restart-icon {
        width: 35px;
        height: 35px;
        bottom: 10px;
        right: 10px;
    }
    
    .dcs-w2v-sound-restart-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Kadence-spezifische Anpassungen */
.kadence-gallery-wrap .dcs-w2v-gallery-video-item {
    position: relative;
}

.kadence-product-gallery .dcs-w2v-video-wrapper {
    height: 100%;
    overflow: visible !important; /* Button sichtbar machen */
}

/* Sicherstellen dass der Button über Kadence-Elementen liegt */
.kadence-product-gallery .dcs-w2v-sound-restart-icon,
.kt-product-gallery-wrap .dcs-w2v-sound-restart-icon,
.splide__slide .dcs-w2v-sound-restart-icon {
    z-index: 9999 !important;
    position: absolute !important;
    display: flex !important;
    visibility: visible !important;
}

.kt-product-gallery-wrap .dcs-w2v-main-video {
    width: 100%;
    height: auto;
}

/* Kadence Shop Kit Video Integration */
.dcs-w2v-video-slide {
    position: relative;
}

.dcs-w2v-kadence-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff; /* Geändert von #000 auf #fff */
    cursor: pointer;
}

.dcs-w2v-video-poster {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dcs-w2v-video-thumb {
    position: relative;
    overflow: hidden;
}

.dcs-w2v-video-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dcs-w2v-video-thumb-placeholder svg {
    width: 40px;
    height: 40px;
    fill: #999;
}

/* Kadence Video Indicator */
.dcs-w2v-video-thumb .dcs-w2v-video-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dcs-w2v-video-thumb .dcs-w2v-video-indicator svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

/* Lightbox Integration */
.pswp__item .dcs-w2v-video-wrapper {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mfp-iframe-holder .dcs-w2v-video-wrapper {
    padding-top: 0;
}

/* Galerie Player Spezifisch */
.dcs-w2v-gallery-player {
    background: #fff; /* Geändert von #000 auf #fff */
    min-height: 300px;
}

/* Autoplay Failed State */
.dcs-w2v-autoplay-failed .dcs-w2v-play-button {
    opacity: 1;
    pointer-events: all;
}

/* Mobile Klasse */
.dcs-w2v-mobile.dcs-w2v-video-wrapper {
    max-width: 100%;
}

/* Kadence Video Wrapper - von Kadence Compat */
.dcs-w2v-kadence-video-wrapper {
    position: relative;
    width: 100%;
    background: #fff; /* Geändert von #000 auf #fff */
}

.dcs-w2v-kadence-video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}

/* Mobile spezifische Anpassungen für weißen Hintergrund */
@media screen and (max-width: 768px) {
    .dcs-w2v-video-wrapper,
    .dcs-w2v-kadence-video-wrapper,
    .dcs-w2v-gallery-player {
        background: #fff !important;
    }
    
    /* Falls das Video kleiner als der Container ist */
    .dcs-w2v-video-wrapper video,
    .dcs-w2v-kadence-video-wrapper video {
        background: #fff;
    }
    
    /* Temporärer Sound-Button nur für den Start */
    .dcs-w2v-temp-icon {
        animation: pulse 1.5s ease-in-out infinite;
    }
    
    @keyframes pulse {
        0% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.05);
        }
        100% {
            transform: scale(1);
        }
    }
    
    /* Sound Button bleibt immer sichtbar und klickbar */
    .dcs-w2v-sound-restart-icon {
        pointer-events: all !important;
        z-index: 9999 !important;
    }
}

/* Kadence Video Thumbnails */
.dcs-w2v-video-thumb img {
    width: 80px !important;
    height: 80px !important;
    object-fit: cover !important;
}

.dcs-w2v-video-thumb:hover {
    opacity: 0.8;
}

/* Z-Index Management für Überlagerungen */
.dcs-w2v-video-wrapper {
    z-index: 1;
}

.dcs-w2v-play-button {
    z-index: 10;
}

.dcs-w2v-sound-restart-icon {
    z-index: 9999 !important; /* Erhöht von 20 auf 9999 */
}

.dcs-w2v-close-video {
    z-index: 30;
}

/* Smooth Transitions */
.dcs-w2v-video-wrapper * {
    transition-property: opacity, transform, background-color, border-color;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Prevent Icon Text Selection */
.dcs-w2v-sound-restart-icon,
.dcs-w2v-play-button,
.dcs-w2v-close-video {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Compatibility Classes */
.has-kadence-product-videos .kadence-product-gallery {
    position: relative;
}

/* Ensure Video Controls are Always Visible */
.dcs-w2v-video-wrapper video[controls] {
    z-index: 5;
}

/* Fix für Splide Lazy Loading */
.splide__slide > a > img[data-splide-lazy] {
    display: none !important;
}

.splide__slide > a > img[src]:not([data-splide-lazy]) {
    display: block !important;
}

/* Active Slide Video Visibility */
.splide__slide.is-active video,
.splide__slide.is-active .dcs-w2v-kadence-video-wrapper {
    display: block !important;
    visibility: visible !important;
}

/* Kadence Gallery Min Height */
.kadence-product-gallery-main {
    min-height: 400px;
}