/** Matches MUI default `sm` breakpoint (600px). */
export const PRODUCT_CARD_MOBILE_MAX_WIDTH_PX = 600;

export const PRODUCT_CARD_GAP_PX = 16;
export const PRODUCT_CARD_WIDTH_XS_PX = 260;
export const PRODUCT_CARD_WIDTH_SM_PX = 250;

export function isCompactProductCardViewport() {
  return (
    typeof window !== "undefined" &&
    window.innerWidth < PRODUCT_CARD_MOBILE_MAX_WIDTH_PX
  );
}

/** Card width + flex gap — must match Product carousel item stride for translate math. */
export function getProductCarouselItemStridePx() {
  return (
    (isCompactProductCardViewport()
      ? PRODUCT_CARD_WIDTH_XS_PX
      : PRODUCT_CARD_WIDTH_SM_PX) + PRODUCT_CARD_GAP_PX
  );
}
