/* =========================================================
   SeekTik Ecommerce Modal Hotfix 1.4.0
   修复：Astra/固定导航层级高于生成器弹窗，导致右上角关闭按钮被遮挡。
========================================================= */

#xkEcomV30 .xk-modal{
  z-index:2147483000!important;
}

#xkEcomV30 .xk-backdrop{
  z-index:0!important;
}

#xkEcomV30 .xk-dialog{
  position:relative!important;
  z-index:2!important;
}

#xkEcomV30 button.xk-close{
  z-index:2147483640!important;
  pointer-events:auto!important;
  opacity:1!important;
  visibility:visible!important;
}

/* 桌面端留出顶部安全区，避免对话框顶边贴到浏览器/网站导航 */
@media (min-width:641px){
  #xkEcomV30 .xk-modal{
    align-items:flex-start!important;
    overflow-y:auto!important;
    padding-top:clamp(24px,4vh,48px)!important;
    padding-bottom:24px!important;
  }

  #xkEcomV30 .xk-dialog{
    max-height:calc(100vh - clamp(48px,8vh,96px))!important;
  }
}

@media (max-width:640px){
  #xkEcomV30 .xk-modal{
    padding-top:max(10px,env(safe-area-inset-top))!important;
  }

  #xkEcomV30 button.xk-close{
    top:14px!important;
    right:14px!important;
  }
}

/* 第二层保险：弹窗打开时主动降低 Astra / Sticky Header 常见层级 */
body.xk-ecom-modal-open header,
body.xk-ecom-modal-open .site-header,
body.xk-ecom-modal-open .ast-primary-header-bar,
body.xk-ecom-modal-open .ast-sticky-active,
body.xk-ecom-modal-open .main-header-bar-wrap,
body.xk-ecom-modal-open #ast-desktop-header,
body.xk-ecom-modal-open #ast-mobile-header{
  z-index:1000!important;
}
