/* Nuvorelix 4.6.0 · production polish layer
   Loaded last to stabilize navigation/mobile layouts while the legacy CSS is refactored. */

:root{
  --cm-safe-inline:clamp(14px,3vw,24px);
}

html{scroll-behavior:smooth}
body.cm-nova-ux{overflow-x:hidden!important}
body.cm-nova-ux *{box-sizing:border-box}

body.cm-nova-ux :is(a,button,input,select,textarea,summary):focus-visible{
  outline:3px solid color-mix(in srgb,var(--c-primary) 45%,transparent)!important;
  outline-offset:3px!important;
}

/* ---------- storefront navigation ---------- */
body.cm-nova-ux .cm-topbar{
  position:sticky!important;
  top:0!important;
  margin:0!important;
  padding:14px 20px 0!important;
  background:transparent!important;
}
body.cm-nova-ux .cm-topbar-inner{
  min-height:70px!important;
  width:min(1280px,100%)!important;
  margin:0 auto!important;
}
@media(max-width:900px){
  body.cm-nova-ux .cm-topbar{
    top:0!important;
    margin:0!important;
    padding:14px 12px 0!important;
  }
  body.cm-nova-ux .cm-topbar-inner{
    min-height:64px!important;
    width:100%!important;
  }
  body.cm-nova-ux .cm-main-nav{
    top:90px!important;
    right:12px!important;
    width:min(86vw,350px)!important;
    max-height:calc(100dvh - 104px)!important;
  }
  body.cm-nova-ux.cm-nav-open{
    overflow:hidden!important;
  }
  body.cm-nova-ux.cm-nav-open :is(.cm-page,.site-footer,.cm-footer-prelude,.footer-bottom){
    transform:none!important;
    width:auto!important;
    max-width:none!important;
    margin-left:0!important;
  }
}
@media(max-width:420px){
  body.cm-nova-ux .cm-topbar{padding-top:12px!important}
  body.cm-nova-ux .cm-main-nav{top:86px!important;right:10px!important;width:min(88vw,330px)!important;max-height:calc(100dvh - 98px)!important}
}

/* ---------- mobile content safety ---------- */
@media(max-width:760px){
  body.cm-nova-ux .container,
  body.cm-nova-ux .cm-page{
    width:100%!important;
    max-width:100%!important;
    padding-left:14px!important;
    padding-right:14px!important;
  }

  body.cm-nova-ux :is(
    .cm-product-hero,.cm-preview-studio,.cm-product-details,.cm-plan-section,
    .customer-card,.admin-panel,.cart-panel,.cart-summary,.cm-footer-prelude
  ){
    min-width:0!important;
    max-width:100%!important;
  }

  body.cm-nova-ux :is(
    .cm-product-intro,.cm-preview-heading,.tab-panel,.cm-plan-card,
    .customer-card,.notification-body-v17,.cart-info-v17
  ) :is(h1,h2,h3,h4,p,small,strong,span){
    max-width:100%!important;
    overflow-wrap:anywhere!important;
  }

  body.cm-nova-ux.cm-product-reboot .cm-preview-header-v31,
  body.cm-nova-ux.cm-product-reboot .cm-preview-panel,
  body.cm-nova-ux.cm-product-reboot .tab-panel{
    padding-left:18px!important;
    padding-right:18px!important;
  }

  body.cm-nova-ux .account-nav{
    max-width:100%!important;
    overflow-x:auto!important;
    overscroll-behavior-inline:contain;
  }

  body.cm-nova-ux .table-scroll,
  body.cm-ultra-admin .table-scroll,
  body.cm-ultra-admin .table-wrap{
    max-width:100%!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
  }

  /* floating UI never overlaps itself */
  body.cm-nova-ux .cm-mobile-dock{
    left:10px!important;
    right:10px!important;
    bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
    min-height:70px!important;
  }
  body.cm-nova-ux .cm-mobile-buybar{
    left:10px!important;
    right:10px!important;
    bottom:calc(86px + env(safe-area-inset-bottom,0px))!important;
  }
  body.cm-nova-ux .cm-compare-tray{
    left:10px!important;
    right:10px!important;
    bottom:calc(158px + env(safe-area-inset-bottom,0px))!important;
  }
  body.cm-nova-ux .cm-compare-tray-inner{
    padding:10px 12px!important;
    border-radius:20px!important;
  }
  body.cm-nova-ux .cm-compare-summary .cm-kicker,
  body.cm-nova-ux .cm-compare-summary strong{
    display:none!important;
  }
  body.cm-nova-ux .cm-compare-chips{
    max-width:100%!important;
    overflow-x:auto!important;
    flex-wrap:nowrap!important;
  }
}

/* ---------- footer ---------- */
body.cm-nova-ux .cm-footer-prelude{
  margin-top:72px!important;
  padding:34px clamp(22px,4vw,48px)!important;
  gap:32px!important;
  background:var(--c-card)!important;
  border:1px solid var(--c-line)!important;
  color:var(--c-text)!important;
}
body.cm-nova-ux .cm-footer-prelude h2{
  margin:10px 0 12px!important;
  color:var(--c-text)!important;
}
body.cm-nova-ux .cm-footer-prelude p{
  color:var(--c-muted)!important;
  max-width:680px!important;
}
body.cm-nova-ux .cm-footer-prelude-action{
  flex:0 0 auto!important;
  margin-left:auto!important;
}
body.cm-nova-ux .site-footer.cm-footer-mega{
  padding-top:44px!important;
  padding-bottom:44px!important;
  column-gap:clamp(28px,5vw,72px)!important;
  row-gap:32px!important;
}
body.cm-nova-ux .site-footer.cm-footer-mega>div>a{
  margin-top:12px!important;
}
@media(max-width:760px){
  body.cm-nova-ux .cm-footer-prelude{
    margin-top:46px!important;
    padding:24px 20px!important;
  }
  body.cm-nova-ux .cm-footer-prelude-action{
    margin-left:0!important;
    width:100%!important;
    justify-content:center!important;
  }
  body.cm-nova-ux .site-footer.cm-footer-mega{
    padding:32px 18px 110px!important;
    gap:28px!important;
  }
}

/* ---------- admin stabilization ---------- */
body.cm-ultra-admin .admin-content{min-width:0!important}
body.cm-ultra-admin .admin-panel,
body.cm-ultra-admin .admin-kpi{min-width:0!important}
@media(max-width:760px){
  body.cm-ultra-admin .admin-topbar{
    position:sticky!important;
    top:0!important;
    z-index:45!important;
  }
  body.cm-ultra-admin .admin-top-actions{
    max-width:100%!important;
  }
  body.cm-ultra-admin .admin-page-head{
    align-items:flex-start!important;
  }
}

/* Motion respects OS accessibility setting. */
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important}
  *,*::before,*::after{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
    scroll-behavior:auto!important;
  }
}
