/* Farhina Core — mobile buy bar (product page). Below 1024px the form's own add-to-cart button and the theme's
   cart stepper are pinned into the bar; from 1024px up nothing changes. */
.fbb { display: none; }

@media (max-width: 1023.98px) {
	body.fbb-on { --fbb-h: 76px; --fbb-slot: 172px; padding-bottom: calc(var(--fbb-h) + env(safe-area-inset-bottom)); }

	/* The theme's own bar only scrolled to the buy box; ours replaces it. */
	.fbb-on .fixed:has([data-bazarak-scroll-buybox]) { display: none !important; }

	.fbb {
		display: flex; align-items: center; gap: 12px;
		position: fixed; inset-inline: 0; bottom: 0; z-index: 56;
		min-height: var(--fbb-h);
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
		background: rgba(255, 255, 255, 0.96);
		-webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
		border-top: 1px solid rgba(226, 232, 240, 0.9);
		border-radius: 22px 22px 0 0;
		box-shadow: 0 -14px 34px -20px rgba(15, 23, 42, 0.28);
	}
	.fbb__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
	.fbb__row { display: flex; align-items: center; gap: 8px; min-width: 0; }
	.fbb__price { min-width: 0; padding-top: 2px; font-size: 17px; font-weight: 900; color: #0f172a; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.fbb__price .price { margin: 0; font-size: inherit; }
	.fbb__price del { display: block; font-size: 11.5px; font-weight: 600; color: #94a3b8; line-height: 1.6; }
	.fbb__price del .woocommerce-Price-currencySymbol { display: none; }
	.fbb__price ins { text-decoration: none; background: none; }
	.fbb__price .woocommerce-Price-currencySymbol { font-size: 11px; font-weight: 700; color: #64748b; margin-inline-start: 2px; }
	.fbb__from { font-size: 12px; font-weight: 700; color: #64748b; }
	.fbb__off { flex: none; padding: 2px 8px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11.5px; font-weight: 800; line-height: 1.6; }
	.fbb__off[hidden] { display: none; }
	.fbb__status { font-size: 11.5px; line-height: 1.4; color: #64748b; min-height: 0; }
	.fbb__hint { display: block; }
	.fbb--chosen .fbb__hint, .fbb--in-cart .fbb__hint { display: none; }
	.fbb__incart { display: none; align-items: center; gap: 4px; font-weight: 700; color: #1a7f78; white-space: nowrap; }
	.fbb--in-cart .fbb__incart { display: inline-flex; }
	.fbb__incart a { margin-inline-start: 4px; padding-inline-start: 8px; border-inline-start: 1px solid #cbd5e1; color: #1a7f78; font-weight: 800; text-decoration: none; }
	.fbb__slot { flex: none; width: var(--fbb-slot); height: 48px; }
	.fbb__choose {
		display: flex; align-items: center; justify-content: center; width: 100%; height: 48px;
		border: 0; border-radius: 16px; background: rgb(var(--color-primary-600, 35 167 158)); color: #fff;
		font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
		box-shadow: 0 10px 22px -12px rgba(35, 167, 158, 0.7);
	}
	.fbb--ready .fbb__choose { display: none; }

	/* The real button and the theme's stepper, pinned into the slot. */
	.fbb-on [data-bazarak-single-cart-form] .single_add_to_cart_button,
	.fbb-on [data-bazarak-single-cart-form] [data-bazarak-product-card-cart][data-context="single"] {
		position: fixed !important; z-index: 57;
		left: 16px; bottom: calc(14px + env(safe-area-inset-bottom));
		width: var(--fbb-slot) !important; max-width: none; height: 48px; min-height: 48px;
		margin: 0 !important;
	}
	.fbb-on [data-bazarak-single-cart-form] .single_add_to_cart_button {
		display: inline-flex; align-items: center; justify-content: center; gap: 8px;
		padding: 0 12px !important; border-radius: 16px !important;
		font-size: 14px; font-weight: 800; white-space: nowrap;
		box-shadow: 0 10px 22px -12px rgba(35, 167, 158, 0.7);
	}
	.fbb-on [data-bazarak-single-cart-form] .single_add_to_cart_button.disabled { opacity: 1; filter: saturate(0.55); }
	.fbb-on [data-bazarak-single-cart-form] [data-bazarak-product-card-cart][data-context="single"] { display: flex; justify-content: flex-end; }
	.fbb-on [data-bazarak-single-cart-form] [data-bazarak-product-card-cart][data-context="single"] > [data-bazarak-card-cart-quantity] {
		width: 100%; max-width: none; height: 48px; border-radius: 16px;
		border-color: #bfe7e3; background: #f3fbfa; box-shadow: 0 8px 20px -14px rgba(35, 167, 158, 0.6);
	}
	.fbb-on [data-bazarak-single-cart-form] [data-bazarak-card-cart-value] { font-size: 16px; font-weight: 900; }
	/* Our bar shows "در سبد شما"; the stepper's own text would not fit. */
	.fbb-on [data-bazarak-single-cart-form] [data-bazarak-product-card-cart][data-context="single"] > span:not([data-bazarak-card-cart-quantity]) { display: none !important; }

	/* Keep the floating contact button and the theme's toasts above the bar. */
	.fbb-on [data-bazarak-support-float] { bottom: calc(var(--fbb-h) + 12px + env(safe-area-inset-bottom)) !important; }
	.fbb-on [data-bazarak-toast-container] { bottom: calc(var(--fbb-h) + 12px + env(safe-area-inset-bottom)) !important; }
}

@media (max-width: 359.98px) {
	body.fbb-on { --fbb-slot: 148px; }
	.fbb__price { font-size: 15px; }
}

/* Total for the quantity in the cart, under the buy-box price (all sizes). */
.fbb-total { margin-top: 6px; font-size: 12.5px; font-weight: 700; color: #1a7f78; }
.fbb-total .woocommerce-Price-amount { font-weight: 900; }
