/* Roy Imperial v2.8: reliable submit next to native Add to Cart */
#roy-product .roy-cart-form button.roy-reliable-buy-now {
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:1 1 150px!important;min-width:150px!important;min-height:52px!important;
  margin:0!important;padding:12px 20px!important;border:1px solid #d9b66c!important;
  border-radius:8px!important;background:#fff9ee!important;color:#970c19!important;
  font:inherit!important;font-size:15px!important;font-weight:700!important;
  text-align:center!important;letter-spacing:.02em!important;text-transform:uppercase!important;
  cursor:pointer!important;box-shadow:none!important;opacity:1!important;
}
#roy-product .roy-cart-form button.roy-reliable-buy-now:hover {background:#f7e8d0!important;color:#7d0715!important}
#roy-product .roy-cart-form button.roy-reliable-buy-now:focus-visible{outline:3px solid #d9b66c!important;outline-offset:2px!important}
#roy-product .roy-cart-form .woocommerce-variation-add-to-cart button.roy-reliable-buy-now {flex:1 1 150px!important}
/* Legacy GET shortcut ignores size and uses /check/?variation_id= . */
#roy-product .roy-purchase-row a[href*="add-to-cart="][href*="variation_id="]{display:none!important}
@media(max-width:540px){
  #roy-product .roy-cart-form button.roy-reliable-buy-now{min-width:0!important;flex:1 1 130px!important;padding:10px 12px!important}
}

/* V2.8.2: The buttons now live in ONE dedicated row within the native Woo form.
   This isolates the purchase actions from variation plugins and their styling.
   Do not turn the entire variations form into a grid: it contains fields,
   hidden inputs and dynamic WooCommerce content. */
#roy-product .roy-cart-form form.cart .roy-actions-row {
  display:grid!important;
  grid-template-columns:minmax(68px,108px) minmax(0,1fr) minmax(0,1fr)!important;
  grid-template-rows:minmax(52px,auto)!important;
  align-items:stretch!important;
  justify-items:stretch!important;
  gap:10px!important;
  box-sizing:border-box!important;
  flex:1 1 100%!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:52px!important;
  height:auto!important;
  padding:0!important;
  margin:0!important;
  float:none!important;
  clear:both!important;
  overflow:visible!important;
}
#roy-product .roy-cart-form form.cart .roy-actions-row > .quantity,
#roy-product .roy-cart-form form.cart .roy-actions-row > button.single_add_to_cart_button,
#roy-product .roy-cart-form form.cart .roy-actions-row > button.roy-reliable-buy-now {
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  position:relative!important;
  float:none!important;
  clear:none!important;
  flex:none!important;
  min-width:0!important;
  max-width:100%!important;
  width:100%!important;
  min-height:52px!important;
  height:52px!important;
  margin:0!important;
  align-self:stretch!important;
  justify-self:stretch!important;
}
#roy-product .roy-cart-form form.cart .roy-actions-row > .quantity {
  grid-column:1!important;
  grid-row:1!important;
  padding:0!important;
  overflow:hidden!important;
}
#roy-product .roy-cart-form form.cart .roy-actions-row > .quantity input.qty,
#roy-product .roy-cart-form form.cart .roy-actions-row > .quantity input[type="number"] {
  min-width:0!important;
  max-width:100%!important;
  width:100%!important;
  height:50px!important;
  padding:6px!important;
}
#roy-product .roy-cart-form form.cart .roy-actions-row > button.single_add_to_cart_button {
  grid-column:2!important;
  grid-row:1!important;
  padding:10px 10px!important;
  white-space:nowrap!important;
  line-height:1.2!important;
  font-size:14px!important;
  letter-spacing:0!important;
  text-align:center!important;
  writing-mode:horizontal-tb!important;
  overflow:hidden!important;
}
#roy-product .roy-cart-form form.cart .roy-actions-row > button.roy-reliable-buy-now {
  grid-column:3!important;
  grid-row:1!important;
  padding:10px 10px!important;
  white-space:nowrap!important;
  line-height:1.2!important;
  font-size:14px!important;
  letter-spacing:0!important;
  text-align:center!important;
  writing-mode:horizontal-tb!important;
}
/* Woo variation container may still be a flex row; the actions wrapper
   takes its full width while all variation hidden inputs remain untouched. */
#roy-product .roy-cart-form form.variations_form .woocommerce-variation-add-to-cart > .roy-actions-row {
  flex:1 0 100%!important;
}
@media (max-width:700px) {
  #roy-product .roy-cart-form form.cart .roy-actions-row {
    grid-template-columns:minmax(58px,74px) minmax(0,1fr) minmax(0,1fr)!important;
    gap:7px!important;
  }
  #roy-product .roy-cart-form form.cart .roy-actions-row > button.single_add_to_cart_button,
  #roy-product .roy-cart-form form.cart .roy-actions-row > button.roy-reliable-buy-now {
    font-size:11px!important;
    padding:8px 5px!important;
  }
}
@media (max-width:355px) {
  #roy-product .roy-cart-form form.cart .roy-actions-row {
    grid-template-columns:minmax(52px,58px) minmax(0,1fr) minmax(0,1fr)!important;
    gap:5px!important;
  }
  #roy-product .roy-cart-form form.cart .roy-actions-row > button.single_add_to_cart_button,
  #roy-product .roy-cart-form form.cart .roy-actions-row > button.roy-reliable-buy-now {
    font-size:10px!important;
    padding:8px 3px!important;
  }
}

/* v2.8.3: hide recognized obsolete Buy Now shortcuts even before JS dedupes.
   Only affects product-summary legacy shortcuts; never the native form button. */
#roy-product .roy-summary a[class*="buy-now"]:not(.roy-reliable-buy-now),
#roy-product .roy-summary a[class*="buy_now"]:not(.roy-reliable-buy-now),
#roy-product .roy-summary button[class*="buy-now"]:not(.roy-reliable-buy-now):not(.roy-bulk-buy-now),
#roy-product .roy-summary button[class*="buy_now"]:not(.roy-reliable-buy-now):not(.roy-bulk-buy-now) {display:none!important;}
