/* SecretToys v9 — final mobile viewport/header/bottom-nav stability.
   Loaded LAST. It deliberately overrides the older mobile rules that hide the
   header cart SVG and allow the product document to retain horizontal offset. */

@media (max-width: 991px){
  html,
  body,
  body.vp-site-body{
    margin:0!important;
    padding-left:0!important;
    padding-right:0!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:hidden!important;
    overflow-x:clip!important;
    overscroll-behavior-x:none!important;
  }

  /* One sticky mobile header. Do not make the inner card independently sticky. */
  .vp-header-v5{
    position:sticky!important;
    top:0!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    max-width:100vw!important;
    margin:0!important;
    padding:6px 8px 0!important;
    box-sizing:border-box!important;
    z-index:9990!important;
    overflow:visible!important;
  }
  .vp-header-v5 .vp-header-main{
    position:relative!important;
    top:auto!important;
    left:auto!important;
    right:auto!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    box-sizing:border-box!important;
  }
  .vp-header-v5 .vp-header-main .vp-header-main-grid{
    display:grid!important;
    grid-template-columns:46px minmax(0,1fr) 46px!important;
    grid-template-rows:60px!important;
    align-items:center!important;
    justify-items:center!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:60px!important;
    margin:0!important;
    padding:0 6px!important;
    gap:6px!important;
    box-sizing:border-box!important;
  }
  .vp-header-v5 .vp-header-main-grid > .vp-header-icon-btn.vp-mobile-only{
    display:inline-flex!important;
    grid-column:1!important;
    grid-row:1!important;
    justify-self:start!important;
    align-self:center!important;
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    margin:0!important;
    float:none!important;
  }
  .vp-header-v5 .vp-header-main-grid > .vp-logo-v5{
    display:flex!important;
    grid-column:2!important;
    grid-row:1!important;
    justify-self:center!important;
    align-self:center!important;
    justify-content:center!important;
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    width:auto!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    float:none!important;
  }
  .vp-header-v5 .vp-header-main-grid > .vp-logo-v5 img{
    display:block!important;
    width:auto!important;
    height:auto!important;
    max-width:min(190px,58vw)!important;
    max-height:48px!important;
    margin:0 auto!important;
    object-fit:contain!important;
  }
  .vp-header-v5 .vp-header-main-grid > .vp-header-search{display:none!important}
  .vp-header-v5 .vp-header-main-grid > .vp-header-actions{
    display:flex!important;
    grid-column:3!important;
    grid-row:1!important;
    justify-self:end!important;
    align-self:center!important;
    align-items:center!important;
    justify-content:center!important;
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    width:46px!important;
    min-width:46px!important;
    max-width:46px!important;
    height:46px!important;
    margin:0!important;
    padding:0!important;
    float:none!important;
  }
  .vp-header-v5 .vp-header-cart-btn{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    right:auto!important;
    top:auto!important;
    bottom:auto!important;
    transform:none!important;
    float:none!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    height:44px!important;
    margin:0!important;
    padding:0!important;
    font-size:0!important;
  }

  /* Old V8 has `.vp-header-cart-btn span{display:none}`. vp_icon() itself is a
     span, so that rule hid the CART ICON as well as the text label. */
  .vp-header-v5 .vp-header-cart-btn > .vp-header-icon,
  .vp-header-v5 .vp-header-cart-btn > .vp-header-icon.vp-icon-svg{
    display:inline-flex!important;
    visibility:visible!important;
    opacity:1!important;
    width:25px!important;
    min-width:25px!important;
    height:25px!important;
    align-items:center!important;
    justify-content:center!important;
    color:#ff9a45!important;
    font-size:25px!important;
    line-height:1!important;
  }
  .vp-header-v5 .vp-header-cart-btn > .vp-header-icon svg{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    width:25px!important;
    height:25px!important;
    max-width:none!important;
    stroke:currentColor!important;
    fill:none!important;
  }
  .vp-header-v5 .vp-header-cart-btn > span:not(.vp-header-icon){display:none!important}
  .vp-header-v5 .vp-header-cart-btn em{
    display:block!important;
    position:absolute!important;
    top:-4px!important;
    right:-4px!important;
    left:auto!important;
    bottom:auto!important;
    transform:none!important;
    z-index:4!important;
  }

  /* Bottom nav is anchored to the PHYSICAL viewport, not document width. */
  .vp-mobile-bottom-nav{
    display:grid!important;
    position:fixed!important;
    left:50%!important;
    right:auto!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    transform:translateX(-50%)!important;
    width:calc(100vw - 16px)!important;
    max-width:520px!important;
    min-width:0!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    align-items:center!important;
    box-sizing:border-box!important;
    margin:0!important;
    z-index:99990!important;
    overflow:visible!important;
  }
  .vp-mobile-bottom-nav > a,
  .vp-mobile-bottom-nav > button{
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
    min-width:0!important;
    max-width:100%!important;
    height:100%!important;
    margin:0!important;
    position:relative!important;
    transform:none!important;
  }
  .vp-mobile-bottom-nav > :first-child{
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
  }
  .vp-mobile-bottom-nav .vp-mobile-nav-icon,
  .vp-mobile-bottom-nav .vp-mobile-nav-icon.vp-icon-svg{
    display:inline-flex!important;
    visibility:visible!important;
    opacity:1!important;
  }
  .vp-mobile-bottom-nav .vp-mobile-nav-icon svg{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
  }

  /* Product route: eliminate document-level sideways movement. Internal gallery
     rails still scroll because they get their own overflow-x:auto below. */
  body.vp-product-route{
    width:100vw!important;
    max-width:100vw!important;
    min-width:0!important;
    margin:0!important;
    overflow-x:hidden!important;
    overflow-x:clip!important;
    touch-action:pan-y pinch-zoom!important;
  }
  body.vp-product-route .vp-main-shell,
  body.vp-product-route .vp-product-page{
    display:block!important;
    width:100vw!important;
    max-width:100vw!important;
    min-width:0!important;
    margin:0!important;
    padding-left:0!important;
    padding-right:0!important;
    left:0!important;
    right:auto!important;
    transform:none!important;
    overflow-x:hidden!important;
    overflow-x:clip!important;
    box-sizing:border-box!important;
  }
  body.vp-product-route .vp-product-page > .vp-container,
  body.vp-product-route .vp-product-page > .vp-container.vp-container-wide{
    display:block!important;
    width:calc(100vw - 12px)!important;
    max-width:calc(100vw - 12px)!important;
    min-width:0!important;
    margin-left:6px!important;
    margin-right:6px!important;
    padding-left:0!important;
    padding-right:0!important;
    transform:none!important;
    box-sizing:border-box!important;
  }
  body.vp-product-route .vp-product-page .vp-breadcrumbs,
  body.vp-product-route .vp-product-page .vp-product-detail,
  body.vp-product-route .vp-product-page .vp-product-gallery,
  body.vp-product-route .vp-product-page .vp-main-image,
  body.vp-product-route .vp-product-page .vp-product-summary,
  body.vp-product-route .vp-product-page .vp-product-panels,
  body.vp-product-route .vp-product-page .vp-panel,
  body.vp-product-route .vp-product-page .vp-product-information-sections,
  body.vp-product-route .vp-product-page .nova-product-info-wrap,
  body.vp-product-route .vp-product-page .nova-product-info-card,
  body.vp-product-route .vp-product-page .nova-buy-info-card{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
    left:auto!important;
    right:auto!important;
    transform:none!important;
    box-sizing:border-box!important;
  }
  body.vp-product-route .vp-product-page .vp-product-detail{
    display:block!important;
    padding:8px!important;
    overflow:hidden!important;
    overflow:clip!important;
  }
  body.vp-product-route .vp-product-page .vp-main-image img{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    box-sizing:border-box!important;
  }
  body.vp-product-route .vp-product-page .vp-gallery-carousel{
    display:grid!important;
    grid-template-columns:34px minmax(0,1fr) 34px!important;
    align-items:center!important;
    gap:6px!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:10px 0 0!important;
    padding:0!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body.vp-product-route .vp-product-page .vp-gallery-arrow{
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    width:34px!important;
    min-width:34px!important;
    max-width:34px!important;
    margin:0!important;
  }
  body.vp-product-route .vp-product-page .vp-thumb-strip{
    display:flex!important;
    flex-wrap:nowrap!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-x:contain!important;
    touch-action:pan-x!important;
    box-sizing:border-box!important;
  }
}

@media (max-width:390px){
  .vp-header-v5 .vp-header-main .vp-header-main-grid{
    grid-template-columns:42px minmax(0,1fr) 42px!important;
    padding:0 4px!important;
  }
  .vp-header-v5 .vp-header-main-grid > .vp-logo-v5 img{max-width:min(170px,56vw)!important}
  .vp-header-v5 .vp-header-main-grid > .vp-header-actions{width:42px!important;min-width:42px!important;max-width:42px!important}
}
