.ccmg-product-video {
    --ccmg-video-play-size: 72px;
    --ccmg-video-overlay-opacity: 0.35;
    --ccmg-video-title-gap: 12px;
    --ccmg-video-measured-height: auto;
    --ccmg-title-size: clamp(20px, 1.45vw, 24px);
    --ccmg-title-weight: 500;
    --ccmg-title-color: rgba(0, 0, 0, 0.92);
    --ccmg-font: "Founder grotesk CCM", "Founders Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    min-height: var(--ccmg-video-measured-height, auto);
}

/*
 * Defensa para Elementor/mobile/iOS:
 * el widget puede medirse antes de que el aspect-ratio del stage termine
 * de asentarse. Permitimos que los wrappers externos crezcan sin recortar
 * y dejamos que JS propague una min-height ya estabilizada.
 */
.elementor-widget-ccmg_product_video,
.elementor-widget-ccmg_product_video .elementor-widget-container {
    display: block;
    height: auto !important;
    min-height: var(--ccmg-video-measured-height, auto);
    overflow: visible;
}

.elementor-widget-ccmg_product_video .ccmg-product-video {
    height: auto;
    min-height: var(--ccmg-video-measured-height, auto);
}

.ccmg-product-video__header {
    box-sizing: border-box;
    width: 100%;
    margin-bottom: var(--ccmg-video-title-gap);
    text-align: center;
}

.ccmg-product-video__title {
    all: unset;
    display: block;
    font-family: var(--ccmg-font);
    font-size: var(--ccmg-title-size);
    font-weight: var(--ccmg-title-weight);
    color: var(--ccmg-title-color);
    line-height: 1.2;
}

.ccmg-product-video__stage {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 18px;
    background: #121212;
    box-shadow: 0 20px 48px rgba(18, 18, 18, 0.16);
}

.ccmg-product-video__stage > .ccmg-product-video__trigger,
.ccmg-product-video__stage > .ccmg-product-video__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ccmg-product-video__frame,
.ccmg-product-video__frame iframe {
    width: 100%;
    height: 100%;
}

.ccmg-product-video__trigger {
    display: block;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 2;
    position: relative;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.ccmg-product-video__poster {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #121212;
}

.ccmg-product-video__poster-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
}

.ccmg-product-video__frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ccmg-product-video__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.38) 100%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 55%);
    opacity: var(--ccmg-video-overlay-opacity);
    transition: opacity 180ms ease;
}

.ccmg-product-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: var(--ccmg-video-play-size);
    height: var(--ccmg-video-play-size);
    color: #545454;
    transform: translate(-50%, -50%);
    transition: transform 180ms ease, opacity 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
    isolation: isolate;
}

.ccmg-product-video__play svg {
    position: relative;
    z-index: 2;
    width: 39%;
    height: 40%;
}

.ccmg-product-video--play-circle-dark .ccmg-product-video__play {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.4),
        0 10px 28px rgba(0, 0, 0, 0.16);
}

.ccmg-product-video--play-circle-dark .ccmg-product-video__play::before,
.ccmg-product-video--play-circle-light .ccmg-product-video__play::before {
    content: "";
    position: absolute;
    inset: 10%;
    z-index: 1;
    border-radius: 999px;
}

.ccmg-product-video--play-circle-dark .ccmg-product-video__play::before {
    background: #fff;
}

.ccmg-product-video--play-circle-light .ccmg-product-video__play {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.7),
        0 10px 24px rgba(0, 0, 0, 0.14);
    color: #2a2a2a;
}

.ccmg-product-video--play-circle-light .ccmg-product-video__play::before {
    background: rgba(255, 255, 255, 0.96);
}

.ccmg-product-video--play-minimal .ccmg-product-video__play {
    background: transparent;
    color: #fff;
    text-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.ccmg-product-video--no-overlay .ccmg-product-video__overlay,
.ccmg-product-video--no-play .ccmg-product-video__play {
    display: none;
}

.ccmg-product-video__trigger:hover .ccmg-product-video__play,
.ccmg-product-video__trigger:focus-visible .ccmg-product-video__play {
    transform: translate(-50%, -50%) scale(1.06);
}

.ccmg-product-video--play-circle-dark .ccmg-product-video__trigger:hover .ccmg-product-video__play,
.ccmg-product-video--play-circle-dark .ccmg-product-video__trigger:focus-visible .ccmg-product-video__play {
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.52),
        0 14px 32px rgba(0, 0, 0, 0.18);
}

.ccmg-product-video__trigger:hover .ccmg-product-video__overlay,
.ccmg-product-video__trigger:focus-visible .ccmg-product-video__overlay {
    opacity: calc(var(--ccmg-video-overlay-opacity) + 0.08);
}

.ccmg-product-video__trigger:focus-visible {
    outline: 2px solid #111;
    outline-offset: 6px;
    border-radius: 20px;
}

.ccmg-product-video__frame {
    overflow: hidden;
    border-radius: inherit;
    background: #000;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    transition: opacity 220ms ease;
}

.ccmg-product-video__frame iframe {
    border: 0;
}

.ccmg-product-video.is-playing .ccmg-product-video__stage > .ccmg-product-video__frame {
    opacity: 1;
    pointer-events: auto;
}

.ccmg-product-video.is-playing .ccmg-product-video__stage > .ccmg-product-video__trigger {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.ccmg-product-video__lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.ccmg-product-video__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 15, 0.78);
    backdrop-filter: blur(4px);
}

.ccmg-product-video__dialog {
    position: relative;
    z-index: 1;
    width: min(1000px, calc(100vw - 32px));
    margin: min(8vh, 64px) auto 0;
}

.ccmg-product-video__frame--lightbox {
    position: relative;
    inset: auto;
    opacity: 1;
    pointer-events: auto;
    border-radius: 20px;
    aspect-ratio: 16 / 9;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

.ccmg-product-video__close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #111;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    font-size: 28px;
    line-height: 1;
}

body.ccmg-product-video-lightbox-open {
    overflow: hidden;
}

@media (min-width: 768px) {
    .ccmg-product-video__stage {
        width: min(100%, 800px);
        max-height: 450px;
    }
}

@media (max-width: 1023px) {
    .ccmg-product-video {
        --ccmg-title-size: 18px;
    }
}

@media (max-width: 767px) {
    .ccmg-product-video__stage,
    .ccmg-product-video__poster,
    .ccmg-product-video__frame {
        border-radius: 14px;
    }

    .ccmg-product-video__dialog {
        width: calc(100vw - 20px);
        margin-top: 72px;
    }

    .ccmg-product-video__close {
        top: -10px;
        right: -4px;
    }

    .elementor-25425 .elementor-element.elementor-element-31aeaa5 {
        --padding-top: 8px !important;
        --padding-bottom: 8px !important;
        --padding-left: 10px !important;
        --padding-right: 10px !important;
    }
}

@media (max-width: 599px) {
    .ccmg-product-video {
        --ccmg-title-size: 16px;
        --ccmg-video-title-gap: 10px;
    }
}
