/* NTV v36: unified core. No old CSS compatibility layers. */

/* Native single-product form, desktop and mobile, one row for BOTH actions. */
body.single-product .product-info form.cart .custom-btn-wrapper,
body.single-product form.cart .custom-btn-wrapper {
 display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-flow:column!important;
 gap:10px!important;align-items:stretch!important;width:min(100%,520px)!important;max-width:520px!important;
 margin:12px 0 18px!important;padding:0!important;float:none!important;clear:both!important;
 box-sizing:border-box!important;position:relative!important;
}
body.single-product form.cart .custom-btn-wrapper > button,
body.single-product form.cart .custom-btn-wrapper > .single_add_to_cart_button,
body.single-product form.cart .custom-btn-wrapper > .ntv-core-single-buy {
 display:flex!important;align-items:center!important;justify-content:center!important;
 width:100%!important;max-width:100%!important;min-width:0!important;
 height:44px!important;min-height:44px!important;max-height:44px!important;
 margin:0!important;padding:0 8px!important;float:none!important;position:static!important;
 font-size:15px!important;font-weight:700!important;line-height:1.2!important;
 white-space:normal!important;text-align:center!important;letter-spacing:0!important;
 border-radius:4px!important;box-sizing:border-box!important;transform:none!important;
}
body.single-product form.cart .custom-btn-wrapper > .ntv-core-single-buy {grid-column:1!important;grid-row:1!important;background:#d50000!important;color:#fff!important;border:1px solid #d50000!important;}
body.single-product form.cart .custom-btn-wrapper > .single_add_to_cart_button {grid-column:2!important;grid-row:1!important;background:#fff!important;color:#dc7200!important;border:1px solid #f08300!important;}
body.single-product form.cart .quantity-row {display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important;}
body.single-product form.cart .quantity-row .qty-label {margin:0!important;padding:0!important;}
body.single-product form.cart .custom-btn-wrapper .loading {opacity:.65;pointer-events:none;}

/* Shared purchase UI in loop cards. */
.woocommerce .ntv-core-loop-purchase,.ntv-core-loop-purchase {display:flex!important;flex-direction:column!important;align-items:center!important;gap:3px!important;margin:5px auto 9px!important;max-width:100%!important;}
.ntv-core-loop-purchase .quantity {margin:0!important;}
.woocommerce .ntv-core-loop-purchase .ntv-core-buy-now,.ntv-core-loop-purchase .ntv-core-buy-now {
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
 width:calc(100% - 26px)!important;max-width:184px!important;min-width:112px!important;
 height:31px!important;min-height:31px!important;margin:0 auto!important;padding:0 11px!important;
 font-size:12px!important;font-weight:700!important;line-height:1.15!important;
 border:0!important;border-radius:0!important;background:#f58220!important;color:#fff!important;box-shadow:none!important;
}
/* HTML of dock is generated by WooCommerce PHP, not inserted by JS. */
.ntv-core-mobile-dock{display:none;}
@media(max-width:849px){
 body.single-product:has(.ntv-core-mobile-dock){padding-bottom:calc(154px + env(safe-area-inset-bottom,0px))!important;}
 body.single-product form.cart .custom-btn-wrapper {width:100%!important;max-width:100%!important;}
 body.single-product .ntv-core-mobile-dock {display:block!important;position:fixed!important;left:0!important;right:0!important;bottom:0!important;z-index:10008!important;
  padding:8px max(9px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(9px,env(safe-area-inset-left,0px))!important;
  background:#fff!important;border-top:1px solid #e6e8ed!important;box-shadow:0 -7px 24px rgba(20,30,46,.12)!important;box-sizing:border-box!important;}
 body.single-product .ntv-core-dock-form {display:block!important;width:100%!important;max-width:720px!important;margin:auto!important;padding:0!important;}
 body.single-product .ntv-core-dock-top {display:flex!important;align-items:center!important;gap:9px!important;min-height:54px!important;margin-bottom:8px!important;}
 body.single-product .ntv-core-dock-image {display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 48px!important;width:48px!important;height:48px!important;border:1px solid #eee!important;border-radius:5px!important;overflow:hidden!important;}
 body.single-product .ntv-core-dock-image img {display:block!important;width:100%!important;height:100%!important;object-fit:contain!important;margin:0!important;}
 body.single-product .ntv-core-dock-detail {flex:1 1 auto!important;min-width:0!important;}
 body.single-product .ntv-core-dock-name {font-size:12px!important;font-weight:650!important;line-height:1.26!important;color:#243041!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important;overflow:hidden!important;margin-bottom:3px!important;}
 body.single-product .ntv-core-dock-price {font-size:14px!important;line-height:1.2!important;color:#1856d7!important;font-weight:800!important;white-space:nowrap!important;}
 body.single-product .ntv-core-dock-quantity {flex:0 0 99px!important;min-width:0!important;}
 body.single-product .ntv-core-dock-quantity .quantity {display:flex!important;align-items:center!important;width:99px!important;margin:0!important;}
 body.single-product .ntv-core-dock-quantity .quantity input.qty {width:37px!important;height:34px!important;min-height:34px!important;min-width:0!important;padding:0!important;text-align:center!important;font-size:13px!important;}
 body.single-product .ntv-core-dock-quantity .quantity .minus,body.single-product .ntv-core-dock-quantity .quantity .plus {width:31px!important;min-width:31px!important;height:34px!important;min-height:34px!important;margin:0!important;padding:0!important;}
 body.single-product .ntv-core-dock-actions {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;width:100%!important;}
 body.single-product .ntv-core-dock-actions button {display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;min-width:0!important;max-width:100%!important;height:43px!important;min-height:43px!important;margin:0!important;padding:0 6px!important;font-size:12px!important;font-weight:700!important;line-height:1.15!important;border-radius:5px!important;box-sizing:border-box!important;box-shadow:none!important;}
 body.single-product .ntv-core-dock-cart {background:#fff!important;color:#b96a00!important;border:1px solid #ef8b13!important;}
 body.single-product .ntv-core-dock-buy {background:#cf252d!important;color:#fff!important;border:1px solid #cf252d!important;}
 body.single-product .ntv-core-dock-feedback:not([hidden]){font-size:12px!important;line-height:1.35!important;margin:6px 0 0!important;color:#166534!important;}
 body.single-product .ntv-core-dock-feedback[data-error="1"]{color:#b42318!important;}
 /* These are the real floating contact buttons in current child-theme style.css */
 body.single-product .button-container74 {position:fixed!important;right:12px!important;bottom:calc(153px + env(safe-area-inset-bottom,0px))!important;z-index:10010!important;transform:none!important;}
 body.single-product .call-now-button,body.single-product #callnowbutton,body.single-product .hotline-phone-ring-wrap,body.single-product .zalo-chat-widget,body.single-product .fb_dialog {bottom:calc(153px + env(safe-area-inset-bottom,0px))!important;transform:none!important;}
 body.single-product .sticky-add-to-cart,body.single-product .sticky-add-to-cart--active{display:none!important;}
}

/* NTV v37: strict single-product two-button row, equal text size and no full-width legacy button. */
body.single-product form.cart .custom-btn-wrapper {
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  grid-auto-flow:row!important;align-items:stretch!important;column-gap:10px!important;
  width:100%!important;max-width:520px!important;float:none!important;
}
body.single-product form.cart .custom-btn-wrapper > .ntv-core-single-buy,
body.single-product form.cart .custom-btn-wrapper > .single_add_to_cart_button,
body.single-product form.cart .custom-btn-wrapper > .custom-ajax-add-and-redirect {
  display:flex!important;align-items:center!important;justify-content:center!important;
  grid-row:1!important;min-width:0!important;width:100%!important;max-width:100%!important;
  height:44px!important;min-height:44px!important;max-height:44px!important;
  margin:0!important;padding:0 9px!important;font-size:15px!important;
  font-weight:700!important;line-height:1.15!important;box-sizing:border-box!important;
  white-space:normal!important;text-align:center!important;float:none!important;
}
body.single-product form.cart .custom-btn-wrapper > .ntv-core-single-buy,
body.single-product form.cart .custom-btn-wrapper > .custom-ajax-add-and-redirect {grid-column:1!important;}
body.single-product form.cart .custom-btn-wrapper > .single_add_to_cart_button {grid-column:2!important;}
@media(max-width:849px){
  body.single-product form.cart .custom-btn-wrapper {grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr)!important;gap:8px!important;}
  body.single-product form.cart .custom-btn-wrapper > .ntv-core-single-buy,
  body.single-product form.cart .custom-btn-wrapper > .single_add_to_cart_button,
  body.single-product form.cart .custom-btn-wrapper > .custom-ajax-add-and-redirect {font-size:13px!important;padding:0 5px!important;}
  body.single-product .ntv-core-dock-actions {grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr)!important;}
}
/* The product-box button uses the actual server-rendered class, not legacy guesses. */
.woocommerce .ntv-core-loop-purchase .ntv-core-buy-now,
.ntv-core-loop-purchase .ntv-core-buy-now {
 background:#f58220!important;border-color:#f58220!important;
 max-width:184px!important;min-height:31px!important;height:31px!important;
 font-size:11px!important;padding:0 11px!important;
}
.ntv-core-loop-purchase .quantity {margin-bottom:0!important;}

/* NTV v38: real Flatsome/WooCommerce markup (quantity-row has two distinct siblings).
   Use a single flex row for both buttons; previous .custom-btn-wrapper grid could
   never align the sibling .single_add_to_cart_button by itself. */
body.single-product .product-info form.cart .quantity-row,
body.single-product form.cart .quantity-row {
  display:flex!important; flex-flow:row wrap!important; align-items:center!important;
  column-gap:12px!important; row-gap:10px!important;
  width:100%!important; max-width:540px!important;
  margin:0 0 16px!important; padding:0!important; box-sizing:border-box!important;
}
body.single-product form.cart .quantity-row > .qty-label {
  order:0!important; flex:0 0 auto!important; width:auto!important;
  margin:0!important; padding:0!important;
}
body.single-product form.cart .quantity-row > .ux-quantity,
body.single-product form.cart .quantity-row > .quantity {
  order:1!important; flex:0 0 auto!important; width:auto!important;
  margin:0!important;
}
/* Insert a layout-only row break after the quantity, before the two buttons. */
body.single-product form.cart .quantity-row::before {
  content:""!important; display:block!important; order:2!important;
  flex:0 0 100%!important; width:100%!important; height:0!important;
}
body.single-product form.cart .quantity-row > .custom-btn-wrapper {
  order:3!important; display:flex!important; flex:1 1 0!important;
  width:0!important; min-width:0!important; max-width:none!important;
  height:46px!important; min-height:46px!important;
  margin:0!important; padding:0!important; gap:0!important;
  float:none!important; clear:none!important; position:static!important;
  box-sizing:border-box!important; align-items:stretch!important;
}
body.single-product form.cart .quantity-row > .custom-btn-wrapper > .ntv-core-single-buy,
body.single-product form.cart .quantity-row > .single_add_to_cart_button {
  display:flex!important; align-items:center!important; justify-content:center!important;
  width:100%!important; max-width:100%!important; min-width:0!important;
  flex:1 1 auto!important; height:46px!important; min-height:46px!important; max-height:46px!important;
  float:none!important; margin:0!important; padding:0 8px!important;
  font-size:15px!important; line-height:1.15!important; font-weight:700!important;
  text-align:center!important; white-space:normal!important;
  border-radius:4px!important; box-sizing:border-box!important;
}
body.single-product form.cart .quantity-row > .single_add_to_cart_button {
  order:4!important; flex:1 1 0!important; width:0!important; max-width:none!important;
  background:#fff!important; color:#df7700!important; border:1px solid #f58220!important;
}
body.single-product form.cart .quantity-row > .custom-btn-wrapper > .ntv-core-single-buy {
  background:#d60000!important; color:#fff!important; border:1px solid #d60000!important;
}
@media(max-width:849px){
  body.single-product form.cart .quantity-row {column-gap:8px!important;row-gap:8px!important;}
  body.single-product form.cart .quantity-row > .custom-btn-wrapper {flex:1.1 1 0!important;height:44px!important;min-height:44px!important;}
  body.single-product form.cart .quantity-row > .single_add_to_cart_button {flex:.9 1 0!important;}
  body.single-product form.cart .quantity-row > .custom-btn-wrapper > .ntv-core-single-buy,
  body.single-product form.cart .quantity-row > .single_add_to_cart_button {
    height:44px!important;min-height:44px!important;max-height:44px!important;
    font-size:13px!important;padding:0 5px!important;
  }
  /* Mobile dock: exact Vietnamese label with compact secondary CTA and dominant buy CTA. */
  body.single-product .ntv-core-dock-actions {grid-template-columns:minmax(0,1fr) minmax(0,1.06fr)!important;gap:8px!important;}
  body.single-product .ntv-core-dock-actions .ntv-core-dock-cart {
    font-size:10px!important;font-weight:700!important;letter-spacing:-.15px!important;
    padding:0 3px!important;color:#b96a00!important;background:#fff!important;border:1px solid #ef8b13!important;
  }
  body.single-product .ntv-core-dock-actions .ntv-core-dock-buy {
    font-size:15px!important;font-weight:800!important;letter-spacing:.2px!important;
    background:#cf252d!important;color:#fff!important;border:1px solid #cf252d!important;
  }
}
