/* M.B Smart Cart — only simple/variable single product purchase form */
body.single-product.woocommerce div.product .summary form.cart.product-type-simple,
body.single-product.woocommerce div.product .summary form.cart.product-type-variable { justify-content: center; }
body.single-product.woocommerce div.product .summary form.cart .mb-smart-cart__native-quantity { display: none !important; }
body.single-product.woocommerce div.product .summary form.cart .single_add_to_cart_button.mb-smart-cart__native-hidden { display: none !important; }
body.single-product.woocommerce div.product .summary .mb-smart-cart[hidden],
body.single-product.woocommerce div.product .summary .mb-smart-cart__counter[hidden],
body.single-product.woocommerce div.product .summary .mb-smart-cart__maximum[hidden] { display: none !important; }
body.single-product.woocommerce div.product .summary .mb-smart-cart {
    width: 100%; display: flex; align-items: center; flex-direction: column; gap: 3px;
    margin: 8px 0 0; color: var(--mb-primary, #8128d8); text-align: center;
}
body.single-product.woocommerce div.product .summary .mb-smart-cart__counter {
    display: grid; grid-template-columns: 46px minmax(46px, 70px) 46px;
    direction: rtl; align-items: center; justify-content: center;
    border: 1px solid var(--mb-border, #e9e6ef); border-radius: 13px;
    box-shadow: 0 3px 12px rgba(38,24,64,.08); background: #fff; overflow: hidden;
}
body.single-product.woocommerce div.product .summary .mb-smart-cart__plus,
body.single-product.woocommerce div.product .summary .mb-smart-cart__minus {
    background: transparent; border: 0; border-radius: 0; color: var(--mb-primary, #8128d8);
    padding: 0; width: 46px; height: 46px; font-size: 23px; display: grid; place-items: center;
}
body.single-product.woocommerce div.product .summary .mb-smart-cart__plus:disabled { color: #c8c1d0; cursor: not-allowed; }
body.single-product.woocommerce div.product .summary .mb-smart-cart__number { font-size: 17px; font-weight: 700; }
body.single-product.woocommerce div.product .summary .mb-smart-cart__minus svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
body.single-product.woocommerce div.product .summary .mb-smart-cart__maximum { font-size: 10px; color: var(--mb-text-muted, #737381); }
body.single-product.woocommerce div.product .summary .mb-smart-cart__message:not(:empty) { font-size: 12px; color: var(--mb-danger, #d93656); }
body.single-product.woocommerce div.product .summary .mb-smart-cart.is-busy { opacity: .6; pointer-events: none; }
body.single-product.woocommerce div.product .summary form.cart:not(.variations_form) .single_add_to_cart_button { flex: 0 1 280px; margin-inline: auto; }
body.single-product.woocommerce div.product .summary .variations_form .woocommerce-variation-add-to-cart { justify-content: center; }
body.single-product.woocommerce div.product .summary .variations_form .single_add_to_cart_button { flex: 0 1 280px; margin-inline: auto; }

/* v0.5.1: Center real purchase button and both regular/variation prices on mobile. */
@media (max-width: 767px) {
  body.single-product.woocommerce div.product .summary > p.price,
  body.single-product.woocommerce div.product .summary > span.price,
  body.single-product.woocommerce div.product .summary .woocommerce-variation-price,
  body.single-product.woocommerce div.product .summary .woocommerce-variation-price .price {
    width: 100%; text-align: center !important;
  }
  body.single-product.woocommerce div.product .summary .price del,
  body.single-product.woocommerce div.product .summary .price ins {
    display: inline-block; vertical-align: baseline;
  }
  body.single-product.woocommerce div.product .summary form.cart,
  body.single-product.woocommerce div.product .summary form.cart .woocommerce-variation-add-to-cart {
    justify-content: center !important;
  }
  body.single-product.woocommerce div.product .summary form.cart .single_add_to_cart_button {
    display: block; float: none !important; width: min(100%, 300px); flex: 0 1 300px;
    margin-inline: auto !important; text-align: center !important;
  }
  body.single-product.woocommerce div.product .summary form.cart .mb-smart-cart { align-items: center; }
}


/* =========================================================
   MarketBashi Smart Cart v0.6.1 — Classic cart page controls
   Keep the original WooCommerce quantity input in the form,
   but visually replace it only after JavaScript is ready.
   ========================================================= */
body.woocommerce-cart .mb-smart-cart-cart-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 126px;
}
body.woocommerce-cart .mb-smart-cart--cart-item {
    display: none;
    width: 100%;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    color: var(--mb-primary, #8128d8);
    text-align: center;
}
body.woocommerce-cart.mb-smart-cart-cart-ready .mb-smart-cart--cart-item {
    display: flex;
}
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__counter {
    display: grid;
    grid-template-columns: 36px minmax(34px, 44px) 36px;
    align-items: center;
    justify-content: center;
    direction: rtl;
    overflow: hidden;
    min-height: 38px;
    border: 1px solid var(--mb-border, #e9e6ef);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(38, 24, 64, .06);
}
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__plus,
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__minus {
    display: grid;
    place-items: center;
    width: 36px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--mb-primary, #8128d8);
    font-size: 21px;
    line-height: 1;
}
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__plus:disabled {
    color: #c8c1d0;
    cursor: not-allowed;
}
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__number {
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__minus svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__maximum {
    color: var(--mb-cart-muted, #737381);
    font-size: 10px;
    line-height: 1.6;
}
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__message:not(:empty) {
    max-width: 180px;
    color: var(--mb-danger, #d93656);
    font-size: 11px;
    line-height: 1.7;
}
body.woocommerce-cart .mb-smart-cart--cart-item.is-busy {
    opacity: .6;
    pointer-events: none;
}
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__counter[hidden],
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__maximum[hidden] {
    display: none !important;
}
/* Keep the native input successful for WooCommerce form actions, but visually clip it
   from first paint. PHP adds mb-smart-cart-cart-ready to the server-rendered body,
   preventing the original quantity field from flashing before the JS initializes. */
body.woocommerce-cart.mb-smart-cart-cart-ready .mb-smart-cart__native-quantity-wrap {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
@media (max-width: 600px) {
    body.woocommerce-cart .mb-smart-cart-cart-cell { min-width: 112px; }
    body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__counter {
        grid-template-columns: 32px minmax(30px, 38px) 32px;
        min-height: 35px;
    }
    body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__plus,
    body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__minus {
        width: 32px;
        height: 35px;
        font-size: 19px;
    }
}


/* MarketBashi Smart Cart v0.6.2 — unified action colors and cart link */
body.single-product .mb-smart-cart__plus,
body.woocommerce-cart .mb-smart-cart__plus {
    color: #176b3a !important; /* dark green + */
}
body.single-product .mb-smart-cart__minus--decrease,
body.woocommerce-cart .mb-smart-cart__minus--decrease {
    color: #a61f2d !important; /* dark red − */
}
body.single-product .mb-smart-cart__minus--remove,
body.woocommerce-cart .mb-smart-cart__minus--remove {
    color: #ef6b7b !important; /* light red trash */
}
body.single-product .mb-smart-cart__minus--remove svg,
body.woocommerce-cart .mb-smart-cart__minus--remove svg {
    stroke: currentColor;
}
body.single-product .mb-smart-cart__plus:disabled,
body.woocommerce-cart .mb-smart-cart__plus:disabled {
    color: #b9cdbf !important;
    cursor: not-allowed;
}

body.single-product .mb-smart-cart-purchase-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    min-width: 0;
}
body.single-product .mb-smart-cart-purchase-row > .single_add_to_cart_button {
    margin: 0 !important;
}
body.single-product.woocommerce div.product .summary .mb-smart-cart-purchase-row > .mb-smart-cart {
    width: auto;
    margin: 0;
    flex: 0 1 auto;
    align-items: center;
    flex-direction: row;
    gap: 6px;
}
body.single-product.woocommerce div.product .summary .mb-smart-cart-purchase-row > .mb-smart-cart.is-empty {
    display: none !important;
}
body.single-product .mb-smart-cart__view-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid #e4d5f4;
    border-radius: 9px;
    background: #faf6ff;
    color: #6f35a4 !important;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease;
}
body.single-product .mb-smart-cart__view-cart:hover {
    background: #f0e4ff;
    border-color: #cfb3ee;
    color: #51227f !important;
}
body.single-product .mb-smart-cart-purchase-row .mb-smart-cart__counter {
    flex: 0 0 auto;
}

/* Cart controls inherit the same colors regardless of cart row markup. */
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__plus,
body.woocommerce-cart .mb-smart-cart--cart-item .mb-smart-cart__minus {
    background: transparent;
}
@media (max-width: 480px) {
    body.single-product .mb-smart-cart-purchase-row { gap: 8px; }
    body.single-product .mb-smart-cart__view-cart { font-size: 10px; padding-inline: 8px; }
}
