/* First Jack V40 — sticky, two-button purchase bar + homepage-style right-side bag.
   Keep store color variables, existing Meta handlers, catalog, and checkout untouched. */
.fj-product-themed .fj-v39-purchase-actions{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;width:min(400px,100%);
}
.fj-product-themed .fj-v39-purchase-actions .fj-v39-add{grid-column:1;grid-row:1}
.fj-product-themed .fj-v39-purchase-actions .fj-v39-buy{grid-column:2;grid-row:1}
/* Product details in two evenly sized columns, cart always on LEFT and Buy Now on RIGHT. */
@media (min-width:761px){
 body.fj-product-themed #fj-buy-form{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:start;gap:10px!important}
 body.fj-product-themed #fj-buy-form #fj-size-label{grid-column:1/-1;grid-row:1}
 body.fj-product-themed #fj-buy-form .fj-size-options{grid-column:1/-1;grid-row:2}
 body.fj-product-themed #fj-buy-form .fj-cart-action-row{grid-column:1;grid-row:3;margin:0!important;min-height:57px}
 body.fj-product-themed #fj-buy-form .fj-buy-now{grid-column:2;grid-row:3;margin:0!important;min-height:57px}
 body.fj-product-themed .fj-gallery{max-width:600px!important}
 body.fj-product-themed .fj-product-layout{grid-template-columns:minmax(0,580px) minmax(0,1fr)!important;gap:clamp(25px,3.8vw,62px)!important}
 body.fj-product-themed .fj-feature-stage{max-height:680px!important;aspect-ratio:4 / 4.65!important}
}
/* Related product buttons and homepage product cards follow the same left/right order. */
.fj-product-themed .fj-v36-related-actions .fj-v36-add{grid-column:1;grid-row:1}
.fj-product-themed .fj-v36-related-actions .fj-v36-buy{grid-column:2;grid-row:1}
.store .product-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.store .product-actions select{grid-column:1/-1;grid-row:1}
.store .product-actions .add-cart-btn{grid-column:1;grid-row:2}
.store .product-actions .buy-now-btn{grid-column:2;grid-row:2}
/* Same floating bag placement on product and home pages: middle of RIGHT edge. */
body.fj-product-themed #fj-v35-floating-shop.fj-v35-floating-shop{
 position:fixed!important;right:7px!important;top:52%!important;bottom:auto!important;
 transform:translateY(-50%)!important;z-index:55!important;
}
body.fj-product-themed #fj-v35-floating-shop.fj-v35-pop{
 animation:fjV35Glide 1.25s cubic-bezier(.17,.62,.4,1) 1!important;
}
/* On phones: use one fixed purchase bar; original buttons remain wired for existing logic,
   but are visually hidden, avoiding duplicate controls and accidental taps. */
@media(max-width:760px){
 body.fj-product-themed{padding-bottom:calc(88px + env(safe-area-inset-bottom))!important}
 body.fj-product-themed .fj-product-shell{padding-bottom:20px!important}
 body.fj-product-themed .fj-feature-stage{
   height:clamp(270px,41svh,350px)!important;min-height:270px!important;max-height:350px!important;
   aspect-ratio:auto!important;
 }
 body.fj-product-themed .fj-gallery-tiles{
   height:clamp(270px,41svh,350px)!important;min-height:270px!important;max-height:350px!important;
 }
 body.fj-product-themed #fj-buy-form .fj-buy-now,
 body.fj-product-themed #fj-buy-form .fj-cart-action-row{
   position:absolute!important;left:-10000px!important;top:auto!important;
   width:1px!important;height:1px!important;min-height:0!important;
   margin:0!important;padding:0!important;overflow:hidden!important;pointer-events:none!important;
   display:none!important; /* real actions are delegated from the fixed controls */
 }
 body.fj-product-themed #fj-buy-form{position:relative;display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:5px!important}
 body.fj-product-themed #fj-buy-form #fj-size-label,
 body.fj-product-themed #fj-buy-form .fj-size-options{grid-column:1!important;grid-row:auto!important}
 body.fj-product-themed .fj-v39-purchase{left:0!important;right:0!important;bottom:0!important;
   width:100%!important;max-width:none!important;padding:9px 12px calc(9px + env(safe-area-inset-bottom))!important;
   border-radius:16px 16px 0 0!important;z-index:45!important;
 }
 body.fj-product-themed .fj-v39-purchase-actions{width:100%!important;grid-template-columns:1fr 1fr!important;gap:10px!important}
 body.fj-product-themed .fj-v39-purchase-actions button{min-height:51px!important;font-size:clamp(12px,3.4vw,15px)!important;
   font-weight:850!important;border-radius:12px!important;padding:7px 8px!important}
 body.fj-product-themed .fj-v39-purchase.is-visible{transform:translateY(0)!important}
 body.fj-product-themed #fj-v35-floating-shop.fj-v35-floating-shop{top:52%!important;bottom:auto!important;right:5px!important;transform:translateY(-50%)!important}
 body.fj-product-themed .fj-product-footer{padding-bottom:12px!important}
}
@media(max-width:360px){
 body.fj-product-themed .fj-feature-stage,body.fj-product-themed .fj-gallery-tiles{height:272px!important;min-height:272px!important}
}
@media(prefers-reduced-motion:reduce){body.fj-product-themed .fj-v39-purchase{transition:none!important}}
