/*
 * Pym Product Video — v10.4.3
 * Product video-only replacement for WooCommerce / Elementor.
 * The rules below intentionally own the layout of the replaced pym_product_display
 * slot so legacy Elementor/widget dimensions cannot collapse the professional player.
 */

.pym-product-video-only-shell,
.pym-product-video-replacement {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    transform: none !important;
    box-sizing: border-box !important;
}

/* Elementor's old product-display widget used its gallery children to establish
   width. Once that markup is replaced by a player, the widget can collapse to 0.
   Explicitly make the placeholder widget and its content container own the slot. */
body.woocommerce.single-product .elementor-widget-pym_product_display,
body.woocommerce.single-product .elementor-widget-pym_product_display > .elementor-widget-container {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    transform: none !important;
}

body.woocommerce.single-product .elementor-widget-pym_product_display .pym-product-video-replacement,
body.woocommerce.single-product .woocommerce-product-gallery .pym-product-video-replacement,
body.woocommerce.single-product .pym-product-video-only-shell .pym-product-video-replacement {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

/* Tested product-page geometry: 16:9 player, controls contained inside the stage. */
body.woocommerce.single-product .pym-product-video-replacement .pym-video-player {
    position: relative !important;
    display: block !important;
    float: none !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    aspect-ratio: 16 / 9 !important;
    background: #000 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    transform: none !important;
    z-index: auto !important;
    box-shadow: 0 8px 28px rgba(17, 24, 39, .08) !important;
    box-sizing: border-box !important;
}

body.woocommerce.single-product .pym-product-video-replacement .pym-video-container {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    aspect-ratio: auto !important;
    background: #000 !important;
    border-radius: inherit !important;
    overflow: hidden !important;
    transform: none !important;
}

body.woocommerce.single-product .pym-product-video-replacement video.pym-video-element {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #000 !important;
    transform: none !important;
}

body.woocommerce.single-product .pym-product-video-replacement .pym-video-poster {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: inherit !important;
    transform: none !important;
}

body.woocommerce.single-product .pym-product-video-replacement .pym-big-play-overlay {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-container {
    position: absolute !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    transform: none !important;
    box-sizing: border-box !important;
}

body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-row,
body.woocommerce.single-product .pym-product-video-replacement .pym-video-progress-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Native fallback retained only for stale cached 10.4.0 markup. */
.pym-elementor-product-video,
.pym-elementor-product-video .elementor-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.pym-elementor-product-video .elementor-wrapper {
    position: relative !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    border-radius: 14px !important;
    background: #000 !important;
}

.pym-elementor-product-video video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: #000 !important;
}

@media (max-width: 767px) {
    body.woocommerce.single-product .pym-product-video-replacement .pym-video-player {
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: 16 / 9 !important;
        border-radius: 12px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-container {
        padding: 7px 8px max(7px, env(safe-area-inset-bottom)) !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-row {
        gap: 5px !important;
    }
}

/* Fullscreen must escape every product/Elementor dimension constraint. */
body.woocommerce.single-product .pym-product-video-replacement .pym-video-player:fullscreen,
body.woocommerce.single-product .pym-product-video-replacement .pym-video-player:-webkit-full-screen,
body.woocommerce.single-product .pym-product-video-replacement .pym-video-player.pym-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    width: 100dvw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    z-index: 2147483000 !important;
}


/* ========================================================================== 
   v10.4.3 — Product player refinements for mobile / tablet / RTL
   - smaller controls and shorter blur panel on phones
   - clearer backward/forward behavior for Persian RTL users
   - keep poster/video more visible while preserving touch usability
   ========================================================================== */
@media (max-width: 1024px) {
    body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-container {
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-container::before {
        backdrop-filter: blur(14px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(14px) saturate(160%) !important;
        background: linear-gradient(to top, rgba(17, 17, 17, 0.42), rgba(17, 17, 17, 0.10)) !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-progress-wrapper {
        height: 6px !important;
        margin: 0 0 8px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-progress-bar {
        height: 3px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-progress-handle {
        width: 10px !important;
        height: 10px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-row {
        gap: 8px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-btn {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-btn i,
    body.woocommerce.single-product .pym-product-video-replacement .pym-video-btn svg {
        font-size: 12px !important;
        width: 12px !important;
        height: 12px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-seek-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-main-play {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-main-play i,
    body.woocommerce.single-product .pym-product-video-replacement .pym-video-main-play svg {
        font-size: 15px !important;
        width: 15px !important;
        height: 15px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-time-display {
        font-size: 11px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-seek-text {
        font-size: 8px !important;
        line-height: 1 !important;
        bottom: 3px !important;
    }
}

@media (max-width: 767px) {
    body.woocommerce.single-product .pym-product-video-replacement .pym-video-player {
        border-radius: 14px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-container {
        padding: 7px 10px calc(7px + env(safe-area-inset-bottom)) !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-container::before {
        border-radius: 14px !important;
        background: linear-gradient(to top, rgba(15, 15, 15, 0.46), rgba(15, 15, 15, 0.12)) !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-progress-wrapper {
        height: 5px !important;
        margin: 0 0 6px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-row {
        gap: 6px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-btn {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
        border-radius: 6px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-btn i,
    body.woocommerce.single-product .pym-product-video-replacement .pym-video-btn svg {
        font-size: 11px !important;
        width: 11px !important;
        height: 11px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-seek-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-main-play {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-main-play i,
    body.woocommerce.single-product .pym-product-video-replacement .pym-video-main-play svg {
        font-size: 14px !important;
        width: 14px !important;
        height: 14px !important;
        margin-top: 0 !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-time-display {
        display: none !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-volume-control {
        gap: 0 !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-seek-text {
        display: block !important;
        font-size: 7px !important;
        bottom: 2px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-big-play-btn {
        width: 62px !important;
        height: 62px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-big-play-btn i,
    body.woocommerce.single-product .pym-product-video-replacement .pym-big-play-btn svg {
        font-size: 24px !important;
        width: 24px !important;
        height: 24px !important;
    }
}

@media (max-width: 480px) {
    body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-container {
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-controls-row {
        gap: 5px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-btn {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-btn i,
    body.woocommerce.single-product .pym-product-video-replacement .pym-video-btn svg {
        font-size: 10px !important;
        width: 10px !important;
        height: 10px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-seek-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-main-play {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-main-play i,
    body.woocommerce.single-product .pym-product-video-replacement .pym-video-main-play svg {
        font-size: 13px !important;
        width: 13px !important;
        height: 13px !important;
    }

    body.woocommerce.single-product .pym-product-video-replacement .pym-video-seek-text {
        font-size: 6px !important;
    }
}
