/* XPROTEC v100.27 — final critical-shell visual regression guard.
 * This file intentionally contains only fail-closed geometry/state rules.
 * It loads last and must not restyle the brand or replace feature bundles. */

.xpc-page,
.xpc-page *,
.xpc-page *::before,
.xpc-page *::after{box-sizing:border-box}
.xpc-page img{max-width:100%}

/* Header profile: never participate in normal flow while closed. */
.xpc-header-account{position:relative!important;min-width:0}
.xpc-header-account-dropdown{
  display:none!important;
  position:absolute!important;
  right:0!important;
  top:calc(100% + 10px)!important;
  z-index:10050!important;
  max-width:min(360px,calc(100vw - 24px))!important;
}
.xpc-header-account.is-open .xpc-header-account-dropdown{display:block!important}

/* Product Finder: closed state must remain outside layout even if a component bundle fails. */
.xpc-search-overlay{
  position:fixed!important;
  inset:0!important;
  z-index:10080!important;
  display:none!important;
}
.xpc-search-overlay.is-open{display:flex!important}

/* Desktop shell baseline. Mobile drawer only becomes interactive when explicitly opened. */
.xpc-menu-toggle{display:none!important}
.xpc-nav-backdrop{display:none!important}

/* Account panel contract: after JS marks tabs ready, only active content participates in layout. */
.xpc-account-tabs.is-ready .xpc-account-tab-panel{display:none!important}
.xpc-account-tabs.is-ready .xpc-account-tab-panel.is-active{display:block!important}
.xpc-account-mobile-nav{display:none!important}

/* Admin Customer Preview: quantity/action controls cannot exceed their card cell. */
#admin-customer-preview .xpc-v76-carton-stepper,
#admin-customer-preview .xpc-bulk-order-table input[type="number"],
#admin-customer-preview .xpc-bulk-order-table td[data-label="Action"] .xpc-btn{
  max-width:100%!important;
  box-sizing:border-box!important;
}

@media(max-width:920px){
  .xpc-header{min-width:0!important}
  .xpc-header-inner{min-width:0!important;max-width:100%!important}
  .xpc-brand,.xpc-header-actions{min-width:0!important}
  .xpc-menu-toggle{display:flex!important}
  .xpc-nav{
    position:fixed!important;
    top:82px!important;
    right:0!important;
    bottom:0!important;
    z-index:10020!important;
    width:min(88vw,370px)!important;
    max-width:370px!important;
    height:calc(100dvh - 82px)!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    transform:translateX(102%)!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  .xpc-header.is-mobile-nav-open .xpc-nav{
    transform:translateX(0)!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }
  .xpc-nav-backdrop{
    position:fixed!important;
    inset:82px 0 0!important;
    z-index:10010!important;
    display:block!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  .xpc-header.is-mobile-nav-open .xpc-nav-backdrop{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }
  .xpc-header-account-dropdown{
    position:fixed!important;
    top:82px!important;
    right:10px!important;
    left:auto!important;
    width:min(340px,calc(100vw - 20px))!important;
    max-height:calc(100dvh - 94px)!important;
    overflow:auto!important;
  }
}

@media(max-width:680px){
  .xpc-account-tab-nav{display:none!important}
  .xpc-account-mobile-nav{display:grid!important;min-width:0!important}
  .xpc-account-mobile-nav select{width:100%!important;min-width:0!important;max-width:100%!important}
}

@media(max-width:1599px){
  #admin-customer-preview .xpc-v76-carton-stepper{
    width:100%!important;
    grid-template-columns:32px minmax(0,1fr) 32px!important;
  }
  #admin-customer-preview .xpc-bulk-order-table input[type="number"]{
    width:100%!important;
    min-width:0!important;
  }
}
