/* ==========================================================================
   MJ Cart Pro — MOBILE + TABLET only (< 1024px)
   Loaded through <link media="(max-width: 1023px)">. Desktop never sees it.
   ========================================================================== */

/* product card: thumb | name, price, controls (tablet) */
.mjcp-item { grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "thumb info" "thumb unit" "thumb foot"; gap: 4px 16px; padding: 16px; }
.mjcp-thumb { width: 96px; height: 96px; align-self: start; }
.mjcp-foot { flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; margin-top: 6px; }
.mjcp-sub { flex: 1 1 auto; min-width: 96px; }
.mjcp-rm a.remove { width: 40px !important; height: 40px !important; }

/* coupon accordion */
.mjcp-js .mjcp-coupon.has-toggle .mjcp-coupon-box { display: none; padding-top: 2px; }
.mjcp-js .mjcp-coupon.has-toggle.open .mjcp-coupon-box { display: flex; }

/* tablet (720–1023): calmer steps, coupon open, 4-up trust */
@media (min-width: 720px) {
	.mjcp-steps { max-width: 860px; margin: 0 auto 26px; }
	.mjcp .cart_totals { padding: 22px; }
	.mjcp-coupon-toggle { display: none !important; }
	.mjcp-js .mjcp-coupon.has-toggle .mjcp-coupon-box { display: flex; padding-top: 12px; }
	.mjcp-coupon.has-toggle::before { content: "کد تخفیف دارید؟"; display: block; padding: 14px 16px 0; font-size: 14.5px; font-weight: 800; color: var(--mjcp-tx); }
	.mjcp-trust { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.mjcp-trust li { flex-direction: column; text-align: center; gap: 6px; padding: 12px 6px; }
}

/* phones (< 720): two-row card */
@media (max-width: 719px) {
	.mjcp-item { grid-template-columns: 88px minmax(0, 1fr); grid-template-areas: "thumb info" "thumb unit" "foot foot"; gap: 4px 14px; padding: 14px; align-items: start; }
	.mjcp-thumb { width: 88px; height: 88px; }
	.mjcp-name { font-size: 15px; line-height: 1.75; }
	.mjcp-foot { flex-wrap: nowrap; justify-content: space-between; gap: 10px; padding-top: 12px; margin-top: 8px; border-top: 1px dashed var(--mjcp-bd2); width: 100%; }
	.mjcp-sub { flex: 1 1 auto; min-width: 0; align-items: flex-start; padding-inline: 4px; }
	.mjcp-qty .quantity { --mjcp-qw: 48px; --mjcp-qh: 38px; }
	.mjcp-qb { width: 38px; height: 38px; font-size: 22px; }
	.mjcp-rm a.remove { width: 42px !important; height: 42px !important; }
	.mjcp-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mjcp-title { font-size: 17px; }
	.mjcp .cart_totals { padding: 18px; }
}
@media (max-width: 480px) {
	.mjcp-steps { padding: 12px 8px; margin-bottom: 16px; }
	.mjcp-steps li { font-size: 11.5px; }
	.mjcp-dot { width: 28px; height: 28px; font-size: 12px; }
	.mjcp-steps li::before { top: 13px; }
	.mjcp-ship { padding: 11px 13px 13px; }
	.mjcp-ship-msg { font-size: 13px; }
	.mjcp-item { grid-template-columns: 76px minmax(0, 1fr); gap: 4px 12px; padding: 12px; }
	.mjcp-thumb { width: 76px; height: 76px; }
	.mjcp-name { font-size: 14px; }
	.mjcp-qty .quantity { --mjcp-qw: 44px; --mjcp-qh: 40px; }
	.mjcp-qb { width: 40px; height: 40px; }
	.mjcp-sub { font-size: 14.5px; }
	.mjcp-rm a.remove { width: 44px !important; height: 44px !important; }
	.mjcp-coupon-box { flex-direction: column; }
	.mjcp-coupon-box input.input-text, .mjcp .button.mjcp-apply { width: 100% !important; }
	.mjcp .cart_totals { padding: 16px; }
	.mjcp .cart_totals table tr th, .mjcp .cart_totals table tr td { font-size: 14px; }
	.mjcp .cart_totals tr.order-total td { font-size: 18px; }
}
@media (max-width: 360px) {
	.mjcp-item { grid-template-columns: 68px minmax(0, 1fr); }
	.mjcp-thumb { width: 68px; height: 68px; }
	.mjcp-foot { gap: 6px; }
	.mjcp-sub small { display: none; }
}

/* ======================================================================
   Phone-only sticky checkout bar — strictly limited to small screens.
   On laptops / desktops (>= 720px) it is removed completely.
   ====================================================================== */
.mjcp-bar { display: none; }
@media (max-width: 719px) {
	.mjcp-bar {
		display: flex; position: fixed; inset-inline: 0; bottom: var(--mjcp-off, 0px); z-index: 99990; align-items: center; justify-content: space-between; gap: 12px;
		padding: 10px calc(14px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
		background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--mjcp-bd); box-shadow: 0 -10px 30px -14px rgba(15, 37, 71, .3);
		transition: transform .3s; direction: rtl;
	}
	.mjcp-bar.hide { transform: translateY(130%); }
	.mjcp-bar-sum { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
	.mjcp-bar-sum small { color: var(--mjcp-mut); font-size: 12px; }
	.mjcp-bar-sum strong { font-size: 16px; color: var(--mjcp-tx); }
	.mjcp-bar-btn { flex: 0 1 auto; min-height: 48px; padding: 0 20px; font-size: 14.5px; white-space: nowrap; }
	body.mjcp-has-bar { padding-bottom: calc(86px + var(--mjcp-off, 0px)); }
	body:not(.mjcp-has-bar) .mjcp-bar { display: none; }
}
@media (max-width: 480px) { .mjcp-bar-btn { padding: 0 16px; font-size: 14px; } }
@media (max-width: 360px) { .mjcp-bar-sum strong { font-size: 15px; } }
@media (min-width: 720px) {
	.mjcp-bar, body .mjcp-bar { display: none !important; }
	body.mjcp-has-bar { padding-bottom: 0 !important; }
	.mjcp-toasts { bottom: calc(24px + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 900px) and (orientation: landscape) and (max-height: 480px) {
	.mjcp-bar { padding-block: 6px calc(6px + env(safe-area-inset-bottom)); }
	body.mjcp-has-bar { padding-bottom: 64px; }
	.mjcp-bar-btn { min-height: 42px; }
}

