/*
 MK Cart UX Polish v1.0 | 2026-11-05
 Appearance only; scoped to WooCommerce cart. Dealer and cart calculations untouched.
*/

body.woocommerce-cart{
  --mkcart-border:#dce5df;
  --mkcart-ink:#233b33;
  --mkcart-green:#2d6444;
}
body.woocommerce-cart .site-main{
  max-width:1180px!important;
  margin-inline:auto!important;
}
body.woocommerce-cart .inside-article{
  padding:clamp(16px,2.5vw,30px)!important;
}
body.woocommerce-cart .entry-content>.wp-block-woocommerce-cart{
  max-width:100%!important;
}
body.woocommerce-cart .wc-block-cart :where(.wc-block-cart__main,.wc-block-cart__sidebar){
  min-width:0;
}
body.woocommerce-cart .wc-block-cart-items__row{
  border-bottom:1px solid var(--mkcart-border)!important;
}
body.woocommerce-cart .wc-block-cart-items__row .wc-block-components-product-name{
  color:var(--mkcart-ink)!important;
  font-size:15px!important;
  font-weight:750!important;
  line-height:1.5!important;
  overflow-wrap:anywhere;
}
body.woocommerce-cart .wc-block-cart-items__row .wc-block-components-product-price,
body.woocommerce-cart .wc-block-cart-items__row .wc-block-cart-item__total-price-and-sale-badge-wrapper{
  font-size:15px;
  line-height:1.5;
  font-variant-numeric:tabular-nums;
}
body.woocommerce-cart .wc-block-cart-items__row .wc-block-cart-item__quantity{
  margin-top:10px!important;
  min-width:0;
}
/* Quantity numbers must remain fully visible, including 50, 100 and 1000. */
body.woocommerce-cart .wc-block-cart .wc-block-components-quantity-selector{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:stretch!important;
  flex:0 0 154px!important;
  width:154px!important;
  min-width:154px!important;
  max-width:none!important;
  height:48px!important;
  min-height:48px!important;
  border:1px solid #ced9d1!important;
  border-radius:10px!important;
  overflow:visible!important;
  background:#fff!important;
}
body.woocommerce-cart .wc-block-cart .wc-block-components-quantity-selector__input{
  box-sizing:border-box!important;
  appearance:textfield!important;
  -moz-appearance:textfield!important;
  flex:1 1 74px!important;
  width:74px!important;
  min-width:74px!important;
  max-width:none!important;
  height:46px!important;
  min-height:46px!important;
  margin:0!important;
  padding:0 5px!important;
  border:0!important;
  box-shadow:none!important;
  background:#fff!important;
  color:#20382a!important;
  font-family:inherit!important;
  font-size:17px!important;
  font-weight:750!important;
  line-height:46px!important;
  text-align:center!important;
  text-indent:0!important;
  letter-spacing:0!important;
  font-variant-numeric:tabular-nums!important;
  overflow:visible!important;
  opacity:1!important;
}
body.woocommerce-cart .wc-block-cart .wc-block-components-quantity-selector__input::-webkit-inner-spin-button,
body.woocommerce-cart .wc-block-cart .wc-block-components-quantity-selector__input::-webkit-outer-spin-button{
  -webkit-appearance:none!important;
  margin:0!important;
}
body.woocommerce-cart .wc-block-cart .wc-block-components-quantity-selector__button{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 37px!important;
  width:37px!important;
  min-width:37px!important;
  max-width:37px!important;
  height:46px!important;
  min-height:46px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  color:#2d6245!important;
  cursor:pointer;
}
body.woocommerce-cart .wc-block-cart .wc-block-components-quantity-selector__button:focus-visible,
body.woocommerce-cart .wc-block-cart .wc-block-components-quantity-selector__input:focus-visible{
  outline:2px solid #2b7250!important;
  outline-offset:2px!important;
}
body.woocommerce-cart .woocommerce-cart-form .quantity input.qty{
  width:90px!important;
  min-width:90px!important;
  max-width:120px!important;
  min-height:46px!important;
  padding:0 10px!important;
  text-align:center!important;
  font-size:17px!important;
  font-variant-numeric:tabular-nums;
}
/* Clearer cart total: breathing room from the card edge and aligned numbers. */
body.woocommerce-cart .wc-block-cart__sidebar{
  box-sizing:border-box;
  padding:clamp(17px,2vw,24px)!important;
  border:1px solid var(--mkcart-border);
  border-radius:15px;
  background:#fff;
  align-self:start;
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-cart__totals-title{
  font-size:18px!important;
  font-weight:800!important;
  line-height:1.35!important;
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-item{
  gap:14px!important;
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-item__label{
  min-width:0;
  line-height:1.5;
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-item__value{
  min-width:0;
  text-align:right!important;
  font-variant-numeric:tabular-nums;
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-footer-item{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:baseline!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:18px 12px 10px!important;
  margin:0 0 12px!important;
  border-top:1px solid var(--mkcart-border);
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-footer-item__label{
  flex:1 1 auto!important;
  min-width:0!important;
  font-size:16px!important;
  font-weight:750!important;
  line-height:1.4!important;
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-footer-item__value{
  flex:0 0 auto!important;
  max-width:100%!important;
  padding-inline-end:6px!important;
  margin-inline-end:0!important;
  font-size:19px!important;
  font-weight:800!important;
  line-height:1.4!important;
  text-align:right!important;
  white-space:nowrap!important;
  font-variant-numeric:tabular-nums!important;
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-footer-item__description{
  font-size:12px!important;
  line-height:1.55!important;
  overflow-wrap:anywhere;
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-cart__submit-container{
  margin-top:12px;
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-cart__submit-button{
  min-height:50px!important;
  border-radius:10px!important;
  font-weight:750!important;
}
/* Real Woo Blocks footer markup uses totals-item__value (not footer-item__value). */
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-footer-item .wc-block-components-totals-item__value{
  flex:0 0 auto!important;
  min-width:0!important;
  max-width:100%!important;
  padding-inline-end:8px!important;
  text-align:right!important;
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-footer-item .wc-block-components-totals-footer-item-tax-value{
  font-size:19px!important;
  font-weight:800!important;
  line-height:1.4!important;
  white-space:nowrap!important;
  font-variant-numeric:tabular-nums!important;
}
body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-footer-item .wc-block-components-totals-item__description{
  font-size:12px!important;
  line-height:1.55!important;
  overflow-wrap:anywhere;
}
/* Dealer form: usable, compact sections instead of tiny copy and empty columns. */
body.mkdp-dealer.woocommerce-cart .mkdp-cart{
  box-sizing:border-box;
  padding:clamp(18px,2.4vw,28px)!important;
  margin:20px 0 28px!important;
  border-radius:16px!important;
  border-color:var(--mkcart-border)!important;
  color:var(--mkcart-ink);
}
body.mkdp-dealer.woocommerce-cart .mkdp-cart>h2{
  font-size:clamp(21px,2.1vw,25px)!important;
  line-height:1.3!important;
  margin:0 0 7px!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-cart>p{
  margin:0 0 18px!important;
  color:#52665c;
  line-height:1.55;
}
body.mkdp-dealer.woocommerce-cart .mkdp-mode{
  gap:12px!important;
  margin-bottom:18px!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-mode label{
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  min-height:54px;
  padding:13px 15px!important;
  border-radius:10px!important;
  font-size:14px!important;
  line-height:1.45!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-mode input[type=radio]{
  box-sizing:border-box;
  flex:0 0 20px!important;
  width:20px!important;
  height:20px!important;
  margin:0!important;
  accent-color:var(--mkcart-green);
}
body.mkdp-dealer.woocommerce-cart .mkdp-form-grid{
  gap:12px!important;
  margin:12px 0 16px!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-form-grid label{
  font-size:14px!important;
  line-height:1.4!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-form-grid input{
  min-height:48px!important;
  margin-top:6px!important;
  font-size:16px!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-cart-lines{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:stretch;
  gap:14px!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-cart-lines>.mkdp-cart-line:only-child{
  grid-column:1/-1;
}
body.mkdp-dealer.woocommerce-cart .mkdp-cart-line{
  box-sizing:border-box;
  min-width:0!important;
  padding:18px!important;
  border-radius:12px!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-cart-line h3{
  font-size:16px!important;
  line-height:1.5!important;
  margin:0 0 8px!important;
  overflow-wrap:anywhere;
}
body.mkdp-dealer.woocommerce-cart .mkdp-cart-line p,
body.mkdp-dealer.woocommerce-cart .mkdp-cart-line small{
  font-size:13px!important;
  line-height:1.6!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-cart-line label{
  max-width:500px;
  font-size:13px!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-cart-line .mkdp-resale-price{
  box-sizing:border-box!important;
  width:100%!important;
  min-height:48px!important;
  margin-top:6px!important;
  padding-inline:12px!important;
  font-size:16px!important;
  font-variant-numeric:tabular-nums;
}
body.mkdp-dealer.woocommerce-cart .mkdp-quote-summary{
  padding:20px 22px!important;
  margin:18px 0!important;
  border:1px solid #dfebe2;
  border-radius:13px!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-quote-summary>p{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:5px 10px;
  margin:0 0 13px!important;
  font-size:14px;
  line-height:1.5;
}
body.mkdp-dealer.woocommerce-cart .mkdp-quote-summary>p strong{
  font-size:19px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
}
body.mkdp-dealer.woocommerce-cart .mkdp-buyer-totals{
  width:100%;
  margin:0!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-buyer-totals>div{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) max-content!important;
  align-items:baseline;
  gap:12px 20px!important;
  padding:6px 0;
  margin:0!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-buyer-totals dt{
  min-width:0;
  color:#4b6254;
  font-size:14px;
  line-height:1.55;
}
body.mkdp-dealer.woocommerce-cart .mkdp-buyer-totals dd{
  min-width:0;
  margin:0!important;
  color:#264735;
  text-align:right!important;
  font-size:14px;
  font-weight:650;
  line-height:1.5;
  font-variant-numeric:tabular-nums;
}
body.mkdp-dealer.woocommerce-cart .mkdp-buyer-totals .mkdp-gross{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) max-content!important;
  align-items:center!important;
  gap:12px 20px!important;
  margin-top:12px!important;
  padding-top:16px!important;
  border-top:1px solid #becfbe;
}
body.mkdp-dealer.woocommerce-cart .mkdp-buyer-totals .mkdp-gross dt,
body.mkdp-dealer.woocommerce-cart .mkdp-buyer-totals .mkdp-gross dd{
  font-size:clamp(17px,1.7vw,21px)!important;
  font-weight:800!important;
  color:#254c38!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-save-cart{
  min-height:50px!important;
  padding:12px 20px!important;
  border-radius:10px!important;
  font-weight:750!important;
}
body.mkdp-dealer.woocommerce-cart .mkdp-checkout-link{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:8px 14px;
  text-decoration:underline;
  text-underline-offset:3px;
}
/* Recommendations are secondary to completing the order. */
body.woocommerce-cart .entry-content>.mkr-shelf{
  margin:28px 0 0!important;
  padding:20px!important;
}
body.woocommerce-cart .mkr-shelf .mkr-heading{
  margin-bottom:14px;
}
body.woocommerce-cart .mkr-shelf ul.mkr-grid{
  gap:12px!important;
}
body.woocommerce-cart .mkr-shelf .mkr-card-body{
  padding:12px!important;
}
body.woocommerce-cart .mkr-shelf .mkr-card-body h3{
  font-size:14px!important;
  line-height:1.5!important;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden;
}
body.woocommerce-cart .mkr-shelf .mkr-image-wrap{
  aspect-ratio:4/3!important;
}
@media(max-width:800px){
  body.woocommerce-cart .wc-block-cart__sidebar{
    width:100%!important;
    margin-top:22px!important;
  }
  body.mkdp-dealer.woocommerce-cart .mkdp-cart-lines{
    grid-template-columns:minmax(0,1fr)!important;
  }
  body.mkdp-dealer.woocommerce-cart .mkdp-cart-lines>.mkdp-cart-line:only-child{
    grid-column:auto;
  }
}
@media(max-width:650px){
  body.woocommerce-cart .site-content{
    padding:16px 10px 48px!important;
  }
  body.woocommerce-cart .inside-article{
    padding:16px 12px!important;
  }
  body.woocommerce-cart .wc-block-cart .wc-block-components-quantity-selector{
    width:154px!important;
    min-width:154px!important;
    max-width:none!important;
  }
  body.woocommerce-cart .wc-block-cart__sidebar{
    padding:16px!important;
  }
  body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-footer-item{
    flex-wrap:wrap!important;
    padding:16px 8px 10px!important;
  }
  body.woocommerce-cart .wc-block-cart__sidebar .wc-block-components-totals-footer-item__value{
    font-size:18px!important;
  }
  body.mkdp-dealer.woocommerce-cart .mkdp-cart{
    padding:17px 14px!important;
  }
  body.mkdp-dealer.woocommerce-cart .mkdp-mode,
  body.mkdp-dealer.woocommerce-cart .mkdp-form-grid{
    grid-template-columns:minmax(0,1fr)!important;
    gap:10px!important;
  }
  body.mkdp-dealer.woocommerce-cart .mkdp-cart-line{
    padding:14px!important;
  }
  body.mkdp-dealer.woocommerce-cart .mkdp-quote-summary{
    padding:16px 14px!important;
  }
  body.mkdp-dealer.woocommerce-cart .mkdp-buyer-totals>div,
  body.mkdp-dealer.woocommerce-cart .mkdp-buyer-totals .mkdp-gross{
    grid-template-columns:minmax(0,1fr)!important;
    gap:1px!important;
    padding-block:8px!important;
  }
  body.mkdp-dealer.woocommerce-cart .mkdp-buyer-totals dd{
    justify-self:start!important;
    text-align:left!important;
    overflow-wrap:anywhere;
  }
  body.mkdp-dealer.woocommerce-cart .mkdp-quote-summary>p strong{
    font-size:18px;
  }
  body.woocommerce-cart .entry-content>.mkr-shelf{
    padding:14px!important;
  }
}

/* MK CART HOTFIX v1.2, 2026-11-05
   Scope: retail WooCommerce Blocks cart only.
   Label/price/description form a two-column grid, never three competing flex items.
   Keep native cart state, discounts, tax and shipping calculators unchanged. */
body.mk-v7.woocommerce-cart:not(.mkdp-dealer)
.wc-block-cart__sidebar .wc-block-components-totals-footer-item {
  box-sizing: border-box!important;
  display: grid!important;
  grid-template-columns: minmax(0,1fr) max-content!important;
  grid-auto-rows: auto!important;
  align-items: baseline!important;
  justify-content: stretch!important;
  column-gap: 12px!important;
  row-gap: 5px!important;
  flex-wrap: initial!important;
  min-width: 0!important;
  width: 100%!important;
  min-height: 0!important;
  padding: 12px 8px 8px!important;
  margin: 0 0 10px!important;
}
body.mk-v7.woocommerce-cart:not(.mkdp-dealer)
.wc-block-cart__sidebar .wc-block-components-totals-footer-item > :is(.wc-block-components-totals-item__label,.wc-block-components-totals-footer-item__label) {
  grid-column: 1!important;
  grid-row: 1!important;
  width: auto!important;
  max-width: none!important;
  min-width: 0!important;
  margin: 0!important;
  padding: 0!important;
  white-space: normal!important;
  word-break: normal!important;
  overflow-wrap: normal!important;
  font-size: 16px!important;
  line-height: 1.35!important;
  flex: initial!important;
}
body.mk-v7.woocommerce-cart:not(.mkdp-dealer)
.wc-block-cart__sidebar .wc-block-components-totals-footer-item > :is(.wc-block-components-totals-item__value,.wc-block-components-totals-footer-item__value) {
  grid-column: 2!important;
  grid-row: 1!important;
  justify-self: end!important;
  min-width: 0!important;
  max-width: 100%!important;
  width: auto!important;
  margin: 0!important;
  padding: 0!important;
  white-space: nowrap!important;
  text-align: right!important;
  flex: initial!important;
}
body.mk-v7.woocommerce-cart:not(.mkdp-dealer)
.wc-block-cart__sidebar .wc-block-components-totals-footer-item > :is(.wc-block-components-totals-item__description,.wc-block-components-totals-footer-item__description) {
  grid-column: 1 / -1!important;
  grid-row: 2!important;
  justify-self: end!important;
  width: 100%!important;
  margin: 0!important;
  padding: 0!important;
  color: #566458!important;
  font-size: 12px!important;
  line-height: 1.4!important;
  text-align: right!important;
  white-space: normal!important;
  overflow-wrap: anywhere!important;
  flex: initial!important;
}
body.mk-v7.woocommerce-cart:not(.mkdp-dealer)
.wc-block-cart__sidebar .wc-block-components-totals-footer-item :is(.wc-block-components-totals-footer-item-tax-value,.wc-block-formatted-money-amount) {
  font-size: clamp(17px,2vw,20px)!important;
  line-height: 1.35!important;
  white-space: nowrap!important;
}
/* Woo Blocks renders both unit price in the product and an extra thin 'Tổng cộng'
   table column; on desktop let the product details use that space.
   The authoritative cart/order total remains in the summary panel. */
@media (min-width: 768px) {
  body.mk-v7.woocommerce-cart:not(.mkdp-dealer)
  .wc-block-cart-items :is(.wc-block-cart-items__header-total,.wc-block-cart-item__total) {
    display: none!important;
  }
  body.mk-v7.woocommerce-cart:not(.mkdp-dealer) .wc-block-cart-items {
    table-layout: auto!important;
    width: 100%!important;
  }
  body.mk-v7.woocommerce-cart:not(.mkdp-dealer)
  .wc-block-cart-items .wc-block-cart-item__product {
    width: auto!important;
  }
}
@media (max-width: 767px) {
  body.mk-v7.woocommerce-cart:not(.mkdp-dealer)
  .wc-block-cart__sidebar .wc-block-components-totals-footer-item {
    grid-template-columns: minmax(0,1fr) max-content!important;
    column-gap: 9px!important;
    row-gap: 4px!important;
    padding: 12px 3px 8px!important;
  }
  body.mk-v7.woocommerce-cart:not(.mkdp-dealer)
  .wc-block-cart__sidebar .wc-block-components-totals-footer-item > :is(.wc-block-components-totals-item__label,.wc-block-components-totals-footer-item__label) {
    font-size: 15px!important;
  }
  body.mk-v7.woocommerce-cart:not(.mkdp-dealer)
  .wc-block-cart__sidebar .wc-block-components-totals-footer-item > :is(.wc-block-components-totals-item__description,.wc-block-components-totals-footer-item__description) {
    font-size: 11px!important;
  }
}
/* END MK CART HOTFIX v1.2 */
