/* CMC Sprint 12D: isolated single-product media changes. */
body.single-product .cmc-product-media-gallery .product-gallery-zoom-link { display: block; cursor: zoom-in; width: 100%; }
body.single-product .cmc-product-media-gallery .product-gallery-img { display: block; width: 100%; height: auto; }
body.single-product .cmc-product-media-gallery .cmc-product-video-slide { display: flex; align-items: center; justify-content: center; }
body.single-product .cmc-product-media-gallery .cmc-product-video-frame {
    position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
    display: grid; place-items: center; background: #f2f5f6;
}
body.single-product .cmc-product-media-gallery .cmc-product-gallery-video {
    display: block; width: 100%; height: 100%; object-fit: contain;
    background: transparent;
}
body.single-product .cmc-product-media-gallery .cmc-product-video-play {
    position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: flex; align-items: center; gap: 10px; padding: 11px 17px;
    min-height: 48px; border: 1px solid #0076a5; border-radius: 5px;
    background: #003b53; color: white; font: inherit; cursor: pointer;
}
body.single-product .cmc-product-media-gallery .cmc-product-video-play[hidden] { display: none !important; }
body.single-product .cmc-product-media-gallery .cmc-product-video-play:focus-visible,
body.single-product .cmc-product-media-gallery .cmc-product-media-thumb:focus-visible {
    outline: 3px solid #319dcb; outline-offset: 3px;
}
body.single-product .cmc-product-media-gallery .cmc-product-video-play-symbol {
    display: inline-block; width: 0; height: 0; border-top: 7px solid transparent;
    border-bottom: 7px solid transparent; border-left: 11px solid currentColor;
}
body.single-product .cmc-product-media-gallery .cmc-product-video-error {
    position: absolute; left: 12px; right: 12px; bottom: 12px;
    padding: 10px; background: #fff; color: #003b53; font-size: 14px;
}
body.single-product .cmc-product-media-gallery .cmc-product-video-error[hidden] { display: none !important; }
body.single-product .cmc-product-media-gallery .cmc-product-media-thumb {
    width: 100%; height: 84px; padding: 3px; border: 2px solid transparent;
    border-radius: 4px; background: #f4f7f8; cursor: pointer;
    display: block; position: relative; overflow: hidden;
}
body.single-product .cmc-product-media-gallery .cmc-product-media-thumb.is-active { border-color: #0076a5; }
body.single-product .cmc-product-media-gallery .cmc-product-media-thumb img {
    display: block; width: 100%; height: 100%; max-height: none; object-fit: contain;
    border: 0 !important; cursor: inherit;
}
body.single-product .cmc-product-media-gallery .cmc-product-media-video-tile {
    display: block; width: 100%; height: 100%; background: #dce9ee;
}
body.single-product .cmc-product-media-gallery .cmc-product-media-thumb-play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    display: grid; place-items: center; width: 32px; height: 32px;
    border-radius: 50%; background: #003b53; color: #fff; font-size: 12px;
}
body.single-product .cmc-product-media-gallery .cmc-product-media-thumb-play[aria-hidden] { pointer-events: none; }
@media (max-width: 767.98px) {
    body.single-product .cmc-product-media-gallery .cmc-product-video-frame { aspect-ratio: 1 / 1; }
    body.single-product .cmc-product-media-gallery .cmc-product-video-play { padding: 10px 13px; }
}

/* Sprint 13A: local poster, click-to-load privacy-enhanced YouTube player. */
body.single-product .cmc-product-media-gallery .cmc-youtube-frame {
    position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
    display: grid; place-items: center; background: #f2f5f6;
}
body.single-product .cmc-product-media-gallery .cmc-youtube-poster {
    display: block; width: 100%; height: 100%; object-fit: contain;
}
body.single-product .cmc-product-media-gallery .cmc-youtube-frame > .cmc-product-media-video-tile {
    width: 100%; height: 100%;
}
body.single-product .cmc-product-media-gallery .cmc-youtube-embed {
    position: absolute; inset: 0; z-index: 3;
}
body.single-product .cmc-product-media-gallery .cmc-youtube-embed:empty { display: none; }
body.single-product .cmc-product-media-gallery .cmc-youtube-embed iframe {
    display: block; width: 100%; height: 100%; border: 0;
}
body.single-product .cmc-product-media-gallery .cmc-youtube-open {
    position: absolute; z-index: 2; bottom: 12px; right: 12px;
    background: rgba(0, 50, 71, .92); color: #fff; padding: 7px 10px;
    border-radius: 4px; font-size: 13px;
}
body.single-product .cmc-product-media-gallery .cmc-youtube-frame.is-playing .cmc-youtube-open { display: none; }
body.single-product .cmc-product-media-gallery .cmc-youtube-frame .cmc-youtube-play[hidden] { display: none !important; }

/* Sprint 13A.3.1: presentation only. Leave image slides unchanged. */
body.single-product .cmc-product-media-gallery .cmc-product-video-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
    background: #eaf0f3;
}

body.single-product .cmc-product-media-gallery .cmc-product-video-backdrop {
    position: absolute;
    inset: -24px;
    width: calc(100% + 48px);
    height: calc(100% + 48px);
    object-fit: cover;
    filter: blur(24px);
    opacity: .36;
    pointer-events: none;
    user-select: none;
}

body.single-product .cmc-product-media-gallery .cmc-product-video-stage::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.25);
    pointer-events: none;
    z-index: 0;
}

body.single-product .cmc-product-media-gallery .cmc-product-video-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-width: 0;
    display: flex;
    overflow: hidden;
    background: #e0e7eb;
    box-shadow: 0 12px 28px rgba(0,38,57,.11);
}

/* Override the existing 1:1 aspect-ratio on native and YouTube frames. */
body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-product-video-frame,
body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-youtube-frame {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #e0e7eb;
}

body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-product-gallery-video,
body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-youtube-poster {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-youtube-embed {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
}

/* Keep the accessible name in markup, and show a restrained circular icon. */
body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-product-video-play {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 76px;
    height: 76px;
    min-width: 76px;
    min-height: 76px;
    padding: 0;
    display: grid;
    place-items: center;
    gap: 0;
    border: 1px solid rgba(255,255,255,.52);
    border-radius: 50%;
    background: rgba(0,62,91,.94);
    color: #fff;
    box-shadow: 0 8px 28px rgba(0,31,49,.25);
    transform: translate(-50%, -50%);
    transition: background-color .18s ease, box-shadow .18s ease;
    cursor: pointer;
}

body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-product-video-play:hover {
    background: #006992;
    box-shadow: 0 10px 30px rgba(0,31,49,.32);
}

body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-product-video-play:focus-visible {
    outline: 3px solid #25a4dd;
    outline-offset: 4px;
}

body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-product-video-play-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-product-video-play-symbol {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 18px solid currentColor;
}

body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-youtube-open {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 12px;
    min-height: 34px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: rgba(0,51,77,.89);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.15;
    text-decoration: none;
}

body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-youtube-open:hover,
body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-youtube-open:focus-visible {
    color: #fff;
    background: #005c82;
}

body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-youtube-open:focus-visible {
    outline: 3px solid #25a4dd;
    outline-offset: 2px;
}

/* Restrict thumbnail polish to video thumbnails, not regular product images. */
body.single-product .cmc-product-media-gallery .cmc-product-media-thumb--video.is-active {
    border-color: #007ba9;
    box-shadow: 0 0 0 1px #007ba9;
}

body.single-product .cmc-product-media-gallery .cmc-product-media-thumb--video .cmc-product-media-thumb-play {
    position: absolute;
    top: auto;
    left: auto;
    right: 5px;
    bottom: 5px;
    width: 25px;
    height: 25px;
    transform: none;
    border: 1px solid rgba(255,255,255,.4);
    background: rgba(0,62,91,.94);
    color: #fff;
    font-size: 10px;
}

@media (max-width: 767.98px) {
    body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-product-video-play {
        width: 64px;
        height: 64px;
        min-width: 64px;
        min-height: 64px;
    }
    body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-youtube-open {
        right: 8px;
        bottom: 8px;
        padding: 6px 9px;
        min-height: 32px;
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.single-product .cmc-product-media-gallery .cmc-product-video-shell .cmc-product-video-play {
        transition: none;
    }
}
