/* ==========================================================================
   KISURE FE1002 - SMOOTH MOBILE DRAWER MOTION
   ========================================================================== */

@media (max-width: 991px){

    :root{
        --ks1002-drawer-duration:280ms;
        --ks1002-backdrop-duration:220ms;
        --ks1002-drawer-ease:cubic-bezier(.22,.80,.30,1);
        --ks1002-backdrop-ease:cubic-bezier(.20,.70,.30,1);
    }

    /*
     * Preserve FE1001 viewport containing-block fix.
     */
    html[data-kisure-design="865"].kisure-mobile-menu-open body
    .ks-ref-header,
    html[data-kisure-design="865"].kisure-mobile-menu-closing body
    .ks-ref-header,
    html[data-kisure-design="865"] body
    .ks-ref-header.has-mobile-menu-open{
        position:sticky!important;
        top:0!important;
        transform:none!important;
        translate:none!important;
        scale:none!important;
        rotate:none!important;
        will-change:auto!important;
        filter:none!important;
        backdrop-filter:none!important;
        -webkit-backdrop-filter:none!important;
        perspective:none!important;
        contain:none!important;
        isolation:auto!important;
        overflow:visible!important;
        z-index:2147483000!important;
    }

    html[data-kisure-design="865"].kisure-mobile-menu-open body
    .ks-ref-header.is-scroll-hidden,
    html[data-kisure-design="865"].kisure-mobile-menu-closing body
    .ks-ref-header.is-scroll-hidden,
    html[data-kisure-design="865"] body
    .ks-ref-header.has-mobile-menu-open.is-scroll-hidden{
        transform:none!important;
        translate:none!important;
        will-change:auto!important;
    }

    /*
     * Overlay stays mounted so opacity can animate both directions.
     */
    html[data-kisure-design="865"] body
    .ks-ref-header .site-mobile-menu{
        display:block!important;
        position:fixed!important;
        inset:0!important;
        top:0!important;
        right:0!important;
        bottom:0!important;
        left:0!important;
        width:100vw!important;
        width:100dvw!important;
        height:100vh!important;
        height:100dvh!important;
        min-height:100dvh!important;
        max-height:100dvh!important;
        margin:0!important;
        padding:0!important;
        z-index:2147483600!important;

        background:rgba(5,22,24,.40)!important;
        opacity:0!important;
        visibility:hidden!important;
        pointer-events:none!important;

        transition:
            opacity var(--ks1002-backdrop-duration) var(--ks1002-backdrop-ease),
            visibility 0s linear var(--ks1002-backdrop-duration)!important;
    }

    html[data-kisure-design="865"] body
    .ks-ref-header .site-mobile-menu.is-opening,
    html[data-kisure-design="865"] body
    .ks-ref-header .site-mobile-menu.is-open,
    html[data-kisure-design="865"] body
    .ks-ref-header .site-mobile-menu.is-closing{
        visibility:visible!important;
        transition-delay:0s!important;
    }

    html[data-kisure-design="865"] body
    .ks-ref-header .site-mobile-menu.is-open{
        opacity:1!important;
        pointer-events:auto!important;
    }

    html[data-kisure-design="865"] body
    .ks-ref-header .site-mobile-menu.is-closing{
        opacity:0!important;
        pointer-events:none!important;
    }

    /*
     * Drawer motion: GPU-friendly translate3d with a softer deceleration.
     */
    html[data-kisure-design="865"] body
    .ks-ref-header .site-mobile-menu
    .site-mobile-menu__panel.ks-ref-mobile-drawer{
        position:absolute!important;
        top:0!important;
        right:0!important;
        bottom:0!important;
        left:auto!important;
        width:min(86vw,342px)!important;
        height:100%!important;
        min-height:100%!important;
        max-height:100%!important;
        margin:0!important;

        transform:translate3d(104%,0,0)!important;
        translate:none!important;
        opacity:1!important;
        visibility:visible!important;
        overflow:hidden!important;
        z-index:2147483640!important;

        will-change:transform!important;
        backface-visibility:hidden!important;
        -webkit-backface-visibility:hidden!important;

        transition:
            transform var(--ks1002-drawer-duration) var(--ks1002-drawer-ease)!important;
    }

    html[data-kisure-design="865"] body
    .ks-ref-header .site-mobile-menu.is-open
    .site-mobile-menu__panel.ks-ref-mobile-drawer{
        transform:translate3d(0,0,0)!important;
    }

    html[data-kisure-design="865"] body
    .ks-ref-header .site-mobile-menu.is-closing
    .site-mobile-menu__panel.ks-ref-mobile-drawer{
        transform:translate3d(104%,0,0)!important;
    }

    /*
     * Internal drawer navigation remains the only scrollable mobile region.
     */
    html[data-kisure-design="865"] body
    .ks-ref-header .site-mobile-menu
    .ks-ref-mobile-drawer__nav{
        flex:1 1 auto!important;
        min-height:0!important;
        overflow-y:auto!important;
        overflow-x:hidden!important;
        overscroll-behavior:contain!important;
        -webkit-overflow-scrolling:touch!important;
        touch-action:pan-y!important;
    }

    /*
     * Keep FE1001 smooth no-jump background lock during both open and closing
     * phases so the underlying page cannot move before the animation finishes.
     */
    html.kisure-mobile-menu-open,
    html.kisure-mobile-menu-closing{
        overflow:hidden!important;
        overscroll-behavior:none!important;
    }

    html.kisure-mobile-menu-open body,
    html.kisure-mobile-menu-closing body{
        overflow:hidden!important;
        overscroll-behavior:none!important;
        touch-action:none!important;
    }

    html.kisure-mobile-menu-open body .ks-ref-mobile-drawer__nav,
    html.kisure-mobile-menu-closing body .ks-ref-mobile-drawer__nav{
        touch-action:pan-y!important;
    }

    /*
     * Accessibility: remove animation for users requesting reduced motion.
     */
    @media (prefers-reduced-motion: reduce){
        html[data-kisure-design="865"] body
        .ks-ref-header .site-mobile-menu,
        html[data-kisure-design="865"] body
        .ks-ref-header .site-mobile-menu
        .site-mobile-menu__panel.ks-ref-mobile-drawer{
            transition-duration:1ms!important;
            animation-duration:1ms!important;
        }
    }
}
