/* Yebrax Stores R7 — critical mobile drawer + checkout UX closure.
   This layer MUST load last. It intentionally owns drawer stacking/touch behavior. */

@media (max-width:980px){
  html,body{overscroll-behavior-x:none;}
  body.gc-drawer-open{overflow:hidden!important;touch-action:auto!important;}

  body.ui2-panel .panel-layout,body.ui2-admin .panel-layout{isolation:auto!important;}
  body.gc-drawer-open .panel-content,body.gc-drawer-open .panel-topbar{pointer-events:none!important;}
  body.gc-drawer-open .panel-sidebar,body.gc-drawer-open .panel-sidebar *{pointer-events:auto!important;}

  body.ui2-panel .panel-overlay,
  body.ui2-admin .panel-overlay{
    display:block!important;
    position:fixed!important;
    inset:0!important;
    z-index:2147483000!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    background:rgba(2,12,24,.62)!important;
    backdrop-filter:blur(2px)!important;
    -webkit-backdrop-filter:blur(2px)!important;
    transition:opacity .18s ease,visibility .18s ease!important;
  }
  body.ui2-panel .panel-overlay.is-open,
  body.ui2-admin .panel-overlay.is-open{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }

  body.ui2-panel .panel-sidebar,
  body.ui2-admin .panel-sidebar{
    position:fixed!important;
    top:0!important;
    bottom:0!important;
    z-index:2147483001!important;
    width:min(88vw,310px)!important;
    max-width:310px!important;
    height:100dvh!important;
    max-height:100dvh!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior-y:contain!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
    pointer-events:auto!important;
    contain:layout paint style;
    will-change:transform;
  }
  body.ui2-panel .panel-layout.is-rtl .panel-sidebar,
  body.ui2-admin .panel-layout.is-rtl .panel-sidebar{
    right:0!important;left:auto!important;transform:translate3d(105%,0,0)!important;
  }
  body.ui2-panel .panel-layout.is-ltr .panel-sidebar,
  body.ui2-admin .panel-layout.is-ltr .panel-sidebar{
    left:0!important;right:auto!important;transform:translate3d(-105%,0,0)!important;
  }
  body.ui2-panel .panel-sidebar.is-open,
  body.ui2-admin .panel-sidebar.is-open{transform:translate3d(0,0,0)!important;}

  body.ui2-panel .panel-sidebar *,
  body.ui2-admin .panel-sidebar *{pointer-events:auto;}

  body.ui2-panel .panel-topbar,
  body.ui2-admin .panel-topbar{z-index:100!important;}

  body.ui2-panel .ys-mobile-sidebar-close,
  body.ui2-admin .ys-mobile-sidebar-close{
    display:inline-flex!important;
    position:absolute!important;
    inset-inline-end:8px!important;
    top:8px!important;
    z-index:6!important;
    width:42px!important;height:42px!important;
    align-items:center!important;justify-content:center!important;
    touch-action:manipulation!important;
  }

  body.ui2-panel .gc-mobile-menu-btn,
  body.ui2-admin .gc-admin-mobile-menu-btn{
    position:relative!important;
    z-index:101!important;
    touch-action:manipulation!important;
  }

  body.ui2-panel .panel-group__head,
  body.ui2-admin .panel-group__head,
  body.ui2-panel .panel-nav__item,
  body.ui2-admin .panel-nav__item{
    touch-action:manipulation!important;
    -webkit-tap-highlight-color:transparent;
  }
}

/* Checkout buttons remain large and reachable on small screens. */
@media (max-width:720px){
  body.ui2-panel .ys5-checkout{position:static!important;}
  body.ui2-panel .ys5-method{min-height:58px!important;touch-action:manipulation!important;}
  body.ui2-panel .ys5-method-copy{min-width:0;}
}
