/* Elementor Video covers and managed video lightboxes (Video / Button).
   Preserve geometry and isolate native buttons. */
.elementor-widget-video button.elementor-custom-embed-image-overlay,
.elementor-widget-video button.aqara-video-toggle {
    appearance: none !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
    font: inherit !important;
    letter-spacing: inherit !important;
    text-transform: none !important;
    cursor: pointer !important;
}
.elementor-widget-video button.elementor-custom-embed-image-overlay {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
    color: inherit !important;
    background-color: transparent !important;
}
.elementor-widget-video button.elementor-custom-embed-image-overlay::before,
.elementor-widget-video button.elementor-custom-embed-image-overlay::after,
.elementor-widget-video button.aqara-video-toggle::before,
.elementor-widget-video button.aqara-video-toggle::after { content: none !important; }
.elementor-widget-video .elementor-wrapper { position: relative; }
.elementor-widget-video button.aqara-video-toggle {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: #222 !important;
    display: grid !important;
    place-items: center !important;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
}
.elementor-widget-video .elementor-wrapper:hover .aqara-video-toggle,
.elementor-widget-video .elementor-wrapper:focus-within .aqara-video-toggle {
    opacity: 1;
    pointer-events: auto;
}
.elementor-widget-video .aqara-video-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.elementor-widget-video .aqara-video-toggle[data-playing="true"] .aqara-video-play,
.elementor-widget-video .aqara-video-toggle:not([data-playing="true"]) .aqara-video-pause { display: none; }
.elementor-widget-video .aqara-video-toggle[hidden] { display: none !important; }
.elementor-widget-video button:focus-visible,
.elementor-widget-video video:focus-visible,
.elementor-widget-video iframe:focus-visible,
[data-aqara-elementor-video-dialog] .dialog-close-button:focus-visible,
[data-aqara-elementor-video-dialog] video:focus-visible,
[data-aqara-elementor-video-dialog] iframe:focus-visible {
    outline: 2px solid #222 !important;
    outline-offset: -4px !important;
    box-shadow: inset 0 0 0 6px #fff !important;
}
@media (hover: none), (pointer: coarse) {
    .elementor-widget-video button.aqara-video-toggle { opacity: 1; pointer-events: auto; }
}
/* The provider iframe is a separate document. Mark the containing player while
   focus is inside it, without changing YouTube's own controls or tab sequence. */
[data-aqara-elementor-video-dialog] .elementor-video-wrapper:focus-within::after,
[data-aqara-elementor-video-dialog] .elementor-video-wrapper[data-aqara-player-focused]::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    border: 2px solid #222 !important;
    box-shadow: inset 0 0 0 2px #fff !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
}
[data-aqara-elementor-video-dialog] [data-aqara-video-focus-end] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
}
@media (forced-colors: active) {
    .elementor-widget-video button:focus-visible,
    .elementor-widget-video video:focus-visible,
    .elementor-widget-video iframe:focus-visible,
    [data-aqara-elementor-video-dialog] .dialog-close-button:focus-visible,
    [data-aqara-elementor-video-dialog] video:focus-visible,
    [data-aqara-elementor-video-dialog] iframe:focus-visible { outline-color: Highlight !important; }
    [data-aqara-elementor-video-dialog] .elementor-video-wrapper:focus-within::after,
    [data-aqara-elementor-video-dialog] .elementor-video-wrapper[data-aqara-player-focused]::after { border-color: Highlight !important; }
    .elementor-widget-video button.aqara-video-toggle { border: 1px solid ButtonText !important; }
}
